Documentation
¶
Index ¶
Constants ¶
View Source
const ( RootStructNameGeneralConfig = "GeneralConfig" RootStructNameSecretsConfig = "SecretsConfig" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Field ¶
type Field struct {
Name,
Type,
Doc string
Embedded bool
DefaultValue string
// Required and EnumOptions are derived from the `validate` struct tag:
// Required from a top-level `required` or `notblank` rule (false when
// `omitempty` is present), EnumOptions from a top-level `oneof=a b c`
// rule. Rules after a `dive` govern slice/map elements, not the field
// itself, and are ignored by both.
Required bool
EnumOptions []string
}
type Structs ¶
type Structs struct {
// GeneralConfig and SecretsConfig are called the root structs,
// corresponding to the general.yaml and secrets.yaml files respectively.
Roots []*Struct
All map[string]*Struct
}
func NewStructsFromAST ¶
func (*Structs) ResolveEmbeddedStructFields ¶
func (structs *Structs) ResolveEmbeddedStructFields()
For each struct, we remove the embedded struct fields, and add the corresponding promoted fields.
Iterates structs.Sorted rather than structs.All directly: a struct that both embeds another and is itself embedded elsewhere (e.g. AutoScalableNodeGroup, embedded by AzureAutoScalableNodeGroup) resolves differently depending on whether it has already been mutated by this same loop when a later struct promotes its fields — map iteration order is randomized per run, so that dependency must go through a deterministic order instead.
Click to show internal directories.
Click to hide internal directories.