influxdb

package
Version: v5.4.5+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2019 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewInfluxDBExecutor

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

Types

type DefinitionParameters

type DefinitionParameters struct {
	Name string
	Type string
}

type InfluxDBExecutor

type InfluxDBExecutor struct {
	//*models.DataSource
	QueryParser    *InfluxdbQueryParser
	ResponseParser *ResponseParser
}

func (*InfluxDBExecutor) Query

func (e *InfluxDBExecutor) Query(ctx context.Context, dsInfo *models.DataSource, tsdbQuery *tsdb.TsdbQuery) (*tsdb.Response, error)

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     time.Duration
}

func (*Query) Build

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

type QueryDefinition

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

func (QueryDefinition) Render

func (r QueryDefinition) Render(query *Query, queryContext *tsdb.TsdbQuery, 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.TsdbQuery, 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