client

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2018 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller interface {
	Query(ctx context.Context, compiler flux.Compiler) (flux.Query, error)
	PrometheusCollectors() []prometheus.Collector
}

type HTTP

type HTTP struct {
	Addr               string
	InsecureSkipVerify bool
	// contains filtered or unexported fields
}

HTTP implements a Flux query client that makes requests to the /api/v2/query API endpoint.

func NewHTTP

func NewHTTP(host string, port int, ssl bool) (*HTTP, error)

NewHTTP creates a HTTP client

func (*HTTP) Query

func (s *HTTP) Query(ctx context.Context, r *ProxyRequest) (flux.ResultIterator, error)

Query runs a flux query against a influx server and decodes the result

type ProxyRequest

type ProxyRequest struct {
	// Compiler converts the query to a specification to run against the data.
	Compiler flux.Compiler

	// Dialect is the result encoder
	Dialect flux.Dialect
}

ProxyRequest specifies a query request and the dialect for the results.

type QueryDialect

type QueryDialect struct {
	Header         *bool    `json:"header"`
	Delimiter      string   `json:"delimiter"`
	CommentPrefix  string   `json:"commentPrefix"`
	DateTimeFormat string   `json:"dateTimeFormat"`
	Annotations    []string `json:"annotations"`
}

QueryDialect is the formatting options for the query response.

type QueryRequest

type QueryRequest struct {
	Spec    *flux.Spec   `json:"spec,omitempty"`
	Query   string       `json:"query"`
	Type    string       `json:"type"`
	Dialect QueryDialect `json:"dialect"`
}

QueryRequest is a flux query request.

func QueryRequestFromProxyRequest

func QueryRequestFromProxyRequest(req *ProxyRequest) (*QueryRequest, error)

func (QueryRequest) ProxyRequest

func (r QueryRequest) ProxyRequest() *ProxyRequest

ProxyRequest returns a request to proxy from the flux.

func (QueryRequest) Validate

func (r QueryRequest) Validate() error

Validate checks the query request and returns an error if the request is invalid.

func (QueryRequest) WithDefaults

func (r QueryRequest) WithDefaults() QueryRequest

WithDefaults adds default values to the request.

Jump to

Keyboard shortcuts

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