Documentation
¶
Index ¶
- Variables
- func CanBeInt(v any) bool
- func CheckIfStatement(ifStatement *model.RuntimeExpression, state *State) (bool, error)
- func EvaluateString(str string, ctx any, state *State, evaluationWrapper ...ExpressionWrapperFunc) (any, error)
- func FilePrepender(filename string) string
- func GenerateChildWorkflowName(prefix string, prefixes ...string) string
- func LinkHandler(name string) string
- func LoadEnvvars(prefix string) map[string]any
- func Ptr[T any](p T) *T
- func SanitizeForMDX(path string) error
- 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 ToType[T any](m any, result T) error
- func TraverseAndEvaluateObj(runtimeExpr *model.ObjectOrRuntimeExpr, ctx any, state *State, ...) (any, error)
- type CancellableFuture
- type CancellableFutures
- type ExpressionWrapperFunc
- type State
- 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, ctx any, state *State, evaluationWrapper ...ExpressionWrapperFunc) (any, error)
The return value could be any value depending upon how it's parsed
func FilePrepender ¶ added in v0.6.1
func LinkHandler ¶ added in v0.6.1
func LoadEnvvars ¶
LoadEnvvars load all environment variables that start with the prefix. Removes prefix for storage
func SanitizeForMDX ¶ added in v0.6.1
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 ToType ¶ added in v0.4.0
ToType this works in a similar way to mapstructure.Decode, but with JSON. This is because many of the Serverless Workflow types have custom marshal/unmarshal JSON functions.
func TraverseAndEvaluateObj ¶
func TraverseAndEvaluateObj( runtimeExpr *model.ObjectOrRuntimeExpr, ctx any, state *State, evaluationWrapper ...ExpressionWrapperFunc, ) (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
Context any `json:"context"` // Output data exported to later tasks output
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 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.