leaseexpiry

package
v0.0.0-...-56cb166 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2025 License: AGPL-3.0 Imports: 15 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 NewStore

func NewStore(dbGetter database.DBGetter, logger logger.Logger) lease.ExpiryStore

NewStore returns a new lease store based on the input config.

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.Logger
	Store  lease.ExpiryStore
	Tracer trace.Tracer
}

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 ManifoldConfig

type ManifoldConfig struct {
	ClockName      string
	DBAccessorName string
	TraceName      string

	Logger logger.Logger

	NewWorker func(Config) (worker.Worker, error)
	NewStore  func(database.DBGetter, logger.Logger) lease.ExpiryStore
}

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