Expose native filesystem sources through public loading API

This commit is contained in:
2026-09-29 17:36:20 +00:00
parent 6111cb23a1
commit 1ff3c812a7
18 changed files with 430 additions and 36 deletions

View File

@@ -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
}