Back to godoc.org
github.com/juju/juju/worker/retrystrategy

package retrystrategy

v0.0.0 (f8e9480)
Latest Go to latest
Published: today | License: AGPL-3.0 | Module: github.com/juju/juju

Index

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.

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 Logger

type Logger interface {
	Debugf(string, ...interface{})
}

Logger represents the methods used by the worker to log information.

type ManifoldConfig

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

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
	Logger        Logger
}

WorkerConfig defines the worker's dependencies.

func (WorkerConfig) Validate

func (c WorkerConfig) Validate() error

Validate returns an error if the configuration is not complete.

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
f or F : Jump to identifier