retrystrategy

package
v0.0.0-...-a0d7459 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2017 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Manifold

func Manifold(config ManifoldConfig) dependency.Manifold

Manifold returns a dependency manifold that runs a hook retry strategy worker, using the agent name and the api connection resources named in the supplied config.

func NewRetryStrategyWorker

func NewRetryStrategyWorker(config WorkerConfig) (worker.Worker, error)

NewRetryStrategyWorker returns a worker.Worker that returns the current retry strategy and bounces when it changes.

Types

type Facade

type Facade interface {
	RetryStrategy(names.Tag) (params.RetryStrategy, error)
	WatchRetryStrategy(names.Tag) (watcher.NotifyWatcher, error)
}

Facade defines the capabilities required by the worker from the API.

func NewFacade

func NewFacade(apiCaller base.APICaller) Facade

NewFacade creates a Facade from a base.APICaller. It's a sensible value for ManifoldConfig.NewFacade.

type ManifoldConfig

type ManifoldConfig struct {
	AgentName     string
	APICallerName string
	NewFacade     func(base.APICaller) Facade
	NewWorker     func(WorkerConfig) (worker.Worker, error)
}

ManifoldConfig defines the names of the manifolds on which a Manifold will depend.

type RetryStrategyWorker

type RetryStrategyWorker struct {
	*watcher.NotifyWorker
	// contains filtered or unexported fields
}

RetryStrategyWorker is a NotifyWorker with one additional method that returns the current retry strategy.

func (*RetryStrategyWorker) GetRetryStrategy

func (w *RetryStrategyWorker) GetRetryStrategy() params.RetryStrategy

GetRetryStrategy returns the current hook retry strategy

type WorkerConfig

type WorkerConfig struct {
	Facade        Facade
	AgentTag      names.Tag
	RetryStrategy params.RetryStrategy
}

WorkerConfig defines the worker's dependencies.

func (WorkerConfig) Validate

func (c WorkerConfig) Validate() error

Validate returns an error if the configuration is not complete.

Jump to

Keyboard shortcuts

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