config

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	XPathRoot           = ""
	XPathSliceIndexNone = -1
	XPathSeparator      = "."

	MultiValueSeparator = ":"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ChartConfig

type ChartConfig struct {
	Logger       logr.Logger
	Chartname    string            `yaml:"chartname"`
	SharedValues GenericMap        `yaml:"sharedValues"`
	GlobalConfig Config            `yaml:"globalConfig"`
	FileConfig   map[string]Config `yaml:"fileConfig"`
}

func NewChartConfig

func NewChartConfig(logger logr.Logger, chartname string) *ChartConfig

func (*ChartConfig) GetFormattedCondition added in v0.3.0

func (c *ChartConfig) GetFormattedCondition(xc *XPathConfig, prefix string) (string, bool)

func (*ChartConfig) GetFormattedKeyWithDefaultValue

func (c *ChartConfig) GetFormattedKeyWithDefaultValue(xc *XPathConfig, prefix string) (string, KeyType)

func (*ChartConfig) Validate

func (c *ChartConfig) Validate() error

func (*ChartConfig) Values

func (cc *ChartConfig) Values() (string, error)

type Condition added in v0.4.2

type Condition struct {
	Key   string `yaml:"key,omitempty"`
	Value bool   `yaml:"value,omitempty"`
}

type Config

type Config map[XPath]XPathConfigs

type GenericMap

type GenericMap map[string]interface{}

type KeyType

type KeyType string
const (
	KeyTypeFile     KeyType = "file"
	KeyTypeBuiltIn  KeyType = "builtin"
	KeyTypeShared   KeyType = "shared"
	KeyTypeHelpers  KeyType = "helpers"
	KeyTypeNotFound KeyType = "notfound"
)

func (KeyType) IsHelpersType

func (t KeyType) IsHelpersType() bool

type XPath

type XPath string

func (XPath) IsRoot

func (xpath XPath) IsRoot() bool

func (XPath) NewChild

func (xpath XPath) NewChild(s string, sliceIndex int) XPath

func (XPath) NewElement added in v0.4.2

func (xpath XPath) NewElement(sliceIndex int) XPath

type XPathConfig

type XPathConfig struct {
	Strategy          XPathStrategy   `yaml:"strategy"`
	Key               string          `yaml:"key"`
	Value             interface{}     `yaml:"value,omitempty"`
	DefaultValue      interface{}     `yaml:"defaultValue,omitempty"`
	Regex             string          `yaml:"regex,omitempty"`
	RegexCompiled     *regexp2.Regexp `yaml:"-"`
	Conditions        []Condition     `yaml:"conditions,omitempty"`
	ConditionOperator *string         `yaml:"conditionOperator,omitempty"`
	// Deprecated
	Condition      string `yaml:"condition,omitempty"`
	ConditionValue bool   `yaml:"conditionValue,omitempty"`
}

func (*XPathConfig) ValueRequiresQuote added in v0.2.0

func (xc *XPathConfig) ValueRequiresQuote() bool

type XPathConfigs

type XPathConfigs []XPathConfig

type XPathStrategy

type XPathStrategy string
const (
	XPathStrategyInline        XPathStrategy = "inline"
	XPathStrategyInlineYAML    XPathStrategy = "inline-yaml"
	XPathStrategyNewline       XPathStrategy = "newline"
	XPathStrategyNewlineYAML   XPathStrategy = "newline-yaml"
	XPathStrategyControlIf     XPathStrategy = "control-if"
	XPathStrategyControlIfYAML XPathStrategy = "control-if-yaml"
	XPathStrategyControlWith   XPathStrategy = "control-with"
	XPathStrategyControlRange  XPathStrategy = "control-range"
	XPathStrategyFileIf        XPathStrategy = "file-if"
	XPathStrategyInlineRegex   XPathStrategy = "inline-regex"
	XPathStrategyAppendWith    XPathStrategy = "append-with"
)

Jump to

Keyboard shortcuts

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