events

package
v0.0.0-...-0490640 Latest Latest
Warning

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

Go to latest
Published: May 16, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Since we aren't using the errors from this, we get lots of unparam violations as well

Index

Constants

View Source
const (
	// InitServicePhase phase for initializing services
	InitServicePhase = api.DeployEvent_INIT_SERVICE
	// InstallServicePhase phase for installing services
	InstallServicePhase = api.DeployEvent_INSTALL_SERVICE
	// StartServicePhase phase for starting services
	StartServicePhase = api.DeployEvent_START_SERVICE
	// UnloadServicePhase phase for unloading a service for restart or removal
	UnloadServicePhase = api.DeployEvent_UNLOAD_SERVICE
	// CheckingServiceHealth phase for checking services (status)
	CheckingServiceHealth = api.DeployEvent_CHECK_SERVICE_HEALTH
	// CreateAdminUser phase for creating initial admin user
	CreateAdminUser = api.DeployEvent_CREATE_ADMIN_USER
	// ApplyLicense phase for applying an A2 License if in config
	ApplyLicense = api.DeployEvent_APPLY_LICENSE
)

Variables

This section is empty.

Functions

func EventForBackup

func EventForBackup(seq uint64,
	deploymentID string,
	time time.Time,
	event *api.DeployEvent_Backup) api.DeployEvent

EventForBackup creates a new event envelope for a backup event

func EventForDeploy

func EventForDeploy(seq uint64,
	deploymentID string,
	time time.Time,
	event *api.DeployEvent_Deploy) api.DeployEvent

EventForDeploy creates a new event envelope for a deploy event

func EventForPhase

func EventForPhase(seq uint64,
	deploymentID string,
	time time.Time,
	event *api.DeployEvent_Phase) api.DeployEvent

EventForPhase creates a new event envelope for a phase event

func EventForPhaseStep

func EventForPhaseStep(seq uint64,
	deploymentID string,
	time time.Time,
	event *api.DeployEvent_PhaseStep) api.DeployEvent

EventForPhaseStep creates a new event envelope for a phase step event

func EventForTaskComplete

func EventForTaskComplete(seq uint64,
	deploymentID string,
	time time.Time,
	event *api.DeployEvent_TaskComplete) api.DeployEvent

EventForTaskComplete creates a new event envelope for a task complete event

func NewDeployEvent

func NewDeployEvent(status api.DeployEvent_Status) api.DeployEvent_Deploy

NewDeployEvent returns a new deploy event with the specified status.

func NewPhaseEvent

func NewPhaseEvent(phaseID api.DeployEvent_PhaseID, status api.DeployEvent_Status) api.DeployEvent_Phase

NewPhaseEvent returns a new phase event with the given name and status.

func NewPhaseStepEvent

func NewPhaseStepEvent(
	phaseID api.DeployEvent_PhaseID,
	name string,
	status api.DeployEvent_Status,
	err string) api.DeployEvent_PhaseStep

NewPhaseStepEvent returns a new phase step event for a given phase, step, and status. You can provide an error string if the status is CompleteFail.

func NewTaskCompleteEvent

func NewTaskCompleteEvent() api.DeployEvent_TaskComplete

NewTaskCompleteEvent creates a new event that when sent, marks the task complete

Types

type EventSender

type EventSender interface {
	Deploy(status api.DeployEvent_Status)
	Phase(status api.DeployEvent_Status, phaseID api.DeployEvent_PhaseID)
	PhaseStep(status api.DeployEvent_Status, phaseID api.DeployEvent_PhaseID,
		stepName string, errStr string)
	// streamTo is used by the server to provide the streaming
	// status of events out to the client.
	StreamTo(SendFun) error
	// TaskComplete signals that the server isn't doing anything else and the
	// stream should end.
	TaskComplete()
	Backup(backup api.DeployEvent_Backup)
	Stop()
}

EventSender is the interface we use to instrument the deployment-service to be able to capture status/progress events of its actions. Right now, we use it to send progress updates of an initial deployment out to the client.

func NewMemoryEventSender

func NewMemoryEventSender(deploymentID string) EventSender

NewMemoryEventSender creates a new memory backed eventSender given a specified deploymentID.

type MockEventSender

type MockEventSender struct {
	mock.Mock
}

MockEventSender is an autogenerated mock type for the EventSender type

func (*MockEventSender) Backup

func (_m *MockEventSender) Backup(backup deployment.DeployEvent_Backup)

Backup provides a mock function with given fields: backup

func (*MockEventSender) Deploy

func (_m *MockEventSender) Deploy(status deployment.DeployEvent_Status)

Deploy provides a mock function with given fields: status

func (*MockEventSender) Phase

Phase provides a mock function with given fields: status, phaseID

func (*MockEventSender) PhaseStep

func (_m *MockEventSender) PhaseStep(status deployment.DeployEvent_Status, phaseID deployment.DeployEvent_PhaseID, stepName string, errStr string)

PhaseStep provides a mock function with given fields: status, phaseID, stepName, errStr

func (*MockEventSender) Stop

func (_m *MockEventSender) Stop()

Stop provides a mock function with given fields:

func (*MockEventSender) StreamTo

func (_m *MockEventSender) StreamTo(_a0 func(*deployment.DeployEvent) error) error

StreamTo provides a mock function with given fields: _a0

func (*MockEventSender) TaskComplete

func (_m *MockEventSender) TaskComplete()

TaskComplete provides a mock function with given fields:

type SendFun

type SendFun = func(*api.DeployEvent) error

SendFun is the prototype for the function that will get called during StreamTo

Jump to

Keyboard shortcuts

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