pipeline

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 5, 2018 License: BSD-3-Clause Imports: 23 Imported by: 1

Documentation

Index

Constants

View Source
const (
	RESTYPE_PIPELINE = "pipeline"
)

Variables

This section is empty.

Functions

func ExecuteCurrentStage

func ExecuteCurrentStage(ctx *ExecutionContext) (done bool, err error)

func GetDataResolver

func GetDataResolver() data.Resolver

func NewSimpleScope

func NewSimpleScope(attrs []*data.Attribute, parentScope data.Scope) data.Scope

NewSimpleScope creates a new SimpleScope

func Resume

func Resume(ctx *ExecutionContext) error

func ResumeCurrentStage

func ResumeCurrentStage(ctx *ExecutionContext) (done bool, err error)

Types

type BasicRemotePipelineProvider

type BasicRemotePipelineProvider struct {
}

func (*BasicRemotePipelineProvider) GetPipeline

func (*BasicRemotePipelineProvider) GetPipeline(pipelineURI string) (*DefinitionConfig, error)

todo this can be generalized an shared with flow

type Definition

type Definition struct {
	// contains filtered or unexported fields
}

func NewDefinition

func NewDefinition(config *DefinitionConfig) (*Definition, error)

func (*Definition) Metadata

func (d *Definition) Metadata() *data.IOMetadata

Metadata returns IO metadata for the flow

type DefinitionConfig

type DefinitionConfig struct {
	Name     string           `json:"name"`
	Metadata *data.IOMetadata `json:"metadata"`
	Stages   []*StageConfig   `json:"stages"`
}

type DetailedAttribute

type DetailedAttribute struct {
	*data.Attribute
	// contains filtered or unexported fields
}

type ExecutionContext

type ExecutionContext struct {
	// contains filtered or unexported fields
}

func (*ExecutionContext) ActivityHost

func (eCtx *ExecutionContext) ActivityHost() activity.Host

func (*ExecutionContext) CancelTimer

func (eCtx *ExecutionContext) CancelTimer(repeating bool)

CancelTimer cancels the existing timer

func (*ExecutionContext) CreateTimer

func (eCtx *ExecutionContext) CreateTimer(interval time.Duration, callback support.TimerCallback, repeating bool) error

CreateTimer creates a timer, note: can only have one active timer at a time for an activity

func (*ExecutionContext) FlowDetails

func (eCtx *ExecutionContext) FlowDetails() activity.FlowDetails

DEPRECATED

func (*ExecutionContext) GetInitValue

func (eCtx *ExecutionContext) GetInitValue(key string) (value interface{}, exists bool)

DEPRECATED

func (*ExecutionContext) GetInput

func (eCtx *ExecutionContext) GetInput(name string) interface{}

func (*ExecutionContext) GetOutput

func (eCtx *ExecutionContext) GetOutput(name string) interface{}

func (*ExecutionContext) GetResolver

func (eCtx *ExecutionContext) GetResolver() data.Resolver

func (*ExecutionContext) GetSetting

func (eCtx *ExecutionContext) GetSetting(setting string) (value interface{}, exists bool)

func (*ExecutionContext) GetSharedTempData

func (eCtx *ExecutionContext) GetSharedTempData() map[string]interface{}

func (*ExecutionContext) HasTimer

func (eCtx *ExecutionContext) HasTimer(repeating bool) bool

HasTimer indicates if a timer already exists

func (*ExecutionContext) ID

func (eCtx *ExecutionContext) ID() string

func (*ExecutionContext) IOMetadata

func (eCtx *ExecutionContext) IOMetadata() *data.IOMetadata

func (*ExecutionContext) Name

func (eCtx *ExecutionContext) Name() string

func (*ExecutionContext) Reply

func (eCtx *ExecutionContext) Reply(replyData map[string]*data.Attribute, err error)

func (*ExecutionContext) Return

func (eCtx *ExecutionContext) Return(returnData map[string]*data.Attribute, err error)

func (*ExecutionContext) SetOutput

func (eCtx *ExecutionContext) SetOutput(name string, value interface{})

func (*ExecutionContext) Status

func (eCtx *ExecutionContext) Status() ExecutionStatus

func (*ExecutionContext) TaskName

func (eCtx *ExecutionContext) TaskName() string

DEPRECATED

func (*ExecutionContext) UpdateTimer

func (eCtx *ExecutionContext) UpdateTimer(repeating bool)

UpdateTimer creates a timer, note: can only have one active timer at a time for an activity

func (*ExecutionContext) UpdateTimers

func (eCtx *ExecutionContext) UpdateTimers()

UpdateTimers creates a timer, note: can only have one active timer at a time for an activity

func (*ExecutionContext) WorkingData

func (eCtx *ExecutionContext) WorkingData() data.Scope

type ExecutionStatus

type ExecutionStatus int
const (
	// ExecStatusNotStarted indicates that the Pipeline execution has not started
	ExecStatusNotStarted ExecutionStatus = 0

	// ExecStatusActive indicates that the Pipeline execution is active
	ExecStatusActive ExecutionStatus = 100

	// ExecStatusStalled indicates that the Pipeline execution has stalled
	ExecStatusStalled ExecutionStatus = 400

	// ExecStatusCompleted indicates that the Pipeline execution has been completed
	ExecStatusCompleted ExecutionStatus = 500

	// ExecStatusCancelled indicates that the Pipeline execution has been cancelled
	ExecStatusCancelled ExecutionStatus = 600

	// ExecStatusFailed indicates that the Pipeline execution has failed
	ExecStatusFailed ExecutionStatus = 700
)

type InputValue

type InputValue interface {
	GetValue(scope data.Scope) (*DetailedAttribute, error)
}

func NewInput

func NewInput(attrName string, attrType data.Type, resolver data.Resolver, value interface{}, newAttr bool) (InputValue, error)

type InputValues

type InputValues struct {
	// contains filtered or unexported fields
}

func NewInputValues

func NewInputValues(inputMetadata map[string]*data.Attribute, resolver data.Resolver, values map[string]interface{}, ignoreNew bool) (*InputValues, error)

func (*InputValues) GetAttrs

func (ivs *InputValues) GetAttrs(scope data.Scope) (map[string]*data.Attribute, error)

func (*InputValues) GetDetailedAttrs

func (ivs *InputValues) GetDetailedAttrs(scope data.Scope) (map[string]*DetailedAttribute, error)

type Instance

type Instance struct {
	// contains filtered or unexported fields
}

func NewInstance

func NewInstance(definition *Definition, id string, single bool, outChannel channels.Channel) *Instance

func (*Instance) DoStep

func (inst *Instance) DoStep(ctx *ExecutionContext, resume bool) (hasWork bool, err error)

func (*Instance) Id

func (inst *Instance) Id() string

func (*Instance) Run

func (inst *Instance) Run(discriminator string, input map[string]*data.Attribute) (output map[string]*data.Attribute, status ExecutionStatus, err error)

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

func GetManager

func GetManager() *Manager

func NewManager

func NewManager() *Manager

func (*Manager) GetPipeline

func (m *Manager) GetPipeline(uri string) (*Definition, error)

func (*Manager) GetResource

func (m *Manager) GetResource(id string) interface{}

func (*Manager) LoadResource

func (m *Manager) LoadResource(config *resource.Config) error

type MapperAlt

type MapperAlt interface {
	Apply(inputScope data.Scope) (map[string]*data.Attribute, error)
}

switch to this mapper style in future?

type MultiScope

type MultiScope interface {
	GetAttrByScope(scope string, name string) (attr *data.Attribute, exists bool)
}

type Resolver

type Resolver struct {
}

func (*Resolver) Resolve

func (r *Resolver) Resolve(toResolve string, scope data.Scope) (value interface{}, err error)

type SharedScope

type SharedScope struct {
	// contains filtered or unexported fields
}

func (*SharedScope) AddAttr

func (inst *SharedScope) AddAttr(attrName string, attrType data.Type, value interface{}) *data.Attribute

AddAttr implements data.MutableScope.SetAttrValue

func (*SharedScope) GetAttr

func (inst *SharedScope) GetAttr(attrName string) (value *data.Attribute, exists bool)

GetAttr implements data.Scope.GetAttr

func (*SharedScope) SetAttrValue

func (inst *SharedScope) SetAttrValue(attrName string, value interface{}) error

SetAttrValue implements data.Scope.SetAttrValue

type SimpleScope

type SimpleScope struct {
	// contains filtered or unexported fields
}

SimpleScope is a basic implementation of a scope

func NewSimpleScopeFromMap

func NewSimpleScopeFromMap(attrs map[string]*data.Attribute, parentScope data.Scope) *SimpleScope

NewSimpleScopeFromMap creates a new SimpleScope

func (*SimpleScope) AddAttr

func (s *SimpleScope) AddAttr(name string, valueType data.Type, value interface{}) *data.Attribute

AddAttr implements MutableScope.AddAttr

func (*SimpleScope) GetAttr

func (s *SimpleScope) GetAttr(name string) (attr *data.Attribute, exists bool)

GetAttr implements Scope.GetAttr

func (*SimpleScope) SetAttrValue

func (s *SimpleScope) SetAttrValue(name string, value interface{}) error

SetAttrValue implements Scope.SetAttrValue

type Stage

type Stage struct {
	// contains filtered or unexported fields
}

func NewStage

func NewStage(config *StageConfig) (*Stage, error)

type StageConfig

type StageConfig struct {
	*activity.Config

	Promotions []string `json:"addToPipeline,omitempty"`
}

type StageInputScope

type StageInputScope struct {
	// contains filtered or unexported fields
}

SimpleScope is a basic implementation of a scope

func (*StageInputScope) GetAttr

func (s *StageInputScope) GetAttr(name string) (attr *data.Attribute, exists bool)

GetAttr implements Scope.GetAttr

func (*StageInputScope) GetAttrByScope

func (s *StageInputScope) GetAttrByScope(scope string, name string) (attr *data.Attribute, exists bool)

func (*StageInputScope) SetAttrValue

func (s *StageInputScope) SetAttrValue(name string, value interface{}) error

SetAttrValue implements Scope.SetAttrValue

type StageOutputScope

type StageOutputScope struct {
	// contains filtered or unexported fields
}

SimpleScope is a basic implementation of a scope

func (*StageOutputScope) GetAttr

func (s *StageOutputScope) GetAttr(name string) (attr *data.Attribute, exists bool)

GetAttr implements Scope.GetAttr

func (*StageOutputScope) GetAttrByScope

func (s *StageOutputScope) GetAttrByScope(scope string, name string) (attr *data.Attribute, exists bool)

func (*StageOutputScope) SetAttrValue

func (s *StageOutputScope) SetAttrValue(name string, value interface{}) error

SetAttrValue implements Scope.SetAttrValue

type State

type State interface {
	GetScope() data.MutableScope

	//GetSharedTempData gets the activity instance specific shared data
	GetSharedData(act activity.Activity) map[string]interface{}

	NewTicker(act activity.Activity, interval time.Duration) (*TickerHolder, error)

	GetTicker(act activity.Activity) (*TickerHolder, bool)

	RemoveTicker(act activity.Activity) bool

	NewTimer(act activity.Activity, interval time.Duration) (*TimerHolder, error)

	GetTimer(act activity.Activity) (*TimerHolder, bool)

	RemoveTimer(act activity.Activity) bool
}

type StateManager

type StateManager interface {
	GetState(id string) State
}

func NewMultiStateManager

func NewMultiStateManager() StateManager

func NewSimpleStateManager

func NewSimpleStateManager() StateManager

type Status

type Status int
const (
	// StatusNotStarted indicates that the Pipeline has not started
	StatusNotStarted Status = 0

	// StatusActive indicates that the Pipeline is active
	StatusActive Status = 100

	// StatusDone indicates that the Pipeline is done
	StatusDone Status = 500
)

type TickerHolder

type TickerHolder struct {
	// contains filtered or unexported fields
}

func (*TickerHolder) GetLastExecCtx

func (t *TickerHolder) GetLastExecCtx() *ExecutionContext

func (*TickerHolder) GetTicker

func (t *TickerHolder) GetTicker() *time.Ticker

func (*TickerHolder) SetLastExecCtx

func (t *TickerHolder) SetLastExecCtx(ctx *ExecutionContext)

type TimerHolder

type TimerHolder struct {
	// contains filtered or unexported fields
}

func (*TimerHolder) GetLastExecCtx

func (t *TimerHolder) GetLastExecCtx() *ExecutionContext

func (*TimerHolder) GetTimer

func (t *TimerHolder) GetTimer() *time.Timer

func (*TimerHolder) SetLastExecCtx

func (t *TimerHolder) SetLastExecCtx(ctx *ExecutionContext)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL