leadership

package
v0.0.0-...-a002913 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2015 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ManagerConfig

type ManagerConfig struct {
	Client lease.Client
	Clock  clock.Clock
}

ManagerConfig contains the resources and information required to create a Manager.

func (ManagerConfig) Validate

func (config ManagerConfig) Validate() error

Validate returns an error if the configuration contains invalid information or missing resources.

type ManagerWorker

type ManagerWorker interface {
	leadership.Checker
	leadership.Claimer
	Kill()
	Wait() error
}

ManagerWorker implements leadership functions, and worker.Worker. We don't import worker because it pulls in a lot of dependencies and causes import cycles when you try to use leadership in state. We should break this cycle elsewhere if we can.

func NewManager

func NewManager(config ManagerConfig) (ManagerWorker, error)

NewManager returns a Manager implementation, backed by a lease.Client, which (in addition to its exposed Manager capabilities) will expire all known leases as they run out. The caller takes responsibility for killing, and handling errors from, the returned Worker.

Jump to

Keyboard shortcuts

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