retrystrategy

package
v0.0.0-...-3d086f3 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: AGPL-3.0 Imports: 10 Imported by: 5

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 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.

Jump to

Keyboard shortcuts

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