Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
DefaultNamespace = "/micro/sync"
)
Functions ¶
Types ¶
type LeaderOption ¶
type LeaderOption func(o *LeaderOptions)
type LeaderOptions ¶
type LeaderOptions struct{}
type LeaderStatus ¶
type LeaderStatus int32
const ( FollowerStatus LeaderStatus = 0 CandidateStatus LeaderStatus = 1 ElectedStatus LeaderStatus = 2 )
type LockOption ¶
type LockOption func(o *LockOptions)
func LockTTL ¶
func LockTTL(t time.Duration) LockOption
func LockWait ¶
func LockWait(t time.Duration) LockOption
type Sync ¶
type Sync interface { // distributed lock interface Lock(id string, opts ...LockOption) (Lock, error) // leader election interface Leader(id string, opts ...LeaderOption) (Leader, error) // Start/Stop the internal publisher // used to announce this client and // subscribe to announcements. Start() error Stop() error // Name of sync String() string }
Click to show internal directories.
Click to hide internal directories.