Expose input destinations through the public facade
This commit is contained in:
18
layered.go
18
layered.go
@@ -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),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user