Expose sequence placement controls in the public API
This commit is contained in:
11
layered.go
11
layered.go
@@ -12,8 +12,12 @@ type Input struct {
|
||||
// path or append a relative destination declared in YAML. Its zero value
|
||||
// keeps root placement.
|
||||
Destination Path
|
||||
Imports bool
|
||||
Filesystem *FilesystemContext
|
||||
// PlacementMode defaults to mapping placement. Sequence-item placement wraps
|
||||
// the source mapping as one record; unknown values and an empty destination
|
||||
// fail option validation before acquisition.
|
||||
PlacementMode PlacementMode
|
||||
Imports bool
|
||||
Filesystem *FilesystemContext
|
||||
}
|
||||
|
||||
// Underlay contains inputs that must compose strictly within one tier. Tiers
|
||||
@@ -55,10 +59,11 @@ func LoadLayered[T any](main Input, supplied ...LayeredOptions[T]) (*Result[T],
|
||||
}
|
||||
|
||||
func toEngineInput(input Input) engine.Input {
|
||||
return engine.Input{
|
||||
result := engine.Input{
|
||||
Source: input.Source.toEngine(), Imports: input.Imports,
|
||||
Filesystem: toEngineFilesystemContext(input.Filesystem), Destination: toEnginePath(input.Destination),
|
||||
}
|
||||
return engine.InputWithPlacement(result, uint8(input.PlacementMode))
|
||||
}
|
||||
|
||||
func toEngineLayeredOptions[T any](options LayeredOptions[T]) engine.LayeredOptions[T] {
|
||||
|
||||
Reference in New Issue
Block a user