Documentation
¶
Index ¶
- Constants
- type Action
- type ActionSelector
- type Activities
- type Activity
- type ActivityEndEvent
- type ExecutionError
- type Extract
- type ExtractionEvent
- type Extracts
- type Inline
- type MapEntry
- type NeatlyTag
- type OperatingSystem
- type OsTarget
- type Path
- type Pipeline
- type Pipelines
- type Process
- type Processes
- type Repeater
- type ServiceRequest
- type Session
- type Sessions
- type Task
- type TasksSelector
- type Variable
- type VariableExpression
- type Variables
- type Workflow
- type WorkflowSelector
Constants ¶
const SliceKey = "data"
SliceKey represents slice key
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Action ¶
type Action struct {
*ServiceRequest
*NeatlyTag
*Repeater
Name string `description:"action name"`
Init Variables `description:"action state init instruction "`
Post Variables `description:"action post processing instruction"`
Async bool `description:"flag to run action async"`
When string `description:"run action criteria"`
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 {
*NeatlyTag
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
}
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 ¶
Error represent workflow error
type Extract ¶
type Extract struct {
RegExpr string `description:"regular expression with oval bracket to extract match pattern" example:"go(\d\.\d)"` //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
}
Extract represents a data extraction
func NewExtract ¶
NewExtract creates a new data extraction
type ExtractionEvent ¶
type ExtractionEvent struct {
Output string
StructuredOutput interface{}
Data interface{}
}
ExtractionEvent represents data extraction event
func NewExtractEvent ¶
func NewExtractEvent(output string, structuredOutput, extracted interface{}) *ExtractionEvent
NewExtractEvent creates a new event.
type Extracts ¶
type Extracts []*Extract
Extracts represents an extracted data collection
type Inline ¶
type Inline struct {
Pipeline []*MapEntry `required:"true" description:"key value representing Pipelines in simplified form"`
Pipelines Pipelines `description:"actual Pipelines (derived from Pipeline)"`
Defaults map[string]interface{} `description:"default value for pipline parameters"`
Init interface{} `description:"init state expression"`
Post interface{} `description:"post processing update state expression"`
}
Inline represent sequence of workflow/action to run, map entry represent bridge between YAML, JSON and actual domain model Pipelines abstraction.
type MapEntry ¶
type MapEntry struct {
Key string `description:"preserved order map entry key"`
Value interface{} `description:"preserved order map entry value"`
}
MapEntry represents pipeline parameters or attributes if key has '@' prefix.
type NeatlyTag ¶
type NeatlyTag struct {
Tag string //neatly tag
TagIndex string //neatly tag index
TagID string //neatly tag id
TagDescription string //tag description
}
NeatlyTag represent a neatly tag
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 Pipeline ¶
type Pipeline struct {
Name string `description:"pipeline task name"`
Workflow string `description:"workflow (URL[:tasks]) selector "`
Action string `description:"action (service.action) selector "`
Params map[string]interface{} `description:"workflow or action parameters"`
Description string `description:"description"`
Request interface{} `description:"external action request location, otherwise params are used to form request"`
Pipelines Pipelines `description:"workflow or action subsequent pipelines"`
When string `description:"run criteria"`
Init interface{} `description:"state initalization "`
Post interface{} `description:"post execution state update "`
}
Pipeline represents sequential workflow/action execution.
type Pipelines ¶
type Pipelines []*Pipeline
Pipelines represents pipelines
func (*Pipelines) RunnableCount ¶
RunnableCount returns number of pipeline that run either action or workflow
func (*Pipelines) Select ¶
func (p *Pipelines) Select(selector TasksSelector) Pipelines
Select selects pipelines matching supplied selector
type Process ¶
type Process struct {
Source *url.Resource
Owner string
Workflow *Workflow
Pipeline *Pipeline
*Activities
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 {
Extraction 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 extracted 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"`
Description string
}
ServiceRequest represent an action request
func (*ServiceRequest) Init ¶
func (r *ServiceRequest) Init() *ServiceRequest
Init initialises 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 {
When string //criteria to run this task
Seq int //sequence of the task
Name string //Id of the task
Description string //description
Actions []*Action //actions
Init Variables //variables to initialise state before this taks runs
Post Variables //variable to update state after this task completes
TimeSpentMs int //optional min required time spent in this task, remaining will force Sleep
}
Task represents a group of action
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 Variable ¶
type Variable struct {
Name string //name
Value interface{} //default value
From string //context state map key to pull data
When string //criteria if specified this variable will be set only if evaluated criteria is true (it can use $in, and $out state variables)
Else interface{} //if when criteria is not met then else can provide variable value alternative
Persist bool //stores in tmp directory to be used as backup if data is not in the cotnext
Required bool //flag that validates that from returns non empty value or error is generated
Replace map[string]string `` //replacements map, if key if specified substitute variable value with corresponding value.
/* 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) *Variable
NewVariable creates a new variable
func (*Variable) PersistValue ¶
PersistValue persist variable
type VariableExpression ¶
type VariableExpression string
VariableExpression represent a variable expression [!] [when ?] VariableName = value : else, exclemation 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
Name string //worfklow Id
Description string //description
Init Variables //variables to initialise state before this workflow runs
Post Variables //variables to initialise state before this workflow runs
Tasks []*Task //workflow task
OnErrorTask string //task that will run if error occur, the final workflow will return this task response
DeferTask string //task that will alway run if there has been previous error or not
SleepTimeMs int //optional Sleep time
}
Workflow repesents a workflow
func (*Workflow) Select ¶
func (w *Workflow) Select(selector TasksSelector) ([]*Task, error)
Select returns tasked matching supplied selector.
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