model

package
v1.1.1921 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get[V any](vars *ServerVars, key string) (V, error)

Get takes the desired return type as parameter and safely searches the map and returns the value if it is found and is of the desired type.

Types

type ServerVars

type ServerVars struct {
	Vals map[string]any
	// contains filtered or unexported fields
}

ServerVars manages server variables with a map of key-value pairs.

func NewServerVars

func NewServerVars() *ServerVars

NewServerVars creates and returns a new instance of Vars,

func NewServerVarsWithSpec added in v1.1.1563

func NewServerVarsWithSpec(spec *model.TaskSpec) *ServerVars

NewServerVarsWithSpec creates and returns a new instance of Vars,

func (*ServerVars) Decode

func (vars *ServerVars) Decode(ctx context.Context, b []byte) error

Decode decodes a go binary object containing workflow variables.

func (*ServerVars) Encode

func (vars *ServerVars) Encode(ctx context.Context) ([]byte, error)

Encode encodes the map of workflow variables into a go binary to be sent across the wire.

func (*ServerVars) GetBool

func (vars *ServerVars) GetBool(key string) (bool, error)

GetBool validates that a key has an underlying value in the map[int]interface{} vars and safely returns the result.

func (*ServerVars) GetBools added in v1.1.1563

func (vars *ServerVars) GetBools(key string) ([]bool, error)

GetBools validates that a key has an underlying value in the map[string]interface{} vars and safely returns the result.

func (*ServerVars) GetFloat64

func (vars *ServerVars) GetFloat64(key string) (float64, error)

GetFloat64 validates that a key has an underlying value in the map[int]interface{} vars and safely returns the result.

func (*ServerVars) GetFloat64s added in v1.1.1563

func (vars *ServerVars) GetFloat64s(key string) ([]float64, error)

GetFloat64s validates that a key has an underlying value in the map[string]interface{} vars and safely returns the result.

func (*ServerVars) GetInt64

func (vars *ServerVars) GetInt64(key string) (int64, error)

GetInt64 validates that a key has an underlying value in the map[int]interface{} vars and safely returns the result.

func (*ServerVars) GetInt64s added in v1.1.1563

func (vars *ServerVars) GetInt64s(key string) ([]int64, error)

GetInt64s validates that a key has an underlying value in the map[string]interface{} vars and safely returns the result.

func (*ServerVars) GetJson added in v1.1.1692

func (vars *ServerVars) GetJson(key string) (string, error)

GetJson returns a json formatted string for the complex data keyed by key

func (*ServerVars) GetNestedBool added in v1.1.1687

func (vars *ServerVars) GetNestedBool(key string) (bool, error)

GetNestedBool accepts a dot delimited pathKey to traverse a nested data structure and retrieve the value in the field at the end of the pathKey. The path key can also traverse into a specific element of a slice with the sliceField[index] notation

func (*ServerVars) GetNestedFloat64 added in v1.1.1687

func (vars *ServerVars) GetNestedFloat64(key string) (float64, error)

GetNestedFloat64 accepts a dot delimited pathKey to traverse a nested data structure and retrieve the value in the field at the end of the pathKey. The path key can also traverse into a specific element of a slice with the sliceField[index] notation

func (*ServerVars) GetNestedInt64 added in v1.1.1687

func (vars *ServerVars) GetNestedInt64(key string) (int64, error)

GetNestedInt64 accepts a dot delimited pathKey to traverse a nested data structure and retrieve the value in the field at the end of the pathKey. The path key can also traverse into a specific element of a slice with the sliceField[index] notation

func (*ServerVars) GetNestedMap added in v1.1.1687

func (vars *ServerVars) GetNestedMap(pathKey string) (map[string]any, error)

GetNestedMap accepts a dot delimited pathKey to traverse a nested data structure and retrieve the value in the field at the end of the pathKey. The path key can also traverse into a specific element of a slice with the sliceField[index] notation

func (*ServerVars) GetNestedSlice added in v1.1.1687

func (vars *ServerVars) GetNestedSlice(pathKey string) ([]any, error)

GetNestedSlice accepts a dot delimited pathKey to traverse a nested data structure and retrieve the value in the field at the end of the pathKey. The path key can also traverse into a specific element of a slice with the sliceField[index] notation

func (*ServerVars) GetNestedString added in v1.1.1687

func (vars *ServerVars) GetNestedString(key string) (string, error)

GetNestedString accepts a dot delimited pathKey to traverse a nested data structure and retrieve the value in the field at the end of the pathKey. The path key can also traverse into a specific element of a slice with the sliceField[index] notation

func (*ServerVars) GetString

func (vars *ServerVars) GetString(key string) (string, error)

GetString validates that a key has an underlying value in the map[string]interface{} vars and safely returns the result.

func (*ServerVars) GetStrings added in v1.1.1563

func (vars *ServerVars) GetStrings(key string) ([]string, error)

GetStrings validates that a key has an underlying value in the map[string]interface{} vars and safely returns the result.

func (*ServerVars) Keys

func (vars *ServerVars) Keys() iter.Seq[string]

Keys returns a sequence of all keys present in the Vars map.

func (*ServerVars) Len

func (vars *ServerVars) Len() int

Len returns the number of key-value pairs in the Vals map of ServerVars.

func (*ServerVars) SetBool

func (vars *ServerVars) SetBool(key string, value bool)

SetBool sets a boolean value for the specified key in the Vars map.

func (*ServerVars) SetBools added in v1.1.1563

func (vars *ServerVars) SetBools(key string, value []bool)

SetBools sets a string value for the specified key in the Vars map.

func (*ServerVars) SetFloat64

func (vars *ServerVars) SetFloat64(key string, value float64)

SetFloat64 sets a float64 value for the specified key in the Vars map.

func (*ServerVars) SetFloat64s added in v1.1.1563

func (vars *ServerVars) SetFloat64s(key string, value []float64)

SetFloat64s sets a string value for the specified key in the Vars map.

func (*ServerVars) SetInt64

func (vars *ServerVars) SetInt64(key string, value int64)

SetInt64 sets an int64 value for the specified key in the Vars map.

func (*ServerVars) SetInt64s added in v1.1.1563

func (vars *ServerVars) SetInt64s(key string, value []int64)

SetInt64s sets a string value for the specified key in the Vars map.

func (*ServerVars) SetJson added in v1.1.1692

func (vars *ServerVars) SetJson(key, jsonObj string) error

SetJson parses the supplied json string into a map[string]any or []any

func (*ServerVars) SetString

func (vars *ServerVars) SetString(key string, value string)

SetString sets a string value for the specified key in the Vars map.

func (*ServerVars) SetStrings added in v1.1.1563

func (vars *ServerVars) SetStrings(key string, value []string)

SetStrings sets a string value for the specified key in the Vars map.

Jump to

Keyboard shortcuts

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