Documentation ¶
Index ¶
- Constants
- func ConditionEngineStarted(ev *Event, state *State) bool
- func ConditionTaskFinishedWithStatus(task string, status string) func(ev *Event, state *State) bool
- type Argument
- type Condition
- type Engine
- type EngineOptions
- type Event
- type EventMetadata
- type ID
- type Pipeline
- type PipelineMetadata
- type PipelineSpec
- type Service
- type State
- type StateMetadata
- type StateOptions
- type Task
- type TaskMetadata
- type TaskSpec
- type TaskState
Constants ¶
View Source
const ( EventEngineStarted = "engine.started" EventEngineFinished = "engine.finished" EventTaskStarted = "task.started" EventTaskFinished = "task.finished" )
View Source
const ( // EngineStateInProgress pipeline in execution progress EngineStateInProgress string = "in-progress" // EngineStateFinished pipeline is finished execution EngineStateFinished string = "finished" // TaskStateInProgress task is in progress TaskStateInProgress string = EngineStateInProgress // TaskStateFinished task is finished TaskStateFinished string = EngineStateFinished // TaskStatusSuccess set one the task status in case task was finished successfully TaskStatusSuccess = "Success" // TaskStatusFailed set one the task status in case task was finished and failed TaskStatusFailed = "failed" )
Variables ¶
This section is empty.
Functions ¶
func ConditionEngineStarted ¶
ConditionEngineStarted returns true once the engine emits started event
Types ¶
type Argument ¶
type Argument struct { Key string Value interface{} // Func returns a dynamic Value instead of Argument.Values Func func() interface{} }
Argument is key value struct that should be passed in a service call
type Condition ¶
type Condition struct { // Name of the condition Name string // Func runs all the times Func func(*Event, *State) bool }
Condition determine whenever run a task
type EngineOptions ¶
type EngineOptions struct { Pipeline Pipeline Kubeconfig *struct { Path string Context string Namespace string InCluster bool } }
EngineOptions to create new engine
type Event ¶
type Event struct { Metadata EventMetadata Payload map[string]interface{} }
Event - means that something happen
type Pipeline ¶
type Pipeline struct { Metadata PipelineMetadata Spec PipelineSpec }
Pipeline is the pipeline representation
type PipelineMetadata ¶
PipelineMetadata holds all the metadata of a pipeline
type PipelineSpec ¶
PipelineSpec is the spec of a pipeline
type Service ¶
type Service struct { // Name is official service which is part of the service catalog (https://github.com/open-integration/core-services/releases) Name string // Version of the service, empty string will use the latest version from catalog Version string // Path a location of the local fs the service can be found, Path cannot be set with Name together Path string // As alias name to refer the service as part of the task implementation As string }
Service is a Service a pipeline should execute
type State ¶
type State struct { History []historyElem `yaml:"history"` Metadata StateMetadata `yaml:"metadata"` Tasks map[ID]TaskState `yaml:"tasks"` // contains filtered or unexported fields }
State is the overall state of the pipeline execution
type StateMetadata ¶
type StateMetadata struct { // State is in-progress / finished State string `yaml:"state"` }
StateMetadata metadata of the statee
type StateOptions ¶
type StateOptions struct { EventCn chan *Event Logger logger.Logger StateFile string EventHistoryFile string }
StateOptions to creates state
type Task ¶
type Task struct { Metadata TaskMetadata Spec TaskSpec SpecFunc func(*State) (*TaskSpec, error) // Condition a set of conditions to run before task execution Condition *Condition }
Task is a task a pipeline should execute
type TaskMetadata ¶
type TaskMetadata struct { Name string // Reusable set to true to run the task multiple times Reusable bool }
TaskMetadata holds all the metadata of a pipeline
Source Files ¶
Click to show internal directories.
Click to hide internal directories.