Expose input destinations through the public facade

This commit is contained in:
2026-10-14 13:56:22 +00:00
parent 751787ec24
commit 53601e68ed
7 changed files with 429 additions and 16 deletions

View File

@@ -2,13 +2,17 @@ package configkit
import "gitea.maximumdirect.net/eric/ConfigKit/internal/engine"
// Input selects one source, whether its imports are enabled, and any explicit
// filesystem context. A zero Source is invalid; use NoSource() for an omitted
// main input. Sources keep their documented reuse and reader ownership rules.
// Input selects one source, its application destination, whether its imports are
// enabled, and any explicit filesystem context. A zero Source is invalid; use
// NoSource() for an omitted main input. Sources keep their documented reuse and
// reader ownership rules.
type Input struct {
Source Source
Imports bool
Filesystem *FilesystemContext
Source Source
// Destination selects the mapping path where Source and its imported
// application contributions are placed. Its zero value keeps root placement.
Destination Path
Imports bool
Filesystem *FilesystemContext
}
// Underlay contains inputs that must compose strictly within one tier. Tiers
@@ -46,7 +50,7 @@ func LoadLayered[T any](main Input, supplied ...LayeredOptions[T]) (*Result[T],
func toEngineInput(input Input) engine.Input {
return engine.Input{
Source: input.Source.toEngine(), Imports: input.Imports,
Filesystem: toEngineFilesystemContext(input.Filesystem),
Filesystem: toEngineFilesystemContext(input.Filesystem), Destination: toEnginePath(input.Destination),
}
}