Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( LockTTL = time.Second * 10 RegisterTTL = time.Second * 10 RegisterInterval = time.Second * 3 )
keys' ttl
Functions ¶
Types ¶
type Candidate ¶
type Candidate struct {
// contains filtered or unexported fields
}
Candidate represent a member in Cluster
func Register ¶
Register create a new Candidate on specific service, and return it. icandidate quit the service when context was canceled
func (*Candidate) WatchLeader ¶
WatchLeader return a channel, which output leader value when leader changed
type Lock ¶
type Lock struct {
// contains filtered or unexported fields
}
Lock represent a distribute lock
func NewLock ¶
NewLock returns a handle to a lock struct which can be used to provide mutual exclusion on a key
Click to show internal directories.
Click to hide internal directories.