Documentation ¶
Index ¶
- Constants
- type AbstractNode
- type Action
- type ActionSelector
- type Activities
- func (a *Activities) First() *Activity
- func (a *Activities) Get(index int) *Activity
- func (a *Activities) Last() *Activity
- func (a *Activities) Len() int
- func (a *Activities) Pop() *Activity
- func (a *Activities) Push(activity *Activity)
- func (a *Activities) Range(handler func(activity *Activity) bool, reverse bool)
- type Activity
- type ActivityEndEvent
- type ExecutionError
- type Extract
- type ExtractEvent
- type Extracts
- type Inlined
- type MapEntry
- type MetaTag
- type ModifiedStateEvent
- type OperatingSystem
- type OsTarget
- type Path
- type Process
- type Processes
- type Repeater
- func (r *Repeater) Eval(context *endly.Context, callerInfo string, out interface{}, ...) (bool, error)
- func (r *Repeater) EvaluateExitCriteria(callerInfo string, context *endly.Context, extracted map[string]interface{}) (bool, error)
- func (r *Repeater) Init() *Repeater
- func (r *Repeater) Run(context *endly.Context, callerInfo string, service *endly.AbstractService, ...) error
- type ServiceRequest
- type Session
- type Sessions
- type Tag
- type TagIterator
- type Task
- type Tasks
- type TasksNode
- type TasksSelector
- type Template
- type TransientTemplate
- type Variable
- type VariableExpression
- type Variables
- type Workflow
- type WorkflowSelector
Constants ¶
const ( //CatchTask represent a task name that execute if error occurred and defined CatchTask = "catch" //DeferredTask represent a task name that always execute if defined DeferredTask = "defer" //ExplicitActionAttributePrefix represent model attribute prefix ExplicitActionAttributePrefix = ":" ExplicitRequestAttributePrefix = "@" )
const (
OwnerURL = "ownerURL"
)
const SliceKey = "data"
SliceKey represents slice key
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AbstractNode ¶
type AbstractNode struct { Name string Description string `yaml:",omitempty"` Init Variables `description:"state init instruction " yaml:",omitempty"` Post Variables `description:"post execution state update instruction" yaml:",omitempty"` When string `description:"run criteria" yaml:",omitempty"` SleepTimeMs int `yaml:",omitempty"` Logging *bool `description:"optional flag to disable logging, enabled by default" yaml:",omitempty"` // contains filtered or unexported fields }
AbstractNode represents an abstract workflow node(of a workflow, task or acton type)
func (*AbstractNode) Clone ¶ added in v0.70.1
func (n *AbstractNode) Clone() *AbstractNode
func (*AbstractNode) WhenEval ¶ added in v0.70.1
func (n *AbstractNode) WhenEval() *eval.Compute
type Action ¶
type Action struct { *AbstractNode `yaml:",inline"` *ServiceRequest `yaml:",inline"` *MetaTag `yaml:",inline"` *Repeater `yaml:",inline"` Async bool `description:"flag to run action async" yaml:",omitempty"` Skip string `description:"criteria to skip current TagID" yaml:",omitempty"` // contains filtered or unexported fields }
Action represents a workflow service action
type ActionSelector ¶
type ActionSelector string
ActionSelector represents an expression to invoke endly action: service.Action (for workflow service workflow keyword can be skipped)
type Activities ¶
type Activities struct { Activity *Activity // contains filtered or unexported fields }
Activities represents activities
func (*Activities) First ¶
func (a *Activities) First() *Activity
func (*Activities) Get ¶
func (a *Activities) Get(index int) *Activity
Get returns activity for index
func (*Activities) Last ¶
func (a *Activities) Last() *Activity
func (*Activities) Len ¶
func (a *Activities) Len() int
type Activity ¶
type Activity struct { *MetaTag Caller string Task string Service string Action string Description string Error string StartTime time.Time Ineligible bool Request interface{} Response map[string]interface{} ServiceResponse *endly.ServiceResponse Logging *bool }
Activity represents pipeline or workflow activity
func NewActivity ¶
NewActivity returns a new workflow Activity.
type ActivityEndEvent ¶
type ActivityEndEvent struct {
Response interface{}
}
ActivityEndEvent represents Activity end event type.
func NewActivityEndEvent ¶
func NewActivityEndEvent(response interface{}) *ActivityEndEvent
NewActivityEndEvent creates a new ActivityEndEvent
type ExecutionError ¶
type ExecutionError struct { Error string Caller string TaskName string Request interface{} Response interface{} }
Error represent workflow error
func (*ExecutionError) AsMap ¶
func (e *ExecutionError) AsMap() map[string]interface{}
AsMap returns error map
type Extract ¶
type Extract struct { RegExpr string `description:"regular expression with oval bracket to extract match pattern"` //regular expression Key string `description:"state key to store a match"` //state key to store a match Reset bool `description:"reset the key in the context before evaluating this data extraction rule"` //reset the key in the context before evaluating this data extraction rule Required bool `description:"require that at least one pattern match is returned"` //require that at least one pattern match is returned }
Extract represents a data extraction
type ExtractEvent ¶ added in v0.25.1
type ExtractEvent struct { Output string StructuredOutput interface{} Data interface{} }
ExtractEvent represents data extraction event
func NewExtractEvent ¶
func NewExtractEvent(output string, structuredOutput, extracted interface{}) *ExtractEvent
NewExtractEvent creates a new event.
type Extracts ¶
type Extracts []*Extract
Extracts represents an expected data collection
type Inlined ¶ added in v0.70.1
type Inlined struct { Init interface{} Post interface{} Logging *bool Defaults map[string]interface{} Data map[string]interface{} Pipeline []*MapEntry State data.Map // contains filtered or unexported fields }
Inlined represents inline workflow
type MapEntry ¶
type MapEntry struct { Key string `description:"preserved order map entry key"` Value interface{} `description:"preserved order map entry value"` }
type MetaTag ¶ added in v0.25.1
type MetaTag struct { Tag string `yaml:",omitempty"` //tag TagIndex string `yaml:",omitempty"` //tag index TagID string `yaml:",omitempty"` //tag id TagDescription string `yaml:",omitempty"` //tag description Comments string `yaml:",omitempty"` }
MetaTag represent a node tag
type ModifiedStateEvent ¶
type ModifiedStateEvent struct { Variables Variables In map[string]interface{} Modified map[string]interface{} }
ModifiedStateEvent represent modified state event
func NewModifiedStateEvent ¶
func NewModifiedStateEvent(variables Variables, in, out data.Map) *ModifiedStateEvent
NewModifiedStateEvent creates a new modified state event.
type OperatingSystem ¶
type OperatingSystem struct { *gosh.OSInfo *gosh.HardwareInfo }
Os represents an Os
func (*OperatingSystem) Matches ¶
func (s *OperatingSystem) Matches(target *OsTarget) bool
Matches returns true if operating system matches provided target
type OsTarget ¶
type OsTarget struct { System string Architecture string Name string MinRequiredVersion string MaxAllowedVersion string }
OsTarget represents operating system target
type Path ¶
type Path struct { Items []string // contains filtered or unexported fields }
Path represents a system path
type Process ¶
type Process struct { Source *location.Resource Owner string TagIDs map[string]bool HasTagID bool Workflow *Workflow Task *Task TaskNode *TasksNode *Activities State data.Map Terminated int32 Scheduled *Task *ExecutionError }
Process represents a running instance of workflow/pipeline process.
func NewProcess ¶
NewProcess creates a new workflow, pipeline process
func (*Process) IsTerminated ¶
IsTerminated returns true if current workflow has been terminated
type Processes ¶
type Processes struct {
// contains filtered or unexported fields
}
processes represents running workflow/pipe process stack.
func (*Processes) FirstWorkflow ¶
FirstWorkflow returns the first workflow.
func (*Processes) LastWorkflow ¶
LastWorkflow returns the last workflow.
type Repeater ¶
type Repeater struct { Extract Extracts `yaml:",omitempty"` //textual regexp based data extraction Variables Variables `yaml:",omitempty"` //structure data based data extraction Repeat int `yaml:",omitempty"` //how many time send this request ThinkTimeMs int `yaml:",omitempty"` //Sleep time after request send, this only makes sense with repeat option Exit string `yaml:",omitempty"` //Exit criteria, it uses expected variable to determine repeat termination // contains filtered or unexported fields }
Repeater represent repeated execution
func (*Repeater) EvaluateExitCriteria ¶
func (r *Repeater) EvaluateExitCriteria(callerInfo string, context *endly.Context, extracted map[string]interface{}) (bool, error)
EvaluateExitCriteria check is exit criteria is met.
type ServiceRequest ¶
type ServiceRequest struct { Service string `description:"service SessionID"` Action string `description:"service's'action "` Request interface{} `description:"service request" ` }
ServiceRequest represent an action request
func (*ServiceRequest) Init ¶
func (r *ServiceRequest) Init() *ServiceRequest
Init initialises action
func (*ServiceRequest) NewAction ¶
func (r *ServiceRequest) NewAction() *Action
func (*ServiceRequest) Validate ¶
func (r *ServiceRequest) Validate() error
Validate check is action request is valid
type Session ¶
type Session struct { ID string *gosh.Service DaemonType int Username string SuperUSerAuth bool //Path *Path EnvVariables map[string]string CurrentDirectory string Deployed map[string]string Cacheable map[string]interface{} Mutex *sync.RWMutex }
Session represents a system terminal session
type Tag ¶ added in v0.70.1
type Tag struct { OwnerSource *location.Resource OwnerName string Name string Group string IsArray bool Iterator *TagIterator LineNumber int Subpath string PathMatch string // contains filtered or unexported fields }
Tag represents a tag
func (*Tag) HasActiveIterator ¶ added in v0.70.1
HasActiveIterator returns true if tag has active iterator
type TagIterator ¶ added in v0.70.1
type TagIterator struct { Template string Min int Max int // contains filtered or unexported fields }
TagIterator represents tag iterator to produce Instance
func (*TagIterator) Has ¶ added in v0.70.1
func (i *TagIterator) Has() bool
Has return true if iterator has not been exhausted
func (*TagIterator) Index ¶ added in v0.70.1
func (i *TagIterator) Index() string
Index returns an index of the iterator
func (*TagIterator) Next ¶ added in v0.70.1
func (i *TagIterator) Next() bool
Next eturns increment counter and checks if it is has next.
type Task ¶
type Task struct { *AbstractNode `yaml:",inline"` //abstract node Actions []*Action ` yaml:",omitempty"` //actions *TasksNode ` yaml:",inline"` Fail bool ` yaml:",omitempty"` //controls if return fail status workflow on catch task Template *Template ` yaml:",omitempty"` // contains filtered or unexported fields }
Task represents a group of action
func (*Task) AsyncActions ¶ added in v0.21.2
AsyncActions returns async actions
type TasksNode ¶
type TasksNode struct { Tasks Tasks ` yaml:",omitempty"` //sub tasks OnErrorTask string ` yaml:",omitempty"` //task that will run if error occur, the final workflow will return this task response DeferredTask string ` yaml:",omitempty"` //task that will always run if there has been previous error or not }
TasksNode represents a task node
func (*TasksNode) Select ¶
func (t *TasksNode) Select(selector TasksSelector) *TasksNode
Select selects tasks matching supplied selector
type TasksSelector ¶
type TasksSelector string
TasksSelector represents a task selector
func (*TasksSelector) RunAll ¶
func (t *TasksSelector) RunAll() bool
RunAll returns true if no individual tasks are selected
type Template ¶
type Template struct { SubPath string `description:"sub path for dynamic resource template expansion: i.e. use_cases/${index}*"` Tag string `description:"grouping tag i.e Test"` Range string `description:"range expression i.e 2..003 where upper bound number drives padding $index variable"` Description string `description:"reference to file containing tagDescription i.e. @use_case, file reference has to start with @"` Data map[string]string `` /* 181-byte string literal not displayed */ Tasks []*Task `description:"tasks to expand"` }
type TransientTemplate ¶ added in v0.70.1
type TransientTemplate struct { SubPath string `description:"sub path for dynamic resource template expansion: i.e. use_cases/${index}*"` Tag string `description:"grouping tag i.e Test"` Range string `description:"range expression i.e 2..003 where upper bound number drives padding $index variable"` Description string `description:"reference to file containing tagDescription i.e. @use_case, file reference has to start with @"` Data map[string]string `` /* 181-byte string literal not displayed */ Template []interface{} `description:"template to expand"` // contains filtered or unexported fields }
TransientTemplate represents inline workflow template to dynamically Expand actions - idea borrowed from neatly format: https://github.com/viant/neatly/
type Variable ¶
type Variable struct { Name string `description:"name"` Value interface{} `description:"default value"` From string `description:"context state map key to pull data"` When string `` /* 139-byte string literal not displayed */ Else interface{} `description:"if when criteria is not met then else can provide variable value alternative"` Required bool `description:"flag that validates that from returns non empty value or error is generated"` EmptyIfUnexpanded bool `description:"threat variable value empty if it was not expanded"` Replace map[string]string `` /* 147-byte string literal not displayed */ // contains filtered or unexported fields }
Variable represents a variable
func NewVariable ¶
func NewVariable(name, form, when string, required bool, value, elseValue interface{}, replace map[string]string, emptyIfUnexpanded bool) *Variable
NewVariable creates a new variable
func (*Variable) MarshalYAML ¶ added in v0.70.1
type VariableExpression ¶
type VariableExpression string
VariableExpression represent a variable expression [!] VariableName = [when ?] value : otherwiseValue, exclamation mark flags variable as required
func (*VariableExpression) AsVariable ¶
func (e *VariableExpression) AsVariable() (*Variable, error)
AsVariable converts expression to variable
type Variables ¶
type Variables []*Variable
Variables a slice of variables
func GetVariables ¶
GetVariables returns variables from Variables ([]*Variable), []string (as expression) or from []interface{} (where interface is a map matching Variable struct)
func (Variables) MarshalYAML ¶ added in v0.70.1
type Workflow ¶
type Workflow struct { Source *location.Resource ` yaml:",omitempty"` //source definition of the workflow Data data.Map `yaml:"-"` //workflow data *AbstractNode `yaml:",inline"` //workflow node` *TasksNode `yaml:"pipeline"` ///workflow tasks }
Workflow represents a workflow
func (*Workflow) MarshalYAML ¶ added in v0.70.1
type WorkflowSelector ¶
type WorkflowSelector string
WorkflowSelector represents an expression to invoke workflow with all or specified task: URL[:tasks]
func (WorkflowSelector) IsRelative ¶
func (s WorkflowSelector) IsRelative() bool
IsRelative returns true if selector is relative path
func (WorkflowSelector) Name ¶
func (s WorkflowSelector) Name() string
Name returns selector workflow name
func (WorkflowSelector) Tasks ¶
func (s WorkflowSelector) Tasks() string
TasksSelector returns selector tasks
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package project package project defines project model
|
Package project package project defines project model |