graphite

package
v0.0.0-...-8d97d4a Latest Latest
Warning

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

Go to latest
Published: May 29, 2024 License: MIT Imports: 7 Imported by: 36

Documentation

Overview

Package graphite defines structures for interacting with a Graphite server.

Index

Constants

This section is empty.

Variables

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

DefaultClient is the default HTTP client for requests.

Functions

This section is empty.

Types

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
}

Jump to

Keyboard shortcuts

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