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 ¶
Click to show internal directories.
Click to hide internal directories.