executor

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DetermineStageStatus

func DetermineStageStatus(sig StopSignalType, ori, got model.StageStatus) model.StageStatus

func NewStopSignal

func NewStopSignal() (StopSignal, StopSignalHandler)

Types

type AppLiveResourceLister

type AppLiveResourceLister interface {
	ListKubernetesResources() ([]provider.Manifest, bool)
}

type CommandLister

type CommandLister interface {
	ListCommands() []model.ReportableCommand
}

type Executor

type Executor interface {
	// Execute starts running executor until completion
	// or the StopSignal has emitted.
	Execute(sig StopSignal) model.StageStatus
}

type Factory

type Factory func(in Input) Executor

type Input

type Input struct {
	Stage       *model.PipelineStage
	StageConfig config.PipelineStage
	// Readonly deployment model.
	Deployment            *model.Deployment
	Application           *model.Application
	PipedConfig           *config.PipedSpec
	TargetDSP             deploysource.Provider
	RunningDSP            deploysource.Provider
	CommandLister         CommandLister
	LogPersister          LogPersister
	MetadataStore         MetadataStore
	AppManifestsCache     cache.Cache
	AppLiveResourceLister AppLiveResourceLister
	Logger                *zap.Logger
}

type LogPersister

type LogPersister interface {
	Write(log []byte) (int, error)
	Info(log string)
	Infof(format string, a ...interface{})
	Success(log string)
	Successf(format string, a ...interface{})
	Error(log string)
	Errorf(format string, a ...interface{})
}

type MetadataStore

type MetadataStore interface {
	Get(key string) (string, bool)
	Set(ctx context.Context, key, value string) error

	GetStageMetadata(stageID string) (map[string]string, bool)
	SetStageMetadata(ctx context.Context, stageID string, metadata map[string]string) error
}

type StopSignal

type StopSignal interface {
	Context() context.Context
	Ch() <-chan StopSignalType
	Signal() StopSignalType
	Stopped() bool
}

type StopSignalHandler

type StopSignalHandler interface {
	Cancel()
	Timeout()
	Terminate()
}

type StopSignalType

type StopSignalType string
const (
	// StopSignalTerminate means the executor should stop its execution
	// because the program was asked to terminate.
	StopSignalTerminate StopSignalType = "terminate"
	// StopSignalCancel means the executor should stop its execution
	// because the deployment was cancelled.
	StopSignalCancel StopSignalType = "cancel"
	// StopSignalTimeout means the executor should stop its execution
	// because of timeout.
	StopSignalTimeout StopSignalType = "timeout"
	// StopSignalNone means the excutor can be continuously executed.
	StopSignalNone StopSignalType = "none"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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