juju: github.com/juju/juju/apiserver/facades/agent/meterstatus Index | Files | Directories

package meterstatus

import "github.com/juju/juju/apiserver/facades/agent/meterstatus"

Package meterstatus provides the meter status API facade.

Index

Package Files

meterstatus.go wrapper.go

func MeterStatusWrapper Uses

func MeterStatusWrapper(getter func() (state.MeterStatus, error)) (state.MeterStatus, error)

MeterStatusWrapper takes a MeterStatus and converts it into an 'api friendly' form where Not Set and Not Available (which are important distinctions in state) are converted into Amber and Red respectively in the api.

type MeterStatus Uses

type MeterStatus interface {
    GetMeterStatus(args params.Entities) (params.MeterStatusResults, error)
    WatchMeterStatus(args params.Entities) (params.NotifyWatchResults, error)
}

MeterStatus defines the methods exported by the meter status API facade.

type MeterStatusAPI Uses

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

MeterStatusAPI implements the MeterStatus interface and is the concrete implementation of the API endpoint.

func NewMeterStatusAPI Uses

func NewMeterStatusAPI(
    st MeterStatusState,
    resources facade.Resources,
    authorizer facade.Authorizer,
) (*MeterStatusAPI, error)

NewMeterStatusAPI creates a new API endpoint for dealing with unit meter status.

func NewMeterStatusFacade Uses

func NewMeterStatusFacade(ctx facade.Context) (*MeterStatusAPI, error)

NewMeterStatusFacade provides the signature required for facade registration.

func (*MeterStatusAPI) GetMeterStatus Uses

func (m *MeterStatusAPI) GetMeterStatus(args params.Entities) (params.MeterStatusResults, error)

GetMeterStatus returns meter status information for each unit.

func (*MeterStatusAPI) WatchMeterStatus Uses

func (m *MeterStatusAPI) WatchMeterStatus(args params.Entities) (params.NotifyWatchResults, error)

WatchMeterStatus returns a NotifyWatcher for observing changes to each unit's meter status.

type MeterStatusState Uses

type MeterStatusState interface {

    // Application returns a application state by name.
    Application(name string) (*state.Application, error)

    // Unit returns a unit by name.
    Unit(id string) (*state.Unit, error)
}

MeterStatusState represents the state of an model required by the MeterStatus. go:generate mockgen -package mocks -destination mocks/meterstatus_mock.go github.com/juju/juju/apiserver/facades/agent/meterstatus MeterStatusState

Directories

PathSynopsis
mocksPackage mocks is a generated GoMock package.
testing

Package meterstatus imports 7 packages (graph) and is imported by 5 packages. Updated 2019-08-30. Refresh now. Tools for package owners.