juju: github.com/juju/juju/api/singular Index | Files

package singular

import "github.com/juju/juju/api/singular"

Index

Package Files

api.go

type API Uses

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 Uses

func NewAPI(
    apiCaller base.APICaller,
    claimant names.Tag,
    entity names.Tag,
) (*API, error)

NewAPI returns a new API client for the Singular facade. It exposes methods for claiming and observing administration responsibility for the entity with the supplied tag, on behalf of the authenticated agent.

func (*API) Claim Uses

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

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

func (*API) Wait Uses

func (api *API) Wait() error

Wait blocks until nobody has responsibility for administration of the entity. 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.

Package singular imports 6 packages (graph) and is imported by 21 packages. Updated 2019-08-25. Refresh now. Tools for package owners.