influxdb

package
v4.3.0-beta1+incompatible Latest Latest
Warning

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

Go to latest
Published: May 12, 2017 License: Apache-2.0 Imports: 17 Imported by: 131

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewInfluxDBExecutor

func NewInfluxDBExecutor(datasource *models.DataSource) (tsdb.Executor, error)

Types

type DefinitionParameters

type DefinitionParameters struct {
	Name string
	Type string
}

type InfluxDBExecutor

type InfluxDBExecutor struct {
	*models.DataSource
	QueryParser    *InfluxdbQueryParser
	ResponseParser *ResponseParser
	HttpClient     *http.Client
}

func (*InfluxDBExecutor) Execute

func (e *InfluxDBExecutor) Execute(ctx context.Context, queries tsdb.QuerySlice, context *tsdb.QueryContext) *tsdb.BatchResult

type InfluxDbSelect

type InfluxDbSelect struct {
	Type string
}

type InfluxdbQueryParser

type InfluxdbQueryParser struct{}

func (*InfluxdbQueryParser) Parse

func (qp *InfluxdbQueryParser) Parse(model *simplejson.Json, dsInfo *models.DataSource) (*Query, error)

type Message

type Message struct {
	Level string `json:"level,omitempty"`
	Text  string `json:"text,omitempty"`
}

type Query

type Query struct {
	Measurement  string
	Policy       string
	ResultFormat string
	Tags         []*Tag
	GroupBy      []*QueryPart
	Selects      []*Select
	RawQuery     string
	UseRawQuery  bool
	Alias        string

	Interval string
}

func (*Query) Build

func (query *Query) Build(queryContext *tsdb.QueryContext) (string, error)

type QueryDefinition

type QueryDefinition struct {
	Renderer func(query *Query, queryContext *tsdb.QueryContext, part *QueryPart, innerExpr string) string
	Params   []DefinitionParameters
}

func (QueryDefinition) Render

func (r QueryDefinition) Render(query *Query, queryContext *tsdb.QueryContext, part *QueryPart, innerExpr string) string

type QueryPart

type QueryPart struct {
	Def    QueryDefinition
	Type   string
	Params []string
}

func NewQueryPart

func NewQueryPart(typ string, params []string) (*QueryPart, error)

func (*QueryPart) Render

func (qp *QueryPart) Render(query *Query, queryContext *tsdb.QueryContext, expr string) string

type Response

type Response struct {
	Results []Result
	Err     error
}

type ResponseParser

type ResponseParser struct{}

func (*ResponseParser) Parse

func (rp *ResponseParser) Parse(response *Response, query *Query) *tsdb.QueryResult

type Result

type Result struct {
	Series   []Row
	Messages []*Message
	Err      error
}

type Row

type Row struct {
	Name    string            `json:"name,omitempty"`
	Tags    map[string]string `json:"tags,omitempty"`
	Columns []string          `json:"columns,omitempty"`
	Values  [][]interface{}   `json:"values,omitempty"`
}

type Select

type Select []QueryPart

type Tag

type Tag struct {
	Key       string
	Operator  string
	Value     string
	Condition string
}

Jump to

Keyboard shortcuts

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