cloudmon

package module
v0.0.0-...-bb56311 Latest Latest
Warning

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

Go to latest
Published: May 27, 2016 License: MIT Imports: 5 Imported by: 0

README

cloudmon GoDoc

A small wrapper for parts of Google Cloud Monitoring API

Example

c := cloudmon.NewClient(
	cloudmon.ProjectID("google-project-id"),
	cloudmon.OAuthSettings(os.Getenv("OAUTH_EMAIL"), os.Getenv("OAUTH_PRIVATE_KEY")),
)

g, err := c.NewGauge("name-of-gauge")
if err != nil {
	log.Fatal(err)
}

if err := g.Set(500); err != nil {
  log.Fatal(err)
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(opts ...optionFunc) *client

NewClient creates a new cloud monitor client

func OAuthSettings

func OAuthSettings(email, privateKey string) optionFunc

OAuthSettings is a option function that can be sent as an argument to NewClient to setup oauth

func ProjectID

func ProjectID(projectID string) optionFunc

ProjectID is a option function that can be sent as an argument to NewClient to set google project id

Types

type Client

type Client interface {
	NewGauge(name string) (Gauge, error)
}

A Client is a cloud monitor client.

type Gauge

type Gauge interface {
	Set(value int64) error
}

Gauge is a cloud monitor metric that represent a single int value a specific time

Jump to

Keyboard shortcuts

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