lease

package
v0.0.0-...-be26699 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 3, 2015 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	LeaseClaimDeniedErr = errors.New("lease claim denied")
	NotLeaseOwnerErr    = errors.Unauthorizedf("caller did not own lease for namespace")
)
View Source
var ErrLeaseManagerRunning = errors.New("lease manager already running")

ErrLeaseManagerRunning is the error returned by NewLeaseManager if there is already one running.

View Source
var ErrNoLeaseManager = errors.New("no active lease manager")

ErrNoLeaseManager is the error returned by singletonLeaseManager methods if no lease manager is running.

Functions

func Manager

func Manager() *singletonLeaseManager

Manager returns a singleton lease manager, which is active so long as there is a running leaseManager worker.

func NewLeaseManager

func NewLeaseManager(leasePersistor leasePersistor) (*leaseManager, error)

NewLeaseManager returns a new leaseManager, a worker that manages leases. Users may interact with the lease manager while it is running, but will receive an error if the manager has stopped.

Starting a lease manager updates a singleton in this package, so an error will result if NewLeaseManager is called while another lease manager is still active.

Types

type Token

type Token struct {
	Namespace, Id string
	Expiration    time.Time
}

Token represents a lease claim.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL