values

package
v1.23.1 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2023 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InputKey         = "input"
	FunctionsArgsKey = "function_args"
	ResolverInputKey = "resolver_input"
	StepKey          = "step"
	ConfigKey        = "config"
	TaskKey          = "task"
	VarKey           = "var"
	IteratorKey      = "iterator" // reserved for transient one-off values, set/unset when applying values to template

	StateKey    = "state"
	PreHookKey  = "pre_hook"
	OutputKey   = "output"
	MetadataKey = "metadata"
	ChildrenKey = "children"
	ErrorKey    = "error"
)

keys to store/retrieve data from a Values struct

Variables

This section is empty.

Functions

This section is empty.

Types

type Values

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

Values is a container for all the live data of a running task

func NewValues

func NewValues() *Values

NewValues instantiates a new Values holder, complete with custom templating functions available to task template authors

func (*Values) Apply

func (v *Values) Apply(templateStr string, item interface{}, stepName string) ([]byte, error)

Apply takes data from Values to replace templating placeholders in a string

func (*Values) Clone added in v1.8.0

func (v *Values) Clone() (*Values, error)

Clone duplicates the values object

func (*Values) GetChildren

func (v *Values) GetChildren(stepName string) interface{}

GetChildren returns the collection of results issued from a named "foreach" step

func (*Values) GetError added in v1.0.1

func (v *Values) GetError(stepName string) interface{}

GetError returns the error resulting from a failed step

func (*Values) GetMetadata

func (v *Values) GetMetadata(stepName string) interface{}

GetMetadata returns the metadata of a named step

func (*Values) GetOutput

func (v *Values) GetOutput(stepName string) interface{}

GetOutput returns the output of a named step

func (*Values) GetState added in v1.4.1

func (v *Values) GetState(stepName string) interface{}

GetState returns the state of a step

func (*Values) GetSteps

func (v *Values) GetSteps() map[string]interface{}

GetSteps returns all consolidated step data stored in Values

func (*Values) GetVariables

func (v *Values) GetVariables() map[string]*Variable

GetVariables returns all template variables stored in Values

func (*Values) SetChildren

func (v *Values) SetChildren(stepName string, value interface{})

SetChildren stores the collection of results issued from a named "foreach" step

func (*Values) SetConfig

func (v *Values) SetConfig(cfg map[string]interface{})

SetConfig stores items retrieved from configstore in Values

func (*Values) SetError added in v1.0.1

func (v *Values) SetError(stepName string, value interface{})

SetError stores the error resulting from a failed step

func (*Values) SetFunctionsArgs added in v1.7.0

func (v *Values) SetFunctionsArgs(in map[string]interface{})

SetFunctionsArgs stores a task function args in Values

func (*Values) SetInput

func (v *Values) SetInput(in map[string]interface{})

SetInput stores a task's inputs in Values

func (*Values) SetIterator

func (v *Values) SetIterator(i interface{})

SetIterator stores the data for the current item in an iteration

func (*Values) SetMetadata

func (v *Values) SetMetadata(stepName string, value interface{})

SetMetadata stores a step's metadata in Values

func (*Values) SetOutput

func (v *Values) SetOutput(stepName string, value interface{})

SetOutput stores a step's output in Values

func (*Values) SetPreHook added in v1.8.0

func (v *Values) SetPreHook(output, metadata interface{})

SetPreHook stores a step's prehook in Values

func (*Values) SetResolverInput

func (v *Values) SetResolverInput(in map[string]interface{})

SetResolverInput stores a task resolver's inputs in Values

func (*Values) SetState added in v1.4.1

func (v *Values) SetState(stepName string, value interface{})

SetState stores the state of a step

func (*Values) SetTaskInfos

func (v *Values) SetTaskInfos(t map[string]interface{})

SetTaskInfos stores task-related data in Values

func (*Values) SetVariables

func (v *Values) SetVariables(vars []Variable)

SetVariables stores template-defined variables in Values

func (*Values) UnsetChildren

func (v *Values) UnsetChildren(stepName string)

UnsetChildren empties results for a named "foreach" step

func (*Values) UnsetError added in v1.0.1

func (v *Values) UnsetError(stepName string)

UnsetError empties the error from a failed step

func (*Values) UnsetIterator

func (v *Values) UnsetIterator()

UnsetIterator cleans up data on iterator

func (*Values) UnsetMetadata

func (v *Values) UnsetMetadata(stepName string)

UnsetMetadata empties the metadata of a named step

func (*Values) UnsetOutput

func (v *Values) UnsetOutput(stepName string)

UnsetOutput empties the output data of a named step

func (*Values) UnsetState added in v1.4.1

func (v *Values) UnsetState(stepName string)

UnsetState empties the state of a step

type Variable

type Variable struct {
	Name              string      `json:"name"`
	Expression        string      `json:"expression"`
	ExpressionTimeout string      `json:"expression_timeout"`
	Value             interface{} `json:"value"`
	// contains filtered or unexported fields
}

Variable holds a named variable, with either a JS expression to be evalued or a concrete value

Jump to

Keyboard shortcuts

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