parameters

package
v1.0.14 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2023 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CEL *cel.Env
)
View Source
var CurlyReplacement = regexp.MustCompile(`\$\{[^}]+\}|#\{(?:[^}{]|\{[^}{]+\})*\}`)

${var.name} or #{cel - expression {optionaly one nested level of braces for maps}}

Functions

func CelEval

func CelEval(expr string, component string, depends []string, kv map[string]interface{}) (string, error)

func ExpandParameter

func ExpandParameter(parameter *manifest.Parameter, componentDepends []string, kv map[string]interface{}) []error

func FindValue

func FindValue(parameterName string, componentName string, componentDepends []string,
	kv map[string]interface{}) (interface{}, bool)

func MergeOutput

func MergeOutput(outputs CapturedOutputs, add CapturedOutput)

func MergeOutputs

func MergeOutputs(outputs CapturedOutputs, toMerge CapturedOutputs)

func OutputQualifiedName

func OutputQualifiedName(name, component string) string

func OutputsKV

func OutputsKV(outputs CapturedOutputs) map[string]interface{}

func ParametersAndOutputsKV

func ParametersAndOutputsKV(parameters LockedParameters, outputs CapturedOutputs, outputFilter func(CapturedOutput) bool) map[string]interface{}

func ParametersAndOutputsKVWithDepends

func ParametersAndOutputsKVWithDepends(parameters LockedParameters, outputs CapturedOutputs, depends []string) map[string]interface{}

func ParametersKV

func ParametersKV(parameters LockedParameters) map[string]interface{}

func PrintCapturedOutputs

func PrintCapturedOutputs(outputs CapturedOutputs)

func PrintCapturedOutputsByComponent

func PrintCapturedOutputsByComponent(outputs CapturedOutputs, component string)

func PrintCapturedOutputsList

func PrintCapturedOutputsList(outputs []CapturedOutput)

func PrintLockedParameters

func PrintLockedParameters(parameters LockedParameters)

func PrintLockedParametersList

func PrintLockedParametersList(parameters []LockedParameter)

func RequireExpansion

func RequireExpansion(value interface{}) bool

func StripCurly

func StripCurly(match string) (string, bool)

Types

type CapturedOutput

type CapturedOutput struct {
	Component       string      `yaml:",omitempty" json:"component,omitempty"`
	ComponentOrigin string      `yaml:"componentOrigin,omitempty" json:"-"`
	ComponentKind   string      `yaml:"componentKind,omitempty" json:"-"`
	Name            string      `json:"name"`
	Value           interface{} `json:"value"`
	Brief           string      `yaml:",omitempty" json:"brief,omitempty"`
	Kind            string      `yaml:",omitempty" json:"kind,omitempty"`
}

func CapturedOutputsToList

func CapturedOutputsToList(outputs CapturedOutputs) []CapturedOutput

func CapturedOutputsToListByComponent

func CapturedOutputsToListByComponent(outputs CapturedOutputs, component string) []CapturedOutput

func (*CapturedOutput) QName

func (o *CapturedOutput) QName() string

type CapturedOutputs

type CapturedOutputs map[string]CapturedOutput

func OutputsFromList

func OutputsFromList(toMerge ...[]CapturedOutput) CapturedOutputs

type ExpandedOutput

type ExpandedOutput struct {
	Name  string
	Value interface{}
	Brief string `yaml:",omitempty"`
	Kind  string `yaml:",omitempty"`
}

func ExpandRequestedOutputs

func ExpandRequestedOutputs(parameters LockedParameters, outputs CapturedOutputs,
	requestedOutputs []manifest.Output, mustExist bool) []ExpandedOutput

type LockedParameter

type LockedParameter struct {
	Component string `yaml:",omitempty"`
	Name      string
	Value     interface{}
	Env       string `yaml:",omitempty"`
}

func ExpandParameters

func ExpandParameters(componentName, componentKind string, componentDepends []string,
	parameters LockedParameters, outputs CapturedOutputs,
	componentParameters []manifest.Parameter) ([]LockedParameter, []error)

func LockedParametersToList

func LockedParametersToList(parameters LockedParameters) []LockedParameter

func (*LockedParameter) QName

func (p *LockedParameter) QName() string

type LockedParameters

type LockedParameters map[string]LockedParameter

func LockParameters

func LockParameters(parameters []manifest.Parameter,
	extraValues []manifest.Parameter,
	ask func(manifest.Parameter) (interface{}, error)) (LockedParameters, []error)

func MergeParameters

func MergeParameters(parameters LockedParameters, toMerge ...[]LockedParameter) LockedParameters

func ParametersFromList

func ParametersFromList(toMerge ...[]LockedParameter) LockedParameters
func ParametersWithoutLinks(parameters LockedParameters) LockedParameters

type RawOutput

type RawOutput struct {
	Name  string
	Value string
}

func RawOutputsToList

func RawOutputsToList(outputs RawOutputs) []RawOutput

type RawOutputs

type RawOutputs map[string]string

Jump to

Keyboard shortcuts

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