definition

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2021 License: BSD-3-Clause Imports: 17 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDataResolver

func GetDataResolver() resolve.CompositeResolver

func GetExprFactory

func GetExprFactory() expression.Factory

func GetMapperFactory

func GetMapperFactory() mapper.Factory

func NewDefaultActivityOutputMapper

func NewDefaultActivityOutputMapper(task *Task) mapper.Mapper

func SetExprFactory

func SetExprFactory(factory expression.Factory)

func SetMapperFactory

func SetMapperFactory(factory mapper.Factory)

Types

type ActivityConfig

type ActivityConfig struct {
	Activity activity.Activity
	Logger   log.Logger

	Details *activity.Details

	IsLegacy bool
	// contains filtered or unexported fields
}

func (*ActivityConfig) GetInputSchema

func (ac *ActivityConfig) GetInputSchema(name string) schema.Schema

func (*ActivityConfig) GetOutput

func (ac *ActivityConfig) GetOutput(name string) interface{}

Deprecated

func (*ActivityConfig) GetOutputSchema

func (ac *ActivityConfig) GetOutputSchema(name string) schema.Schema

func (*ActivityConfig) GetSetting

func (ac *ActivityConfig) GetSetting(setting string) (val interface{}, exists bool)

GetSetting gets the specified setting

func (*ActivityConfig) InputMapper

func (ac *ActivityConfig) InputMapper() mapper.Mapper

InputMapper returns the InputMapper of the task

func (*ActivityConfig) OutputMapper

func (ac *ActivityConfig) OutputMapper() mapper.Mapper

OutputMapper returns the OutputMapper of the task

func (*ActivityConfig) Ref

func (ac *ActivityConfig) Ref() string

type ActivityResolver

type ActivityResolver struct {
}

func (*ActivityResolver) GetResolverInfo

func (r *ActivityResolver) GetResolverInfo() *resolve.ResolverInfo

func (*ActivityResolver) Resolve

func (r *ActivityResolver) Resolve(scope data.Scope, itemName, valueName string) (interface{}, error)

type Definition

type Definition struct {
	// contains filtered or unexported fields
}

Definition is the object that describes the definition of a flow. It contains its data (attributes) and structure (tasks & links).

func NewDefinition

func NewDefinition(rep *DefinitionRep) (def *Definition, err error)

NewDefinition creates a flow Definition from a serializable definition representation

func (*Definition) Cleanup

func (d *Definition) Cleanup() error

func (*Definition) ExplicitReply

func (d *Definition) ExplicitReply() bool

func (*Definition) GetAttr

func (d *Definition) GetAttr(attrName string) (attr *data.Attribute, exists bool)

GetAttr gets the specified attribute

func (*Definition) GetErrorHandler

func (d *Definition) GetErrorHandler() *ErrorHandler
func (d *Definition) GetLink(linkID int) *Link

GetLink returns the link with the specified ID

func (*Definition) GetTask

func (d *Definition) GetTask(taskID string) *Task

GetTask returns the task with the specified ID

func (d *Definition) Links() []*Link

func (*Definition) Metadata

func (d *Definition) Metadata() *metadata.IOMetadata

Metadata returns IO metadata for the flow

func (*Definition) ModelID

func (d *Definition) ModelID() string

ModelID returns the ID of the model the definition uses

func (*Definition) Name

func (d *Definition) Name() string

Name returns the name of the definition

func (*Definition) Tasks

func (d *Definition) Tasks() []*Task

GetTask returns the task with the specified ID

type DefinitionRep

type DefinitionRep struct {
	ExplicitReply bool                 `json:"explicitReply,omitempty"`
	Name          string               `json:"name"`
	ModelID       string               `json:"model,omitempty"`
	Metadata      *metadata.IOMetadata `json:"metadata,omitempty"`
	Tasks         []*TaskRep           `json:"tasks"`
	Links         []*LinkRep           `json:"links,omitempty"`
	ErrorHandler  *ErrorHandlerRep     `json:"errorHandler,omitempty"`
}

DefinitionRep is a serializable representation of a flow Definition

type ErrorHandler

type ErrorHandler struct {
	// contains filtered or unexported fields
}

func (*ErrorHandler) GetTask added in v1.2.0

func (eh *ErrorHandler) GetTask(taskID string) *Task

func (*ErrorHandler) Tasks

func (eh *ErrorHandler) Tasks() []*Task

type ErrorHandlerRep

type ErrorHandlerRep struct {
	Tasks []*TaskRep `json:"tasks"`
	Links []*LinkRep `json:"links,omitempty"`
}

ErrorHandlerRep is a serializable representation of the error flow

type ErrorResolver

type ErrorResolver struct {
}

func (*ErrorResolver) GetResolverInfo

func (r *ErrorResolver) GetResolverInfo() *resolve.ResolverInfo

func (*ErrorResolver) Resolve

func (r *ErrorResolver) Resolve(scope data.Scope, itemName, valueName string) (interface{}, error)

type FlowResolver

type FlowResolver struct {
}

func (*FlowResolver) GetResolverInfo

func (r *FlowResolver) GetResolverInfo() *resolve.ResolverInfo

func (*FlowResolver) Resolve

func (r *FlowResolver) Resolve(scope data.Scope, itemName, valueName string) (interface{}, error)

type IteratorResolver

type IteratorResolver struct {
}

func (*IteratorResolver) GetResolverInfo

func (*IteratorResolver) GetResolverInfo() *resolve.ResolverInfo

func (*IteratorResolver) Resolve

func (*IteratorResolver) Resolve(scope data.Scope, item string, field string) (interface{}, error)

Resolve resolved iterator value using the following syntax: $iteration[key], or $iteration[value]

type Link struct {
	// contains filtered or unexported fields
}

LinkOld is the object that describes the definition of a link.

func GetExpressionLinks(def *Definition) []*Link

GetExpressionLinks gets the links of the definition that are of type LtExpression

func (*Link) Expr

func (link *Link) Expr() expression.Expr

Expr returns the expr associated with the link, nil if there is none

func (*Link) FromTask

func (link *Link) FromTask() *Task

FromTask returns the task the link is coming from

func (*Link) ID

func (link *Link) ID() int

ID gets the id of the link

func (*Link) Label added in v1.4.0

func (link *Link) Label() string

Label gets the Label of the link

func (*Link) String

func (link *Link) String() string

func (*Link) ToTask

func (link *Link) ToTask() *Task

ToTask returns the task the link is going to

func (*Link) Type

func (link *Link) Type() LinkType

Type gets the link type

func (*Link) Value

func (link *Link) Value() string

TypedValue gets the "value" of the link

type LinkExprError

type LinkExprError struct {
	// contains filtered or unexported fields
}

LinkExprError thrown if error is encountered evaluating an link expression

func NewLinkExprError

func NewLinkExprError(msg string) *LinkExprError

func (*LinkExprError) Error

func (e *LinkExprError) Error() string

type LinkRep

type LinkRep struct {
	Type   string `json:"type,omitempty"`
	Name   string `json:"name,omitempty"`
	ToID   string `json:"to"`
	FromID string `json:"from"`
	Label  string `json:"label"`
	Value  string `json:"value,omitempty"`
}

LinkRep is a serializable representation of a flow LinkOld

type LinkType

type LinkType int

LinkType is an enum for possible Link Types

const (
	// LtDependency denotes an normal dependency link
	LtDependency LinkType = 0

	// LtExpression denotes a link with an expression
	LtExpression LinkType = 1 //expr language on the model or def?

	// LtLabel denotes 'label' link
	LtLabel LinkType = 2

	// LtError denotes an error link
	LtError LinkType = 3

	// LtExprOtherwise denotes an expression otherwise link
	LtExprOtherwise = 4
)

type LoopConfig added in v1.0.0

type LoopConfig struct {
	// contains filtered or unexported fields
}

func (*LoopConfig) Accumulate added in v1.0.0

func (l *LoopConfig) Accumulate() bool

func (*LoopConfig) ApplyOutputOnAccumulate added in v1.0.0

func (l *LoopConfig) ApplyOutputOnAccumulate() bool

func (*LoopConfig) Condition added in v1.0.0

func (l *LoopConfig) Condition() expression.Expr

func (*LoopConfig) Delay added in v1.0.0

func (l *LoopConfig) Delay() int

func (*LoopConfig) GetIterateOn added in v1.0.0

func (l *LoopConfig) GetIterateOn() interface{}

type Provider

type Provider interface {

	// GetFlow retrieves the flow definition for the specified uri
	GetFlow(flowURI string) (*DefinitionRep, error)
}

ExtensionProvider is the interface that describes an object that can provide flow definitions from a URI

type RetryOnError added in v1.5.0

type RetryOnError interface {
	Count(scope data.Scope) (int, error)
	Interval(scope data.Scope) (int, error)
}

type Task

type Task struct {
	// contains filtered or unexported fields
}

Task is the object that describes the definition of a task. It contains its data (attributes) and its nested structure (child tasks & child links).

func (*Task) ActivityConfig

func (task *Task) ActivityConfig() *ActivityConfig
func (task *Task) FromLinks() []*Link

FromLinks returns the successor links of the task

func (*Task) ID

func (task *Task) ID() string

ID gets the id of the task

func (*Task) IsScope

func (task *Task) IsScope() bool

IsScope returns flag indicating if the Task is a scope task (a container of attributes)

func (*Task) LoopConfig added in v0.9.4

func (task *Task) LoopConfig() *LoopConfig

func (*Task) Name

func (task *Task) Name() string

Name gets the name of the task

func (*Task) RetryOnErrConfig added in v1.0.0

func (task *Task) RetryOnErrConfig() RetryOnError

func (*Task) SettingsMapper

func (task *Task) SettingsMapper() mapper.Mapper

SettingsMapper returns the SettingsMapper of the task

func (*Task) String

func (task *Task) String() string
func (task *Task) ToLinks() []*Link

ToLinks returns the predecessor links of the task

func (*Task) TypeID

func (task *Task) TypeID() string

TypeID gets the id of the task type

type TaskRep

type TaskRep struct {
	ID             string                 `json:"id"`
	Type           string                 `json:"type,omitempty"`
	Name           string                 `json:"name,omitempty"`
	Settings       map[string]interface{} `json:"settings,omitempty"`
	ActivityCfgRep *activity.Config       `json:"activity"`
}

TaskRep is a serializable representation of a flow task

Jump to

Keyboard shortcuts

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