Documentation
¶
Index ¶
- Variables
- func CanBeInt(v any) bool
- func CheckIfStatement(ifStatement *model.RuntimeExpression, state *State) (bool, error)
- func EvaluateString(str string, state *State, evaluationWrapper ...ExpressionWrapperFunc) (any, error)
- func GenerateChildWorkflowName(prefix string, prefixes ...string) string
- func LoadEnvvars(prefix string) map[string]any
- func Ptr[T any](p T) *T
- func SliceEvery[T any](items []T, predicate func(T) bool) bool
- func SlicesEqual[T comparable](s []T, v T) bool
- func ToDuration(v *model.Duration) (duration time.Duration)
- func TraverseAndEvaluateObj(runtimeExpr *model.ObjectOrRuntimeExpr, state *State, ...) (map[string]any, error)
- type CancellableFuture
- type CancellableFutures
- type ExpressionWrapperFunc
- type State
- func (s *State) AddActivityInfo(ctx context.Context) *State
- func (s *State) AddData(data map[string]any) *State
- func (s *State) AddOutput(task model.Task, output any) *State
- func (s *State) AddWorkflowInfo(ctx workflow.Context) *State
- func (s *State) ClearOutput() *State
- func (s *State) Clone() *State
- func (s *State) GetAsMap() map[string]any
- type ValidationErrors
- type Validator
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrUnknownValidationError = fmt.Errorf("unknown validation error")
Functions ¶
func CheckIfStatement ¶
func CheckIfStatement(ifStatement *model.RuntimeExpression, state *State) (bool, error)
func EvaluateString ¶
func EvaluateString(str string, state *State, evaluationWrapper ...ExpressionWrapperFunc) (any, error)
The return value could be any value depending upon how it's parsed
func LoadEnvvars ¶
LoadEnvvars load all environment variables that start with the prefix. Removes prefix for storage
func SliceEvery ¶
Functionally equivalent to JS's Array.prorotype.every function @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every
func SlicesEqual ¶
func SlicesEqual[T comparable](s []T, v T) bool
Ensures that all slices are equal to the given value
func ToDuration ¶
Convert the Serverless Workflow duration into a time Duration
func TraverseAndEvaluateObj ¶
func TraverseAndEvaluateObj( runtimeExpr *model.ObjectOrRuntimeExpr, state *State, evaluationWrapper ...ExpressionWrapperFunc, ) (map[string]any, error)
Types ¶
type CancellableFuture ¶
type CancellableFuture struct {
Cancel workflow.CancelFunc
Context workflow.Context
Future workflow.ChildWorkflowFuture
}
type CancellableFutures ¶
type CancellableFutures struct {
// contains filtered or unexported fields
}
func (*CancellableFutures) Add ¶
func (c *CancellableFutures) Add(key string, future CancellableFuture)
func (*CancellableFutures) CancelOthers ¶
func (c *CancellableFutures) CancelOthers(passedContext workflow.Context)
func (*CancellableFutures) Length ¶
func (c *CancellableFutures) Length() int
func (*CancellableFutures) List ¶
func (c *CancellableFutures) List() map[string]CancellableFuture
type State ¶
type State struct {
CANStartFrom *string `json:"canStartFrom,omitempty"` // Continue-as-new from here
Data map[string]any `json:"data"` // Data stored along the way
Env map[string]any `json:"env"` // Available environment variables
Input any `json:"input,omitempty"` // The input given by the caller
Output map[string]any `json:"output"` // What will be output to the caller
}
func (*State) ClearOutput ¶
type ValidationErrors ¶
type Validator ¶
type Validator struct {
// contains filtered or unexported fields
}
func NewValidator ¶
func (*Validator) ValidateStruct ¶
func (v *Validator) ValidateStruct(data any) ([]ValidationErrors, error)
Click to show internal directories.
Click to hide internal directories.