Back to godoc.org
bosun.org / graphite

Package graphite

v0.0.0-...-8a7cd2d
Latest Go to latest

The latest major version is .

Published: Jun 18, 2020 | License: MIT | Module: bosun.org

Overview

Package graphite defines structures for interacting with a Graphite server.

Index

Variables

var DefaultClient = &http.Client{
	Timeout: time.Minute,
}

DefaultClient is the default HTTP client for requests.

type Context

type Context interface {
	Query(*Request) (Response, error)
}

Context is the interface for querying a Graphite server.

type DataPoint

type DataPoint []json.Number

type Host

type Host string

Host is a simple Graphite Context with no additional features.

func (Host) Query

func (h Host) Query(r *Request) (Response, error)

Query performs a request to a Graphite server.

type HostHeader

type HostHeader struct {
	Host   string
	Header http.Header
}

func (HostHeader) Query

func (h HostHeader) Query(r *Request) (Response, error)

type Request

type Request struct {
	Start   *time.Time
	End     *time.Time
	Targets []string
	URL     *url.URL
}

Request holds query objects. Currently only absolute times are supported.

func (*Request) CacheKey

func (r *Request) CacheKey() string

func (*Request) Query

func (r *Request) Query(host string, header http.Header) (Response, error)

Query performs a request to Graphite at the given host. host specifies a hostname with optional port, and may optionally begin with a scheme (http, https) to specify the protocol (http is the default). header is the headers to send.

type Response

type Response []Series

type Series

type Series struct {
	Datapoints []DataPoint
	Target     string
}

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier