native

package
v1.0.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2020 License: Apache-2.0 Imports: 22 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractFetchExpressions

func ExtractFetchExpressions(s string) ([]string, error)

ExtractFetchExpressions extracts timeseries fetch expressions from the given query

func MustRegisterAliasedFunction

func MustRegisterAliasedFunction(fname string, f interface{})

MustRegisterAliasedFunction registers a function under an alias, issuing a panic if the function cannot be registered

Types

type ArgumentASTNode

type ArgumentASTNode interface {
	String() string
}

ArgumentASTNode is an interface to help with printing the AST.

type CallASTNode

type CallASTNode interface {
	// Name returns the name of the call.
	Name() string
	// Arguments describe each argument that the call has, some
	// arguments can be casted to an Call themselves.
	Arguments() []ArgumentASTNode
}

CallASTNode is an interface to help with printing the AST.

type Engine

type Engine struct {
	// contains filtered or unexported fields
}

The Engine for running queries.

func NewEngine

func NewEngine(store storage.Storage) *Engine

NewEngine creates a new query engine.

func (*Engine) Compile

func (e *Engine) Compile(s string) (Expression, error)

Compile compiles an expression from an expression string

func (*Engine) FetchByQuery

func (e *Engine) FetchByQuery(
	ctx context.Context,
	query string,
	options storage.FetchOptions,
) (*storage.FetchResult, error)

FetchByQuery retrieves one or more time series based on a query.

func (*Engine) Storage added in v0.15.17

func (e *Engine) Storage() storage.Storage

Storage returns the engine's storage object

type Expression

type Expression interface {
	CallASTNode
	// Executes the expression against the given context, and returns the resulting time series data
	Execute(ctx *common.Context) (ts.SeriesList, error)
}

An Expression is a metric query expression

func Compile added in v0.15.14

func Compile(input string) (Expression, error)

Compile converts an input stream into the corresponding Expression.

type Function

type Function struct {
	// contains filtered or unexported fields
}

Function contains a function to invoke along with metadata about the function's argument and return type.

func MustRegisterFunction

func MustRegisterFunction(f interface{}) *Function

MustRegisterFunction registers a function, issuing a panic if the function cannot be registered

func (*Function) WithDefaultParams

func (f *Function) WithDefaultParams(defaultParams map[uint8]interface{}) *Function

WithDefaultParams provides default parameters for functions

Jump to

Keyboard shortcuts

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