engine

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2017 License: Apache-2.0 Imports: 14 Imported by: 2

Documentation

Index

Constants

View Source
const (
	InProgressMonitorTickerDuration = 10 * time.Second
	PendingMonitorTickerDuration    = 10 * time.Second
)

Variables

This section is empty.

Functions

func NewDispatcher added in v0.2.0

func NewDispatcher(ctx context.Context,
	environmentService environment.EnvironmentService,
	deploymentService deployment.DeploymentService,
	ecs facade.ECS,
	css facade.ClusterState,
	deploymentWorker deployment.DeploymentWorker,
	input <-chan Event,
	output chan<- Event) *dispatcher

func NewScheduler

func NewScheduler(ctx context.Context, events chan<- Event, environmentService environment.EnvironmentService,
	deploymentService deployment.DeploymentService, css facade.ClusterState, ecs facade.ECS) *scheduler

NewScheduler creates a scheduler instance with clean execution state. There should be only one instance of this running on a host.

Types

type ErrorEvent added in v0.2.0

type ErrorEvent struct {
	Error error
}

ErrorEvent is generic event to notify of errors across actors

func (ErrorEvent) GetType added in v0.2.0

func (e ErrorEvent) GetType() EventType

type Event

type Event interface {
	//GetType returns event-type
	GetType() EventType
}

type EventType

type EventType string
const (
	StartDeploymentEventType         EventType = "StartDeploymentEvent"
	StopTasksEventType               EventType = "StopTasksEvent"
	SchedulerErrorEventType          EventType = "SchedulerErrorEvent"
	SchedulerEnvironmentEventType    EventType = "SchedulerEnvironmentEvent"
	ErrorEventType                   EventType = "ErrorEventType"
	StopTasksResultType              EventType = "StopTasksResultType"
	StartDeploymentResultType        EventType = "StartDeploymentResultType"
	StartPendingDeploymentResultType EventType = "StartPendingDeploymentResultType"

	MonitorErrorEventType               EventType = "MonitorErrorEventType"
	UpdateInProgressDeploymentEventType EventType = "UpdateInProgressDeploymentEvent"
	StartPendingDeploymentEventType     EventType = "StartPendingDeploymentEvent"
)

type Monitor

type Monitor interface {
	PendingMonitorLoop(tickerDuration time.Duration)
	InProgressMonitorLoop(tickerDuration time.Duration)
}

func NewMonitor

func NewMonitor(
	ctx context.Context,
	environmentService environment.EnvironmentService,
	events chan<- Event) Monitor

type MonitorErrorEvent added in v0.2.0

type MonitorErrorEvent struct {
	Error error
}

MonitorErrorEvent is message used to notify of any execution errors from Monitor

func (MonitorErrorEvent) GetType added in v0.2.0

func (e MonitorErrorEvent) GetType() EventType

type SchedulerEnvironmentEvent

type SchedulerEnvironmentEvent struct {
	Environment environmenttypes.Environment
	Message     string
}

SchedulerEnvironmentEvent is message used to notify of any execution errors from Scheduler

func (SchedulerEnvironmentEvent) GetType

type SchedulerErrorEvent

type SchedulerErrorEvent struct {
	Error       error
	Environment environmenttypes.Environment
}

SchedulerErrorEvent is message used to notify of any execution errors from Scheduler

func (SchedulerErrorEvent) GetType

func (e SchedulerErrorEvent) GetType() EventType

type StartDeploymentEvent

type StartDeploymentEvent struct {
	Instances   []*string
	Environment environmenttypes.Environment
}

StartDeploymentEvent is message used to notify actors to perform a deployment using environment

func (StartDeploymentEvent) GetType

func (e StartDeploymentEvent) GetType() EventType

type StartDeploymentResult added in v0.2.0

type StartDeploymentResult struct {
	Deployment types.Deployment
}

StartDeploymentResult is result of StartDeploymentEvent action

func (StartDeploymentResult) GetType added in v0.2.0

func (e StartDeploymentResult) GetType() EventType

type StartPendingDeploymentEvent added in v0.2.0

type StartPendingDeploymentEvent struct {
	Environment environmenttypes.Environment
}

func (StartPendingDeploymentEvent) GetType added in v0.2.0

type StartPendingDeploymentResult added in v0.2.0

type StartPendingDeploymentResult struct {
	Deployment types.Deployment
}

StartPendingDeploymentResult is result of StartPendingDeploymentEvent action

func (StartPendingDeploymentResult) GetType added in v0.2.0

type StopTasksEvent

type StopTasksEvent struct {
	Cluster     string
	Tasks       []string
	Environment environmenttypes.Environment
}

StopTasksEvent is message used to notify actors to stop tasks

func (StopTasksEvent) GetType

func (e StopTasksEvent) GetType() EventType

type StopTasksResult added in v0.2.0

type StopTasksResult struct {
	StoppedTasks []string
}

StopTasksResult is result of stop tasks action

func (StopTasksResult) GetType added in v0.2.0

func (e StopTasksResult) GetType() EventType

type UpdateInProgressDeploymentEvent

type UpdateInProgressDeploymentEvent struct {
	Environment environmenttypes.Environment
}

func (UpdateInProgressDeploymentEvent) GetType

Jump to

Keyboard shortcuts

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