juju: github.com/juju/juju/state/raftlease Index | Files

package raftlease

import "github.com/juju/juju/state/raftlease"

Index

Package Files

target.go

func LeaseHolders Uses

func LeaseHolders(mongo Mongo, collection, namespace, modelUUID string) (map[string]string, error)

LeaseHolders returns a map of each lease and the holder in the specified namespace and model.

func MakeTrapdoorFunc Uses

func MakeTrapdoorFunc(mongo Mongo, collection string) raftlease.TrapdoorFunc

MakeTrapdoorFunc returns a raftlease.TrapdoorFunc for the specified collection.

func NewNotifyTarget Uses

func NewNotifyTarget(mongo Mongo, collection string, logDest io.Writer, errorLogger Logger) raftlease.NotifyTarget

NewNotifyTarget returns something that can be used to report lease changes.

type Logger Uses

type Logger interface {
    Errorf(string, ...interface{})
}

Logger allows us to report errors if we can't write to the database for some reason.

type Mongo Uses

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.

Package raftlease imports 12 packages (graph) and is imported by 6 packages. Updated 2019-08-31. Refresh now. Tools for package owners.