leaseexpiry

package
v0.0.0-...-ac56535 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 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(cfg ManifoldConfig) dependency.Manifold

Manifold returns a dependency.Manifold that will run the lease expiry worker.

func NewWorker

func NewWorker(cfg Config) (worker.Worker, error)

NewWorker returns a worker that periodically deletes expired leases from the controller database.

Types

type Config

type Config struct {
	Clock     clock.Clock
	Logger    Logger
	TrackedDB coredatabase.TrackedDB
}

Config encapsulates the configuration options for instantiating a new lease expiry worker.

func (Config) Validate

func (cfg Config) Validate() error

Validate checks whether the worker configuration settings are valid.

type Logger

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

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

type ManifoldConfig

type ManifoldConfig struct {
	ClockName      string
	DBAccessorName string

	Logger Logger

	NewWorker func(Config) (worker.Worker, error)
}

ManifoldConfig holds the resources required to start the lease expiry worker.

func (ManifoldConfig) Validate

func (c ManifoldConfig) Validate() error

Validate checks that the config has all the required values.

Jump to

Keyboard shortcuts

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