manifold

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: 11 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// MaxSleep is the longest the manager will sleep before checking
	// whether any leases should be expired. If it can see a lease
	// expiring sooner than that it will still wake up earlier.
	MaxSleep = time.Minute
)

Variables

This section is empty.

Functions

func Manifold

func Manifold(config ManifoldConfig) dependency.Manifold

Manifold builds a dependency.Manifold for running a lease manager.

func NewStore

func NewStore(config lease.StoreConfig) *lease.Store

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

func NewWorker

func NewWorker(config lease.ManagerConfig) (worker.Worker, error)

NewWorker wraps NewManager to return worker.Worker for testability.

Types

type ManifoldConfig

type ManifoldConfig struct {
	AgentName      string
	ClockName      string
	DBAccessorName string

	Logger               lease.Logger
	LogDir               string
	PrometheusRegisterer prometheus.Registerer
	NewWorker            func(lease.ManagerConfig) (worker.Worker, error)
	NewStore             func(lease.StoreConfig) *lease.Store
}

ManifoldConfig holds the resources needed to start the lease manager in a dependency engine.

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