keywords

package
v0.0.0-...-3f873ad Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Converter

type Converter interface {
	Convert(string) (interface{}, error)
}

type Index

type Index [2]string

func ParseIndex

func ParseIndex(s string) Index

func (Index) String

func (t Index) String() string

type Indices

type Indices []Index

func (Indices) Len

func (t Indices) Len() int

func (Indices) Less

func (t Indices) Less(i, j int) bool

func (Indices) Swap

func (t Indices) Swap(i, j int)

type Inherit

type Inherit int
const (
	InheritLeaf2Head Inherit = iota
	InheritHead2Leaf
	InheritLeaf
	InheritHead
)

type Keyword

type Keyword struct {
	Section string
	Option  string
	Attr    string

	// Scopable means the keyword can have a different value on nodes, drpnodes, encapnodes or a specific node.
	Scopable bool

	// Required means the keyword mean be set, and thus disregards the default value.
	Required bool

	// Converter is the routine converting from string a the keyword expected type.
	Converter Converter

	// Text is a text explaining the role of the keyword.
	Text Text

	// DefaultText is a text explaining the default value.
	DefaultText Text

	// Example demonstrates the keyword usage.
	Example string

	// Default is the value returned when the non-required keyword is not set.
	Default string

	// DefaultOption is the name of the option looked up in the
	// DEFAULT section if the keyword is not set. If not set,
	// the string in the Option field is looked up in the DEFAULT
	// section.
	DefaultOption string

	// Candidates is the list of accepted values. An empty list.
	Candidates []string

	// Depends is a list of key-value conditions to meet to accept this keyword in a config.
	Depends []keyop.T

	// Kind limits the scope of this keyword to the object with kind matching this mask.
	Kind naming.Kinds

	// Provisioning is set to true for keywords only used for resource provisioning
	Provisioning bool

	// Types limits the scope of the keyword to sections with matching type value
	Types []string

	// Aliases defines alternate names of the keyword.
	Aliases []string

	// Inherit defines weither DEFAULT.<name> overrides <rid>.<name> (Head2Leaf), or
	// <rid>.<name> overrides DEFAULT.<name> (Leaf2Head, the default), or only <rid>.<name>
	// is used (Leaf).
	Inherit Inherit

	// Deprecated is the release where the keyword has been deprecated. Users can
	// expect the keyword to be unsupported in the next release.
	Deprecated string

	// ReplacedBy means the keyword is deprecated but another keyword can be used instead.
	ReplacedBy string
}

Keyword represents a configuration option in an object or node configuration file

func (Keyword) DefaultKey

func (t Keyword) DefaultKey() key.T

func (Keyword) Doc

func (t Keyword) Doc(depth int) string

func (Keyword) IsZero

func (t Keyword) IsZero() bool

func (Keyword) Name

func (t Keyword) Name() string

Name is a func required by the resource manifest Attr interface

func (*Keyword) SetValue

func (t *Keyword) SetValue(r, v interface{}) error

type Store

type Store []Keyword

func (Store) Doc

func (t Store) Doc(kind naming.Kind, depth int) (string, error)

func (Store) DriverDoc

func (t Store) DriverDoc(section, typ string, kind naming.Kind, depth int) (string, error)

func (Store) KeywordDoc

func (t Store) KeywordDoc(section, typ, option string, kind naming.Kind, depth int) (string, error)

func (Store) KeywordsByDriver

func (t Store) KeywordsByDriver(kind naming.Kind) map[Index]map[string]Keyword

func (Store) Len

func (t Store) Len() int

func (Store) Less

func (t Store) Less(i, j int) bool

func (Store) Lookup

func (t Store) Lookup(k key.T, kind naming.Kind, sectionType string) Keyword

func (Store) Swap

func (t Store) Swap(i, j int)

type Text

type Text struct {
	// contains filtered or unexported fields
}

func NewText

func NewText(fs embed.FS, path string) Text

func (Text) IsZero

func (t Text) IsZero() bool

func (Text) String

func (t Text) String() string

Jump to

Keyboard shortcuts

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