influxdb

package
v0.3.10-0-alpha2 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2022 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrInfluxdbInvalidResponse = errors.Error("Influxdb invalid status")
)

Variables

This section is empty.

Functions

func NewInfluxdbExecutor

func NewInfluxdbExecutor(datasource *tsdb.DataSource) (tsdb.TsdbQueryEndpoint, error)

Types

type DefinitionParameters

type DefinitionParameters struct {
	Name string
	Type string
}

type InfluxdbExecutor

type InfluxdbExecutor struct {
	QueryParser    *InfluxdbQueryParser
	ResponseParser *ResponseParser
}

func (*InfluxdbExecutor) Query

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

type InfluxdbQueryParser

type InfluxdbQueryParser struct{}

func (*InfluxdbQueryParser) Parse

func (qp *InfluxdbQueryParser) Parse(model *tsdb.Query, dsInfo *tsdb.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         []api.MetricQueryTag
	GroupBy      []*QueryPart
	Selects      []*Select
	Alias        string
	Tz           string
	Interval     time.Duration
}

func (*Query) Build

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

type QueryDefinition

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

func (QueryDefinition) Render

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

type Response

type Response struct {
	Results []Result `json:"results"`
	Err     error    `json:"err"`
}

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      `json:"series"`
	Message []*Message `json:"message"`
	Err     error      `json:"err"`
}

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

Jump to

Keyboard shortcuts

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