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 // Replicas is the replicas for the key Replicas []cluster.ReplicaID }
State contains information about a mastership term
Click to show internal directories.
Click to hide internal directories.