mastership

package
v0.9.8 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2021 License: Apache-2.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 Mastership

type Mastership struct {
	// Device is the identifier of the device to which this mastership related
	Device device.ID

	// Term is the mastership term
	Term Term

	// Master is the NodeID of the master for the device
	Master cluster.NodeID
}

Mastership contains information about a device mastership term

type Store

type Store interface {
	io.Closer

	// NodeID returns the local node identifier used in mastership elections
	NodeID() cluster.NodeID

	// GetMastership returns the mastership for a given device
	GetMastership(id device.ID) (*Mastership, error)

	// Watch watches the store for mastership changes
	Watch(device.ID, chan<- Mastership) error
}

Store is the device mastership store

func NewAtomixStore

func NewAtomixStore(client atomix.Client, nodeID cluster.NodeID) (Store, error)

NewAtomixStore returns a new persistent Store

type Term

type Term uint64

Term is a monotonically increasing mastership term

Jump to

Keyboard shortcuts

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