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 Engine
- type EngineKubernetesOptions
- type EngineOptions
- type Event
- type EventMetadata
- type EventReaction
- 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 ¶
const ( EventEngineStarted = "engine.started" EventEngineFinished = "engine.finished" EventTaskStarted = "task.started" EventTaskFinished = "task.finished" )
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 EngineKubernetesOptions ¶ added in v0.24.0
EngineKubernetesOptions when running service on kubernetes cluster
type EngineOptions ¶
type EngineOptions struct { Pipeline Pipeline // LogsDirectory path where to store logs LogsDirectory string Kubeconfig *EngineKubernetesOptions }
EngineOptions to create new engine
type Event ¶
type Event struct { Metadata EventMetadata Payload map[string]interface{} }
Event - means that something happen
type EventReaction ¶ added in v0.31.0
type EventReaction struct { Condition func(ev Event, state State) bool Reaction func(ev Event, state State) []Task }
EventReaction is a binding of an event to a function that builds tasks
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 ¶
type PipelineSpec struct { Reactions []EventReaction Services []Service }
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 }
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
type TaskState ¶
type TaskState struct { State string `yaml:"state"` Status string `yaml:"status"` Task string `yaml:"task"` Output string `yaml:"output"` Arguments string `yaml:"arguments"` Error string `yaml:"error"` EventID ID `yaml:"event-id"` Logger string `yaml:"logger"` }
TaskState state of single task