Help us shape the future of Go! Take the 2026 Go Developer Survey

doc

package
v2.28.0 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const IGNITION_VARIANT = "ignition"
View Source
const ROOT_COMPONENT = "root"

Variables

This section is empty.

Functions

This section is empty.

Types

type Components

type Components map[string]DocNode

func IgnitionComponents

func IgnitionComponents() (Components, error)

func ParseComponents

func ParseComponents(r io.Reader) (Components, error)

func (Components) Generate

func (comps Components) Generate(vers VariantVersions, config any, ignore IgnoreFunc, w io.Writer) error

func (Components) Merge

func (comps Components) Merge(override Components) error

type Constraint

type Constraint struct {
	Variant string  `yaml:"variant"`
	MinVer  *string `yaml:"min"`
	MaxVer  *string `yaml:"max"`
}

type Constraints

type Constraints []Constraint

type DocNode

type DocNode struct {
	Name        string      `yaml:"name"`
	Description string      `yaml:"desc"`
	Required    *bool       `yaml:"required"`
	RequiredIf  Constraints `yaml:"required-if"`
	Transforms  []Transform `yaml:"transforms"`
	Children    []DocNode   `yaml:"children"`

	Component string `yaml:"use"`
	After     string `yaml:"after"`

	// populated after component resolution
	Parent *DocNode
}

type IgnoreFunc

type IgnoreFunc func([]string) bool

takes a slice of path elements, returns whether to ignore the subtree

type Transform

type Transform struct {
	Regex       string      `yaml:"regex"`
	Replacement string      `yaml:"replacement"`
	Constraints Constraints `yaml:"if"`
	Descendants bool        `yaml:"descendants"`
}

type VariantVersions

type VariantVersions map[string]semver.Version

Jump to

Keyboard shortcuts

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