variable

package
v0.0.0-...-dec34ff Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MapVariable

type MapVariable struct {
	Elements map[string]Variable
	// contains filtered or unexported fields
}

func NewMapVariable

func NewMapVariable(elements map[string]Variable) *MapVariable

func (*MapVariable) ReferencedComponents

func (v *MapVariable) ReferencedComponents() []string

func (*MapVariable) TransformValue

func (v *MapVariable) TransformValue(f TransformValueFunc) (any, error)

func (*MapVariable) Type

func (v *MapVariable) Type() Type

type ScalarVariable

type ScalarVariable struct {
	Content any
	// contains filtered or unexported fields
}

func MustCreateNewScalarVariable

func MustCreateNewScalarVariable(t *testing.T, value any) *ScalarVariable

func NewScalarVariable

func NewScalarVariable(content any) (*ScalarVariable, error)

func (*ScalarVariable) ReferencedComponents

func (v *ScalarVariable) ReferencedComponents() []string

func (*ScalarVariable) TransformValue

func (v *ScalarVariable) TransformValue(f TransformValueFunc) (any, error)

func (*ScalarVariable) Type

func (v *ScalarVariable) Type() Type

type SliceVariable

type SliceVariable struct {
	Elements []Variable
	// contains filtered or unexported fields
}

func NewSliceVariable

func NewSliceVariable(elements []Variable) *SliceVariable

func (*SliceVariable) ReferencedComponents

func (v *SliceVariable) ReferencedComponents() []string

func (*SliceVariable) TransformValue

func (v *SliceVariable) TransformValue(f TransformValueFunc) (any, error)

func (*SliceVariable) Type

func (v *SliceVariable) Type() Type

type TransformValueFunc

type TransformValueFunc func(value any) (any, error)

func ModuleTransformFunc

func ModuleTransformFunc() TransformValueFunc

func RemoteStateTransformFunc

func RemoteStateTransformFunc(repository *state.Repository, siteIdentifier string) TransformValueFunc

type Type

type Type string
const (
	Scalar Type = "scalar"
	Map    Type = "map"
	Slice  Type = "slice"
)

type Variable

type Variable interface {
	Type() Type
	TransformValue(f TransformValueFunc) (any, error)
	ReferencedComponents() []string
}

type VariablesMap

type VariablesMap map[string]Variable

func (*VariablesMap) ListReferencedComponents

func (vl *VariablesMap) ListReferencedComponents() []string

func (*VariablesMap) Transform

func (vl *VariablesMap) Transform(f TransformValueFunc) (map[string]any, error)

func (*VariablesMap) UnmarshalYAML

func (vl *VariablesMap) UnmarshalYAML(value *yaml.Node) error

Jump to

Keyboard shortcuts

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