Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Datastore ¶
type Datastore struct {
// contains filtered or unexported fields
}
Datastore holds a struct synced in a KV store
func NewDataStore ¶
func NewDataStore(ctx context.Context, kvSource staert.KvSource, object Object, listener Listener) (*Datastore, error)
NewDataStore creates a Datastore
type LeaderListener ¶
LeaderListener is called when leadership has changed
type Leadership ¶
Leadership allows leadership election using a KV store
func NewLeadership ¶
func NewLeadership(ctx context.Context, cluster *types.Cluster) *Leadership
NewLeadership creates a leadership
func (*Leadership) AddListener ¶
func (l *Leadership) AddListener(listener LeaderListener)
AddListener adds a leadership listerner
func (*Leadership) IsLeader ¶
func (l *Leadership) IsLeader() bool
IsLeader returns true if current node is leader
func (*Leadership) Participate ¶
func (l *Leadership) Participate(pool *safe.Pool)
Participate tries to be a leader
type Transaction ¶
Transaction allows to set a struct in the KV store
Click to show internal directories.
Click to hide internal directories.