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 InlineWorkflow
- type MapEntry
- type MetaTag
- type ModifiedStateEvent
- type OperatingSystem
- type OsTarget
- type Path
- type Process
- type Processes
- type Repeater
- type ServiceRequest
- type Session
- type Sessions
- type Task
- type TasksNode
- type TasksSelector
- type Template
- 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 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 Init Variables `description:"state init instruction "` Post Variables `description:"post execution state update instruction"` When string `description:"run criteria"` SleepTimeMs int //optional Sleep time Logging *bool `description:"optional flag to disable logging, enabled by default"` }
AbstractNode represents an abstract workflow node(of a workflow, task or acton type)
type Action ¶
type Action struct { *AbstractNode *ServiceRequest *MetaTag *Repeater Async bool `description:"flag to run action async"` Skip string `description:"criteria to skip current TagID"` }
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 InlineWorkflow ¶
type InlineWorkflow 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 }
func (*InlineWorkflow) AsWorkflow ¶
func (p *InlineWorkflow) AsWorkflow(name string, baseURL string) (*Workflow, error)
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 //tag TagIndex string //tag index TagID string //tag id TagDescription string //tag description Comments string }
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 { System string Name string Hardware string Architecture string Arch string //architecture abbreviation Version string }
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 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 *url.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 //textual regexp based data extraction Variables Variables //structure data based data extraction Repeat int //how many time send this request SleepTimeMs int //Sleep time after request send, this only makes sense with repeat option Exit string //Exit criteria, it uses expected variable to determine repeat termination }
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 ID"` 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 ssh.MultiCommandSession DaemonType int Service ssh.Service Os *OperatingSystem 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 Task ¶
type Task struct { *AbstractNode Actions []*Action //actions *TasksNode Fail bool //controls if return fail status workflow on catch task // 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 []*Task //sub tasks OnErrorTask string //task that will run if error occur, the final workflow will return this task response DeferredTask string //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 */ Template []interface{} // contains filtered or unexported fields }
Template 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"` Persist bool `description:"stores in tmp directory to be used as backup if data is not in the cotnext"` 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 */ }
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) PersistValue ¶
PersistValue persist variable
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)
type Workflow ¶
type Workflow struct { Source *url.Resource //source definition of the workflow Data data.Map //workflow data *AbstractNode *TasksNode //workflow tasks }
Workflow represents a workflow
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