Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LeaseHolders ¶
LeaseHolders returns a map of each lease and the holder in the specified namespace and model.
func MakeTrapdoorFunc ¶
func MakeTrapdoorFunc(mongo Mongo, collection string) raftlease.TrapdoorFunc
MakeTrapdoorFunc returns a raftlease.TrapdoorFunc for the specified collection.
func NewNotifyTarget ¶
func NewNotifyTarget(mongo Mongo, collection string, logger Logger) raftlease.NotifyTarget
NewNotifyTarget returns something that can be used to report lease changes.
Types ¶
type Mongo ¶
type Mongo interface { // RunTransaction should probably delegate to a jujutxn.Runner's Run method. RunTransaction(jujutxn.TransactionSource) error // GetCollection should probably call the mongo.CollectionFromName func. GetCollection(name string) (collection mongo.Collection, closer func()) }
Mongo exposes MongoDB operations for use by the lease package.
Click to show internal directories.
Click to hide internal directories.