instanceiterator

package
v0.30.0 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2019 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewIteratorState

func NewIteratorState(canaryInstances, allInstances []service.Instance, canaryLimit int) (*iteratorState, error)

Types

type BrokerServices

type BrokerServices interface {
	ProcessInstance(instance service.Instance, operationType string) (services.BOSHOperation, error)
	LastOperation(instance string, operationData broker.OperationData) (domain.LastOperation, error)
	Instances(filter map[string]string) ([]service.Instance, error)
	LatestInstanceInfo(inst service.Instance) (service.Instance, error)
}

type Builder

type Builder struct {
	BrokerServices        BrokerServices
	PollingInterval       time.Duration
	AttemptInterval       time.Duration
	AttemptLimit          int
	MaxInFlight           int
	Canaries              int
	Listener              Listener
	Sleeper               sleeper
	Triggerer             Triggerer
	CanarySelectionParams config.CanarySelectionParams
}

func NewBuilder

func NewBuilder(conf config.InstanceIteratorConfig, logger *log.Logger, logPrefix string) (*Builder, error)

func (*Builder) SetRecreateTriggerer

func (b *Builder) SetRecreateTriggerer() error

func (*Builder) SetUpgradeTriggerer

func (b *Builder) SetUpgradeTriggerer() error

type Iterator

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

func New

func New(builder *Builder) *Iterator

func (*Iterator) Iterate

func (it *Iterator) Iterate() error

func (*Iterator) IterateInstancesWithAttempts

func (it *Iterator) IterateInstancesWithAttempts() error

type LastOperationChecker

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

func NewStateChecker

func NewStateChecker(brokerServices BrokerServices) *LastOperationChecker

func (*LastOperationChecker) Check

func (l *LastOperationChecker) Check(guid string, operationData broker.OperationData) (services.BOSHOperation, error)

type Listener

type Listener interface {
	FailedToRefreshInstanceInfo(instance string)
	Starting(maxInFlight int)
	RetryAttempt(num, limit int)
	RetryCanariesAttempt(num, limit, remainingCanaries int)
	InstancesToProcess(instances []service.Instance)
	InstanceOperationStarting(instance string, index int, totalInstances int, isCanary bool)
	InstanceOperationStartResult(instance string, status services.BOSHOperationType)
	InstanceOperationFinished(instance string, result string)
	WaitingFor(instance string, boshTaskId int)
	Progress(pollingInterval time.Duration, orphanCount, processedCount, toRetryCount, deletedCount int)
	Finished(orphanCount, finishedCount, deletedCount int, busyInstances, failedInstances []string)
	CanariesStarting(canaries int, filter config.CanarySelectionParams)
	CanariesFinished()
}

func NewLoggingListener

func NewLoggingListener(logger *log.Logger, processType string) Listener

type LoggingListener

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

func (LoggingListener) CanariesFinished

func (ll LoggingListener) CanariesFinished()

func (LoggingListener) CanariesStarting

func (ll LoggingListener) CanariesStarting(canaries int, filter config.CanarySelectionParams)

func (LoggingListener) FailedToRefreshInstanceInfo

func (ll LoggingListener) FailedToRefreshInstanceInfo(instance string)

func (LoggingListener) Finished

func (ll LoggingListener) Finished(orphanCount, finishedCount, deletedCount int, busyInstances, failedInstances []string)

func (LoggingListener) InstanceOperationFinished

func (ll LoggingListener) InstanceOperationFinished(instance string, result string)

func (LoggingListener) InstanceOperationStartResult

func (ll LoggingListener) InstanceOperationStartResult(instance string, resultType services.BOSHOperationType)

func (LoggingListener) InstanceOperationStarting

func (ll LoggingListener) InstanceOperationStarting(instance string, index, totalInstances int, isCanary bool)

func (LoggingListener) InstancesToProcess

func (ll LoggingListener) InstancesToProcess(instances []service.Instance)

func (LoggingListener) Progress

func (ll LoggingListener) Progress(pollingInterval time.Duration, orphanCount, processedCount, toRetryCount, deletedCount int)

func (LoggingListener) RetryAttempt

func (ll LoggingListener) RetryAttempt(num, limit int)

func (LoggingListener) RetryCanariesAttempt

func (ll LoggingListener) RetryCanariesAttempt(attempt, limit, remainingCanaries int)

func (LoggingListener) Starting

func (ll LoggingListener) Starting(maxInFlight int)

func (LoggingListener) WaitingFor

func (ll LoggingListener) WaitingFor(instance string, boshTaskId int)

type RecreateTriggerer

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

func NewRecreateTriggerer

func NewRecreateTriggerer(brokerServices BrokerServices) *RecreateTriggerer

func (*RecreateTriggerer) TriggerOperation

func (t *RecreateTriggerer) TriggerOperation(instance service.Instance) (services.BOSHOperation, error)

type StateChecker

type StateChecker interface {
	Check(string, broker.OperationData) (services.BOSHOperation, error)
}

type Triggerer

type Triggerer interface {
	TriggerOperation(service.Instance) (services.BOSHOperation, error)
}

type UpgradeTriggerer

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

func NewUpgradeTriggerer

func NewUpgradeTriggerer(brokerServices BrokerServices) *UpgradeTriggerer

func (*UpgradeTriggerer) TriggerOperation

func (t *UpgradeTriggerer) TriggerOperation(instance service.Instance) (services.BOSHOperation, error)

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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