Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Election ¶
type Election interface { io.Closer // NodeID returns the local node identifier used in the election NodeID() cluster.NodeID // PartitionID returns the mastership election partition identifier PartitionID() PartitionID // GetState returns the mastership state GetState() (*State, error) // IsMaster returns a bool indicating whether the local node is the master for the device IsMaster() (bool, error) // Watch watches the election for changes Watch(ch chan<- State) error }
Election is an election for a single mastership
type Key ¶
type Key string
Key is a mastership election key
type State ¶
type State struct { // PartitionID is the mastership partition identifier PartitionID PartitionID // Term is the mastership term Term Term // Master is the NodeID of the master for the key Master cluster.NodeID }
State contains information about a mastership term
type Store ¶
type Store interface { io.Closer // NodeID returns the local node identifier used in mastership elections NodeID() cluster.NodeID // GetElection gets the mastership election for the given key GetElection(key Key) (Election, error) }
Store is the mastership store
func NewDistributedStore ¶
NewDistributedStore returns a new distributed Store
Click to show internal directories.
Click to hide internal directories.