Documentation ¶
Index ¶
- Constants
- Variables
- func DefineFunctions(ctx *broker.Context, functions Stack, node *specs.Node, ...) error
- func GenerateStackReference() string
- func PrepareCallFunctions(ctx *broker.Context, node *specs.Node, flow specs.FlowInterface, ...) error
- func PrepareFlowFunctions(ctx *broker.Context, mem Collection, functions Custom, ...) (err error)
- func PrepareFunction(ctx *broker.Context, node *specs.Node, flow specs.FlowInterface, ...) error
- func PrepareFunctions(ctx *broker.Context, mem Collection, functions Custom, ...) (err error)
- func PrepareHeaderFunctions(ctx *broker.Context, flow specs.FlowInterface, stack Stack, ...) error
- func PrepareNodeFunctions(ctx *broker.Context, mem Collection, functions Custom, ...) (err error)
- func PrepareParameterMapFunctions(ctx *broker.Context, node *specs.Node, flow specs.FlowInterface, stack Stack, ...) error
- func PrepareParamsFunctions(ctx *broker.Context, node *specs.Node, flow specs.FlowInterface, stack Stack, ...) error
- func PreparePropertyFunctions(ctx *broker.Context, node *specs.Node, flow specs.FlowInterface, stack Stack, ...) error
- type Collection
- type Custom
- type ErrUndefinedFunction
- type Exec
- type Function
- type Intermediate
- type Stack
Constants ¶
const (
// ArgumentDelimiter represents the character delimiting function arguments
ArgumentDelimiter = ","
)
Variables ¶
var ( // FunctionPattern is the matching pattern for custom defined functions FunctionPattern = regexp.MustCompile(`(\w+)\((.*)\)$`) )
Functions ¶
func DefineFunctions ¶
func DefineFunctions(ctx *broker.Context, functions Stack, node *specs.Node, flow specs.FlowInterface) error
DefineFunctions defined all properties within the given functions
func GenerateStackReference ¶
func GenerateStackReference() string
GenerateStackReference generates a unique path prefix which could be used to isolate functions
func PrepareCallFunctions ¶
func PrepareCallFunctions(ctx *broker.Context, node *specs.Node, flow specs.FlowInterface, mem Collection, functions Custom, call *specs.Call) error
PrepareCallFunctions prepares the function definitions inside the given flow
func PrepareFlowFunctions ¶
func PrepareFlowFunctions(ctx *broker.Context, mem Collection, functions Custom, flow specs.FlowInterface) (err error)
PrepareFlowFunctions prepares the functions definitions inside the given flow
func PrepareFunction ¶
func PrepareFunction(ctx *broker.Context, node *specs.Node, flow specs.FlowInterface, property *specs.Property, stack Stack, methods Custom) error
PrepareFunction attempts to parses the given function
func PrepareFunctions ¶
func PrepareFunctions(ctx *broker.Context, mem Collection, functions Custom, flows specs.FlowListInterface) (err error)
PrepareFunctions prepares all function definitions inside the given flows
func PrepareHeaderFunctions ¶
func PrepareHeaderFunctions(ctx *broker.Context, flow specs.FlowInterface, stack Stack, header specs.Header, functions Custom) error
PrepareHeaderFunctions prepares the function definitions inside the given header
func PrepareNodeFunctions ¶
func PrepareNodeFunctions(ctx *broker.Context, mem Collection, functions Custom, flow specs.FlowInterface, node *specs.Node) (err error)
PrepareNodeFunctions prepares the available functions within the given node
func PrepareParameterMapFunctions ¶
func PrepareParameterMapFunctions(ctx *broker.Context, node *specs.Node, flow specs.FlowInterface, stack Stack, params *specs.ParameterMap, functions Custom) error
PrepareParameterMapFunctions prepares the function definitions inside the given parameter map
Types ¶
type Collection ¶
type Collection map[*specs.ParameterMap]Stack
Collection represents a collection of stacks grouped by nodes
func (Collection) Load ¶
func (collection Collection) Load(params *specs.ParameterMap) Stack
Load attempts to load the function stack for the given parameter map
func (Collection) Reserve ¶
func (collection Collection) Reserve(params *specs.ParameterMap) Stack
Reserve reserves a new function stack for the given node. If a stack already exists for the given node is it returned.
type Custom ¶
type Custom map[string]Intermediate
Custom represents a collection of custom defined functions that could be called inside a template
type ErrUndefinedFunction ¶
ErrUndefinedFunction occurs when custom function is not defined in property but referenced
func (ErrUndefinedFunction) Error ¶
func (e ErrUndefinedFunction) Error() string
Error returns a description of the given error as a string
func (ErrUndefinedFunction) Prettify ¶
func (e ErrUndefinedFunction) Prettify() prettyerr.Error
Prettify returns the prettified version of the given error
type Exec ¶
type Exec func(store references.Store) error
Exec is a executable function. A store should be returned which could be used to encode the function property
type Intermediate ¶
Intermediate prepares the custom defined function. The given arguments represent the exprected types that are passed when called. Properties returned should be absolute.