interfaces

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2022 License: BSD-2-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Evaluator

type Evaluator interface {
	Eval(ctx context.Context, e parser.Expr, from, until int64, values map[parser.MetricRequest][]*types.MetricData) ([]*types.MetricData, error)
}

Evaluator is a interface for any existing expression parser

type Function

type Function interface {
	SetEvaluator(evaluator Evaluator)
	GetEvaluator() Evaluator
	Do(ctx context.Context, e parser.Expr, from, until int64, values map[parser.MetricRequest][]*types.MetricData) ([]*types.MetricData, error)
	Description() map[string]types.FunctionDescription
}

Function is interface that all graphite functions should follow

type FunctionBase

type FunctionBase struct {
	Evaluator Evaluator
}

FunctionBase is a set of base methods that partly satisfy Function interface and most probably nobody will modify

func (*FunctionBase) GetEvaluator

func (b *FunctionBase) GetEvaluator() Evaluator

GetEvaluator returns evaluator

func (*FunctionBase) SetEvaluator

func (b *FunctionBase) SetEvaluator(evaluator Evaluator)

SetEvaluator sets evaluator

type FunctionMetadata added in v0.11.0

type FunctionMetadata struct {
	Name     string
	Filename string
	Order    Order
	F        Function
}

type Order added in v0.11.0

type Order int
const (
	Any Order = iota
	Last
)

type RewriteFunction added in v0.11.0

type RewriteFunction interface {
	SetEvaluator(evaluator Evaluator)
	GetEvaluator() Evaluator
	Do(ctx context.Context, e parser.Expr, from, until int64, values map[parser.MetricRequest][]*types.MetricData) (bool, []string, error)
	Description() map[string]types.FunctionDescription
}

Function is interface that all graphite functions should follow

type RewriteFunctionMetadata added in v0.11.0

type RewriteFunctionMetadata struct {
	Name     string
	Filename string
	Order    Order
	F        RewriteFunction
}

Jump to

Keyboard shortcuts

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