Documentation
¶
Index ¶
- func Get[V any](vars *ServerVars, key string) (V, error)
- type ServerVars
- func (vars *ServerVars) Decode(ctx context.Context, b []byte) error
- func (vars *ServerVars) Encode(ctx context.Context) ([]byte, error)
- func (vars *ServerVars) GetBool(key string) (bool, error)
- func (vars *ServerVars) GetBools(key string) ([]bool, error)
- func (vars *ServerVars) GetFloat64(key string) (float64, error)
- func (vars *ServerVars) GetFloat64s(key string) ([]float64, error)
- func (vars *ServerVars) GetInt64(key string) (int64, error)
- func (vars *ServerVars) GetInt64s(key string) ([]int64, error)
- func (vars *ServerVars) GetJson(key string) (string, error)
- func (vars *ServerVars) GetNestedBool(key string) (bool, error)
- func (vars *ServerVars) GetNestedFloat64(key string) (float64, error)
- func (vars *ServerVars) GetNestedInt64(key string) (int64, error)
- func (vars *ServerVars) GetNestedMap(pathKey string) (map[string]any, error)
- func (vars *ServerVars) GetNestedSlice(pathKey string) ([]any, error)
- func (vars *ServerVars) GetNestedString(key string) (string, error)
- func (vars *ServerVars) GetString(key string) (string, error)
- func (vars *ServerVars) GetStrings(key string) ([]string, error)
- func (vars *ServerVars) Keys() iter.Seq[string]
- func (vars *ServerVars) Len() int
- func (vars *ServerVars) SetBool(key string, value bool)
- func (vars *ServerVars) SetBools(key string, value []bool)
- func (vars *ServerVars) SetFloat64(key string, value float64)
- func (vars *ServerVars) SetFloat64s(key string, value []float64)
- func (vars *ServerVars) SetInt64(key string, value int64)
- func (vars *ServerVars) SetInt64s(key string, value []int64)
- func (vars *ServerVars) SetJson(key, jsonObj string) error
- func (vars *ServerVars) SetString(key string, value string)
- func (vars *ServerVars) SetStrings(key string, value []string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ServerVars ¶
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.