Documentation ¶
Index ¶
- Constants
- func ConvertColonyArrayToJSON(colonies []*Colony) (string, error)
- func ConvertCronArrayToJSON(crons []*Cron) (string, error)
- func ConvertExecutorArrayToJSON(executors []*Executor) (string, error)
- func ConvertFunctionArrayToJSON(functions []*Function) (string, error)
- func ConvertGeneratorArrayToJSON(generators []*Generator) (string, error)
- func ConvertProcessArrayToJSON(processes []*Process) (string, error)
- func ConvertProcessGraphArrayToJSON(processGraphs []*ProcessGraph) (string, error)
- func GenerateRandomID() string
- func IsAttributeArraysEqual(attributes1 []Attribute, attributes2 []Attribute) bool
- func IsColonyArraysEqual(colonies1 []*Colony, colonies2 []*Colony) bool
- func IsCronArraysEqual(crons1 []*Cron, crons2 []*Cron) bool
- func IsExecutorArraysEqual(executors1 []*Executor, executors2 []*Executor) bool
- func IsFunctionArraysEqual(functions1 []*Function, functions2 []*Function) bool
- func IsGeneratorArraysEqual(generators1 []*Generator, generators2 []*Generator) bool
- func IsProcessArraysEqual(processes1 []*Process, processes2 []*Process) bool
- func IsProcessGraphArraysEqual(processGraphs1 []*ProcessGraph, processGraphs2 []*ProcessGraph) bool
- type Attribute
- type Colony
- type Conditions
- type Cron
- type Data
- type Edge
- type Executor
- func ConvertJSONToExecutor(jsonString string) (*Executor, error)
- func ConvertJSONToExecutorArray(jsonString string) ([]*Executor, error)
- func CreateExecutor(id string, executorType string, name string, colonyID string, ...) *Executor
- func CreateExecutorFromDB(id string, executorType string, name string, colonyID string, state int, ...) *Executor
- func (executor *Executor) Approve()
- func (executor *Executor) Equals(executor2 *Executor) bool
- func (executor *Executor) IsApproved() bool
- func (executor *Executor) IsPending() bool
- func (executor *Executor) IsRejected() bool
- func (executor *Executor) Reject()
- func (executor *Executor) SetColonyID(colonyID string)
- func (executor *Executor) SetID(id string)
- func (executor *Executor) ToJSON() (string, error)
- type Failure
- type Function
- type FunctionSpec
- type Generator
- type GeneratorArg
- type Location
- type Node
- type Position
- type Process
- func ConvertJSONToProcess(jsonString string) (*Process, error)
- func ConvertJSONToProcessArray(jsonString string) ([]*Process, error)
- func CreateProcess(funcSpec *FunctionSpec) *Process
- func CreateProcessFromDB(funcSpec *FunctionSpec, id string, assignedExecutorID string, isAssigned bool, ...) *Process
- func (process *Process) AddChild(childID string)
- func (process *Process) AddParent(parentID string)
- func (process *Process) Assign()
- func (process *Process) Clone() *Process
- func (process *Process) Equals(process2 *Process) bool
- func (process *Process) ProcessingTime() time.Duration
- func (process *Process) SetAssignedExecutorID(executorID string)
- func (process *Process) SetAttributes(attributes []Attribute)
- func (process *Process) SetEndTime(endTime time.Time)
- func (process *Process) SetProcessGraphID(processGraphID string)
- func (process *Process) SetStartTime(startTime time.Time)
- func (process *Process) SetState(state int)
- func (process *Process) SetSubmissionTime(submissionTime time.Time)
- func (process *Process) ToJSON() (string, error)
- func (process *Process) Unassign()
- func (process *Process) WaitingTime() time.Duration
- type ProcessGraph
- func ConvertJSONToProcessGraph(jsonString string) (*ProcessGraph, error)
- func ConvertJSONToProcessGraphArray(jsonString string) ([]*ProcessGraph, error)
- func ConvertJSONToProcessGraphWithStorage(jsonString string) (*ProcessGraph, error)
- func CreateProcessGraph(colonyID string) (*ProcessGraph, error)
- func (graph *ProcessGraph) AddRoot(processID string)
- func (graph *ProcessGraph) Depth(childProcessID string) (int, error)
- func (graph *ProcessGraph) Equals(graph2 *ProcessGraph) bool
- func (graph *ProcessGraph) FailedProcesses() (int, error)
- func (graph *ProcessGraph) GetRoot(childProcessID string) (*Process, error)
- func (graph *ProcessGraph) Iterate(visitFunc func(process *Process) error) error
- func (graph *ProcessGraph) Leaves() ([]string, error)
- func (graph *ProcessGraph) Processes() (int, error)
- func (graph *ProcessGraph) Resolve() error
- func (graph *ProcessGraph) RunningProcesses() (int, error)
- func (graph *ProcessGraph) SetStorage(storage ProcessGraphStorage)
- func (graph *ProcessGraph) SuccessfulProcesses() (int, error)
- func (graph *ProcessGraph) ToJSON() (string, error)
- func (graph *ProcessGraph) UpdateProcessIDs() error
- func (graph *ProcessGraph) WaitForParents() (int, error)
- func (graph *ProcessGraph) WaitProcesses() (int, error)
- type ProcessGraphStorage
- type Statistics
- type Style
- type WorkflowSpec
Constants ¶
View Source
const ( IN int = 0 OUT = 1 ERR = 2 ENV = 3 )
View Source
const ( PENDING int = 0 APPROVED = 1 REJECTED = 2 )
View Source
const ( WAITING int = 0 RUNNING = 1 SUCCESS = 2 FAILED = 3 )
Variables ¶
This section is empty.
Functions ¶
func ConvertCronArrayToJSON ¶
func ConvertExecutorArrayToJSON ¶ added in v1.0.1
func ConvertFunctionArrayToJSON ¶ added in v1.0.1
func ConvertProcessGraphArrayToJSON ¶
func ConvertProcessGraphArrayToJSON(processGraphs []*ProcessGraph) (string, error)
func GenerateRandomID ¶
func GenerateRandomID() string
func IsAttributeArraysEqual ¶
func IsColonyArraysEqual ¶
func IsCronArraysEqual ¶
func IsExecutorArraysEqual ¶ added in v1.0.1
func IsFunctionArraysEqual ¶ added in v1.0.1
func IsGeneratorArraysEqual ¶
func IsProcessArraysEqual ¶
func IsProcessGraphArraysEqual ¶
func IsProcessGraphArraysEqual(processGraphs1 []*ProcessGraph, processGraphs2 []*ProcessGraph) bool
Types ¶
type Attribute ¶
type Attribute struct { ID string `json:"attributeid"` TargetID string `json:"targetid"` TargetColonyID string `json:"targetcolonyid"` TargetProcessGraphID string `json:"targetprocessgraphid"` AttributeType int `json:"attributetype"` Key string `json:"key"` Value string `json:"value"` }
func ConvertJSONToAttribute ¶
func CreateAttribute ¶
func (*Attribute) GenerateID ¶
func (attribute *Attribute) GenerateID()
type Conditions ¶
type Cron ¶
type Cron struct { ID string `json:"cronid"` ColonyID string `json:"colonyid"` Name string `json:"name"` CronExpression string `json:"cronexpression"` Interval int `json:"interval"` Random bool `json:"random"` NextRun time.Time `json:"nextrun"` LastRun time.Time `json:"lastrun"` WorkflowSpec string `json:"workflowspec"` PrevProcessGraphID string `json:"prevprocessgraphid"` WaitForPrevProcessGraph bool `json:"waitforprevprocessgraph"` CheckerPeriod int `json:"checkerperiod"` }
func ConvertJSONToCron ¶
func ConvertJSONToCronArray ¶
func CreateCron ¶
func (*Cron) HasExpired ¶
type Executor ¶ added in v1.0.1
type Executor struct { ID string `json:"executorid"` Type string `json:"executortype"` Name string `json:"executorname"` ColonyID string `json:"colonyid"` State int `json:"state"` RequireFuncReg bool `json:"requirefuncreg"` CommissionTime time.Time `json:"commissiontime"` LastHeardFromTime time.Time `json:"lastheardfromtime"` Location Location `json:"location"` }
func ConvertJSONToExecutor ¶ added in v1.0.1
func ConvertJSONToExecutorArray ¶ added in v1.0.1
func CreateExecutor ¶ added in v1.0.1
func CreateExecutorFromDB ¶ added in v1.0.1
func (*Executor) IsApproved ¶ added in v1.0.1
func (*Executor) IsRejected ¶ added in v1.0.1
func (*Executor) SetColonyID ¶ added in v1.0.1
type Function ¶ added in v1.0.1
type Function struct { FunctionID string `json:"functionid"` ExecutorID string `json:"executorid"` ColonyID string `json:"colonyid"` FuncName string `json:"funcname"` Desc string `json:"desc"` Counter int `json:"counter"` MinWaitTime float64 `json:"minwaittime"` MaxWaitTime float64 `json:"maxwaittime"` MinExecTime float64 `json:"minexectime"` MaxExecTime float64 `json:"maxexectime"` AvgWaitTime float64 `json:"avgwaittime"` AvgExecTime float64 `json:"avgexectime"` Args []string `json:"args"` }
func ConvertJSONToFunction ¶ added in v1.0.1
func ConvertJSONToFunctionArray ¶ added in v1.0.1
func CreateFunction ¶ added in v1.0.1
type FunctionSpec ¶ added in v1.0.1
type FunctionSpec struct { NodeName string `json:"nodename"` FuncName string `json:"funcname"` Args []interface{} `json:"args"` Priority int `json:"priority"` MaxWaitTime int `json:"maxwaittime"` MaxExecTime int `json:"maxexectime"` MaxRetries int `json:"maxretries"` Conditions Conditions `json:"conditions"` Label string `json:"label"` Env map[string]string `json:"env"` }
func ConvertJSONToFunctionSpec ¶ added in v1.0.1
func ConvertJSONToFunctionSpec(jsonString string) (*FunctionSpec, error)
func CreateEmptyFunctionSpec ¶ added in v1.0.1
func CreateEmptyFunctionSpec() *FunctionSpec
func CreateFunctionSpec ¶ added in v1.0.1
func (*FunctionSpec) AddDependency ¶ added in v1.0.1
func (funcSpec *FunctionSpec) AddDependency(dependency string)
func (*FunctionSpec) Equals ¶ added in v1.0.1
func (funcSpec *FunctionSpec) Equals(funcSpec2 *FunctionSpec) bool
func (*FunctionSpec) ToJSON ¶ added in v1.0.1
func (funcSpec *FunctionSpec) ToJSON() (string, error)
type Generator ¶
type Generator struct { ID string `json:"generatorid"` ColonyID string `json:"colonyid"` Name string `json:"name"` WorkflowSpec string `json:"workflowspec"` Trigger int `json:"trigger"` LastRun time.Time `json:"lastrun"` QueueSize int `json:"queuesize"` CheckerPeriod int `json:"checkerperiod"` }
func ConvertJSONToGenerator ¶
func CreateGenerator ¶
type GeneratorArg ¶
func CreateGeneratorArg ¶
func CreateGeneratorArg(generatorID string, colonyID string, arg string) *GeneratorArg
type Process ¶
type Process struct { ID string `json:"processid"` AssignedExecutorID string `json:"assignedexecutorid"` IsAssigned bool `json:"isassigned"` State int `json:"state"` PriorityTime int64 `json:"prioritytime"` SubmissionTime time.Time `json:"submissiontime"` StartTime time.Time `json:"starttime"` EndTime time.Time `json:"endtime"` WaitDeadline time.Time `json:"waitdeadline"` ExecDeadline time.Time `json:"execdeadline"` Retries int `json:"retries"` Attributes []Attribute `json:"attributes"` FunctionSpec FunctionSpec `json:"spec"` WaitForParents bool `json:"waitforparents"` Parents []string `json:"parents"` Children []string `json:"children"` ProcessGraphID string `json:"processgraphid"` Input []interface{} `json:"in"` Output []interface{} `json:"out"` Errors []string `json:"errors"` }
func ConvertJSONToProcess ¶
func CreateProcess ¶
func CreateProcess(funcSpec *FunctionSpec) *Process
func CreateProcessFromDB ¶
func CreateProcessFromDB(funcSpec *FunctionSpec, id string, assignedExecutorID string, isAssigned bool, state int, priorityTime int64, submissionTime time.Time, startTime time.Time, endTime time.Time, waitDeadline time.Time, execDeadline time.Time, errors []string, retries int, attributes []Attribute) *Process
func (*Process) ProcessingTime ¶
func (*Process) SetAssignedExecutorID ¶ added in v1.0.1
func (*Process) SetAttributes ¶
func (*Process) SetEndTime ¶
func (*Process) SetProcessGraphID ¶
func (*Process) SetStartTime ¶
func (*Process) SetSubmissionTime ¶
-50000 - 50000
func (*Process) WaitingTime ¶
type ProcessGraph ¶
type ProcessGraph struct { ID string `json:"processgraphid"` ColonyID string `json:"colonyid"` Roots []string `json:"rootprocessids"` State int `json:"state"` SubmissionTime time.Time `json:"submissiontime"` StartTime time.Time `json:"starttime"` EndTime time.Time `json:"endtime"` ProcessIDs []string `json:"processids"` Nodes []Node `json:"nodes"` Edges []Edge `json:"edges"` // contains filtered or unexported fields }
func ConvertJSONToProcessGraph ¶
func ConvertJSONToProcessGraph(jsonString string) (*ProcessGraph, error)
func ConvertJSONToProcessGraphArray ¶
func ConvertJSONToProcessGraphArray(jsonString string) ([]*ProcessGraph, error)
func ConvertJSONToProcessGraphWithStorage ¶
func ConvertJSONToProcessGraphWithStorage(jsonString string) (*ProcessGraph, error)
func CreateProcessGraph ¶
func CreateProcessGraph(colonyID string) (*ProcessGraph, error)
func (*ProcessGraph) AddRoot ¶
func (graph *ProcessGraph) AddRoot(processID string)
func (*ProcessGraph) Equals ¶
func (graph *ProcessGraph) Equals(graph2 *ProcessGraph) bool
func (*ProcessGraph) FailedProcesses ¶
func (graph *ProcessGraph) FailedProcesses() (int, error)
func (*ProcessGraph) GetRoot ¶
func (graph *ProcessGraph) GetRoot(childProcessID string) (*Process, error)
func (*ProcessGraph) Iterate ¶
func (graph *ProcessGraph) Iterate(visitFunc func(process *Process) error) error
func (*ProcessGraph) Leaves ¶
func (graph *ProcessGraph) Leaves() ([]string, error)
func (*ProcessGraph) Processes ¶
func (graph *ProcessGraph) Processes() (int, error)
func (*ProcessGraph) Resolve ¶
func (graph *ProcessGraph) Resolve() error
func (*ProcessGraph) RunningProcesses ¶
func (graph *ProcessGraph) RunningProcesses() (int, error)
func (*ProcessGraph) SetStorage ¶
func (graph *ProcessGraph) SetStorage(storage ProcessGraphStorage)
func (*ProcessGraph) SuccessfulProcesses ¶
func (graph *ProcessGraph) SuccessfulProcesses() (int, error)
func (*ProcessGraph) ToJSON ¶
func (graph *ProcessGraph) ToJSON() (string, error)
func (*ProcessGraph) UpdateProcessIDs ¶
func (graph *ProcessGraph) UpdateProcessIDs() error
func (*ProcessGraph) WaitForParents ¶
func (graph *ProcessGraph) WaitForParents() (int, error)
func (*ProcessGraph) WaitProcesses ¶
func (graph *ProcessGraph) WaitProcesses() (int, error)
type ProcessGraphStorage ¶
type Statistics ¶
type Statistics struct { Colonies int `json:"colonies"` Executors int `json:"executors"` WaitingProcesses int `json:"waitingprocesses"` RunningProcesses int `json:"runningprocesses"` SuccessfulProcesses int `json:"successfulprocesses"` FailedProcesses int `json:"failedprocesses"` WaitingWorkflows int `json:"waitingworkflows"` RunningWorkflows int `json:"runningworkflows"` SuccessfulWorkflows int `json:"successfulworkflows"` FailedWorkflows int `json:"failedworkflows"` }
func ConvertJSONToStatistics ¶
func ConvertJSONToStatistics(jsonString string) (*Statistics, error)
func CreateStatistics ¶
func (*Statistics) Equals ¶
func (stat *Statistics) Equals(stat2 *Statistics) bool
func (*Statistics) ToJSON ¶
func (stat *Statistics) ToJSON() (string, error)
type WorkflowSpec ¶
type WorkflowSpec struct { ColonyID string `json:"colonyid"` FunctionSpecs []FunctionSpec `json:"functionspecs"` }
func ConvertJSONToWorkflowSpec ¶
func ConvertJSONToWorkflowSpec(jsonString string) (*WorkflowSpec, error)
func CreateWorkflowSpec ¶
func CreateWorkflowSpec(colonyID string) *WorkflowSpec
func (*WorkflowSpec) AddFunctionSpec ¶ added in v1.0.1
func (workflowSpec *WorkflowSpec) AddFunctionSpec(funcSpec *FunctionSpec)
func (*WorkflowSpec) Equals ¶
func (workflowSpec *WorkflowSpec) Equals(workflowSpec2 *WorkflowSpec) bool
func (*WorkflowSpec) ToJSON ¶
func (workflowSpec *WorkflowSpec) ToJSON() (string, error)
Click to show internal directories.
Click to hide internal directories.