models

package
v11.1.4-modfix Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2024 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DatasourceInfo

type DatasourceInfo struct {
	HTTPClient *http.Client

	Token string
	URL   string

	DbName        string `json:"dbName"`
	Version       string `json:"version"`
	HTTPMode      string `json:"httpMode"`
	TimeInterval  string `json:"timeInterval"`
	DefaultBucket string `json:"defaultBucket"`
	Organization  string `json:"organization"`
	MaxSeries     int    `json:"maxSeries"`
	Timeout       time.Duration

	// FlightSQL grpc connection
	InsecureGrpc bool `json:"insecureGrpc"`
}

type DefinitionParameters

type DefinitionParameters struct {
	Name string
	Type string
}

type InfluxdbQueryParser

type InfluxdbQueryParser struct{}

type Message

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

type Query

type Query struct {
	Measurement  string
	Policy       string
	Tags         []*Tag
	GroupBy      []*QueryPart
	Selects      []*Select
	RawQuery     string
	UseRawQuery  bool
	Alias        string
	Interval     time.Duration
	Tz           string
	Limit        string
	Slimit       string
	OrderByTime  string
	RefID        string
	ResultFormat string
}

func QueryParse

func QueryParse(query backend.DataQuery) (*Query, error)

func (*Query) Build

func (query *Query) Build(queryContext *backend.QueryDataRequest) (string, error)

type QueryDefinition

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

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 *backend.QueryDataRequest, expr string) string

type Response

type Response struct {
	Results []Result
	Error   string
	Code    string
	Message string
}

type Result

type Result struct {
	Series   []Row
	Messages []*Message
	Error    string
}

type Row

type Row struct {
	Name    string            `json:"name,omitempty"`
	Tags    map[string]string `json:"tags,omitempty"`
	Columns []string          `json:"columns,omitempty"`
	Values  [][]any           `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