meterstatus

package
v0.0.0-...-a0d7459 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2017 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package meterstatus provides the meter status API facade.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MeterStatusWrapper

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.

Types

type MeterStatus

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

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

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

func NewMeterStatusAPI

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

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

func (*MeterStatusAPI) GetMeterStatus

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

GetMeterStatus returns meter status information for each unit.

func (*MeterStatusAPI) WatchMeterStatus

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

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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