Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrLeaderElected = errors.New("leader already elected") ErrNotLockHolder = errors.New("you're not mu holder") )
Functions ¶
This section is empty.
Types ¶
type LeaderChangeFn ¶
type LeaderChangeFn func(isLeader bool)
type LockSession ¶
type LockSession struct { Mutex // contains filtered or unexported fields }
func (*LockSession) GetHeartbeatInterval ¶
func (s *LockSession) GetHeartbeatInterval() time.Duration
func (*LockSession) IsLeader ¶
func (s *LockSession) IsLeader() bool
func (*LockSession) SetLeaderChangeFn ¶
func (s *LockSession) SetLeaderChangeFn(fn LeaderChangeFn)
type Session ¶
type SessionClient ¶
type SessionStore ¶
type SessionStore struct {
// contains filtered or unexported fields
}
func NewSessionStore ¶
func NewSessionStore(c SessionClient) *SessionStore
func (*SessionStore) Close ¶
func (store *SessionStore) Close(ctx context.Context) error
Close all sessions and release the lock if held by any session
Click to show internal directories.
Click to hide internal directories.