Documentation
¶
Overview ¶
Package defaults provides functionality for managing default values and configurations.
Index ¶
- type Default
- type Defaults
- func (d Defaults) BuildGraph() (*dag.DAG[string], error)
- func (d *Defaults) Get(name string) *Default
- func (d *Defaults) Load(data []byte) error
- func (d *Defaults) MergeFrom(others ...*Default) error
- func (d *Defaults) MergeWith(others ...*Default) error
- func (d *Defaults) Pick(names ...string) (tools []*Default, err error)
- func (d Defaults) ResolveInheritance() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Defaults ¶
Defaults represents a collection of default values for tools.
func NewDefaultsFromBytes ¶ added in v0.0.13
NewDefaultsFromBytes initializes a new Defaults instance from the provided data.
func (Defaults) BuildGraph ¶ added in v0.0.13
BuildGraph builds a directed acyclic graph (DAG) from the defaults.
func (*Defaults) Get ¶ added in v0.0.13
Get returns the default with the given name from the defaults map. If the default is not found, it returns nil.
func (*Defaults) MergeFrom ¶ added in v0.0.13
MergeFrom merges the current default with the provided defaults, the sequence being.
d[name] <- others[0] <-- others[1] <-- others[2]...
func (*Defaults) MergeWith ¶ added in v0.0.13
MergeWith merges all the stored defaults with the provided defaults. The sequence is:
others[0] <-- others[1] <-- others[2]... <-- d[name]
func (*Defaults) Pick ¶ added in v0.0.13
Pick returns a slice of defaults from the defaults map based on the provided names.
func (Defaults) ResolveInheritance ¶ added in v0.0.13
ResolveInheritance validates inheritance and mutates every Default so that all parents' fields are applied.