Expose native filesystem sources through public loading API
This commit is contained in:
21
records.go
21
records.go
@@ -11,6 +11,19 @@ const (
|
||||
LayerResolution Layer = "resolution"
|
||||
)
|
||||
|
||||
// SourceKind identifies how a configuration source was acquired, independent
|
||||
// of its precedence layer.
|
||||
type SourceKind string
|
||||
|
||||
const (
|
||||
SourceKindFile SourceKind = "file"
|
||||
SourceKindFilesystem SourceKind = "filesystem"
|
||||
SourceKindBytes SourceKind = "bytes"
|
||||
SourceKindReader SourceKind = "reader"
|
||||
SourceKindMapping SourceKind = "mapping"
|
||||
SourceKindCLI SourceKind = "cli"
|
||||
)
|
||||
|
||||
// ChangeKind identifies a recorded operation. The zero value is
|
||||
// used for input and default origins.
|
||||
type ChangeKind string
|
||||
@@ -156,14 +169,16 @@ type Location struct {
|
||||
Column int
|
||||
}
|
||||
|
||||
// SourceInfo describes a source discovered during a load. Path is a canonical
|
||||
// local path when one exists. ImportedFrom identifies the declaration that
|
||||
// included this source.
|
||||
// SourceInfo describes a source discovered during a load. Kind identifies its
|
||||
// acquisition, independent of Layer. Path is canonical for a host file and
|
||||
// namespace-relative for a filesystem file; synthetic sources have no Path.
|
||||
// ImportedFrom identifies the declaration that included this source.
|
||||
type SourceInfo struct {
|
||||
ID string
|
||||
Label string
|
||||
Path string
|
||||
Layer Layer
|
||||
Kind SourceKind
|
||||
ImportedFrom *Location
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user