singular

package
v0.0.0-...-6cf1bc9 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2016 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	// contains filtered or unexported fields
}

API allows controller machines to claim responsibility for; or to wait for no other machine to have responsibility for; administration for some model.

func NewAPI

func NewAPI(apiCaller base.APICaller, controllerTag names.MachineTag) (*API, error)

NewAPI returns a new API client for the Singular facade. It exposes methods for claiming and observing administration responsibility for the apiCaller's model, on behalf of the supplied controller machine.

func (*API) Claim

func (api *API) Claim(duration time.Duration) error

Claim attempts to claim responsibility for model administration for the supplied duration. If the claim is denied, it will return lease.ErrClaimDenied.

func (*API) Wait

func (api *API) Wait() error

Wait blocks until nobody has responsibility for model administration. It should probably be doing something watchy rather than blocky, but it's following the lease manager implementation underlying the original leadership approach and it doesn't seem worth rewriting all that.

Jump to

Keyboard shortcuts

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