defaults

package
v0.1.12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 12, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package defaults provides functionality for managing default values and configurations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Default

type Default = tool.Tool

Default is an alias of tool.Tool for convenience.

type Defaults

type Defaults map[string]*Default

Defaults represents a collection of default values for tools.

func NewDefaultsFromBytes added in v0.0.13

func NewDefaultsFromBytes(data []byte) (*Defaults, error)

NewDefaultsFromBytes initializes a new Defaults instance from the provided data.

func (Defaults) BuildGraph added in v0.0.13

func (d Defaults) BuildGraph() (*dag.DAG[string], error)

BuildGraph builds a directed acyclic graph (DAG) from the defaults.

func (*Defaults) Get added in v0.0.13

func (d *Defaults) Get(name string) *Default

Get returns the default with the given name from the defaults map. If the default is not found, it returns nil.

func (*Defaults) Load

func (d *Defaults) Load(data []byte) error

Load initializes the Defaults instance from the provided file.

func (*Defaults) MergeFrom added in v0.0.13

func (d *Defaults) MergeFrom(others ...*Default) error

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

func (d *Defaults) MergeWith(others ...*Default) error

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

func (d *Defaults) Pick(names ...string) (tools []*Default, err error)

Pick returns a slice of defaults from the defaults map based on the provided names.

func (Defaults) ResolveInheritance added in v0.0.13

func (d Defaults) ResolveInheritance() error

ResolveInheritance validates inheritance and mutates every Default so that all parents' fields are applied.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL