librato

package
v1.5.4 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2018 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Config = LibratoConfig{
	Username: "root",
	Token:    "root",
}
View Source
var FakeClient = NewFakeLibratoClient()

Functions

This section is empty.

Types

type Client

type Client interface {
	Write([]Measurement) error
}

type FakeLibratoClient

type FakeLibratoClient struct {
	Measurements []MeasurementsSavedToLibrato
}

func NewFakeLibratoClient

func NewFakeLibratoClient() *FakeLibratoClient

func (*FakeLibratoClient) Write

func (client *FakeLibratoClient) Write(measurements []Measurement) error

type LibratoClient

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

func NewClient

func NewClient(c LibratoConfig) *LibratoClient

func (*LibratoClient) Write

func (c *LibratoClient) Write(measurements []Measurement) error

type LibratoConfig

type LibratoConfig struct {
	Username string
	Token    string
	API      string
	Prefix   string
	Tags     map[string]string
}

func BuildConfig

func BuildConfig(uri *url.URL) (*LibratoConfig, error)

type Measurement

type Measurement struct {
	Name  string            `json:"name,omitempty"`
	Value float64           `json:"value,omitempty"`
	Tags  map[string]string `json:"tags,omitempty"`
	Time  int64             `json:"time,omitempty"`
}

type MeasurementsSavedToLibrato

type MeasurementsSavedToLibrato struct {
	Measurement Measurement
}

Jump to

Keyboard shortcuts

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