ledger

package
v0.0.0-...-3c18be4 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Scheme     string
	Host       string
	ClusterKey string
}

func (*Client) CreateMeasurement

func (c *Client) CreateMeasurement(meter *Meter, timestamp string, units float64) error

func (*Client) ListMeters

func (c *Client) ListMeters() ([]*Meter, error)

func (*Client) PostMeasurementList

func (c *Client) PostMeasurementList(measurements *MeasurementList) error

This uses the proxy, which utilizes the queue

type Measurement

type Measurement struct {
	MeterID   int64   `json:"meter_id,omitempty"`
	MeterName string  `json:"meter_name,omitempty"`
	Value     float64 `json:"value"`
	Time      string  `json:"time"`
}

type MeasurementList

type MeasurementList struct {
	Namespace    string            `json:"namespace,omitempty"`
	Pod          string            `json:"pod,omitempty"`
	Labels       map[string]string `json:"labels,omitempty"`
	Measurements []*Measurement    `json:"measurements,omitempty"`
}

type Meter

type Meter struct {
	ID              int64  `json:"id"`
	Type            string `json:"meter_type"`
	Value           string `json:"value"`
	TimespanMinutes int64  `json:"timespan_minutes"`
}

func (*Meter) Name

func (m *Meter) Name() string

type MeterList

type MeterList struct {
	Meters []*Meter `json:"meters"`
}

Jump to

Keyboard shortcuts

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