example

package
v0.230.0 Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const DummyValueA = "dummyA"

Dummy value makes sure the enum extraction logic is valid

View Source
const DummyValueB = "dummyB"

Dummy value makes sure the enum extraction logic is valid

Variables

This section is empty.

Functions

This section is empty.

Types

type MathQuery

type MathQuery struct {
	// General math expression
	Expression string `json:"expression" jsonschema:"minLength=1,example=$A + 1,example=$A/$B"`
}

type QueryType

type QueryType string

+enum

const (
	// Math query type
	QueryTypeMath QueryType = "math"

	// Reduce query type
	QueryTypeReduce QueryType = "reduce"

	// Reduce query type
	QueryTypeResample QueryType = "resample"
)

type ReduceMode

type ReduceMode string

Non-Number behavior mode +enum

const (
	// Drop non-numbers
	ReduceModeDrop ReduceMode = "dropNN"

	// Replace non-numbers
	ReduceModeReplace ReduceMode = "replaceNN"
)

type ReduceQuery

type ReduceQuery struct {
	// Reference to other query results
	Expression string `json:"expression"`

	// The reducer
	Reducer ReducerID `json:"reducer"`

	// Reducer Options
	Settings ReduceSettings `json:"settings"`
}

type ReduceSettings

type ReduceSettings struct {
	// Non-number reduce behavior
	Mode ReduceMode `json:"mode"`

	// Only valid when mode is replace
	ReplaceWithValue *float64 `json:"replaceWithValue,omitempty"`
}

type ReducerID

type ReducerID string

The reducer function +enum

const (
	// The sum
	ReducerSum ReducerID = "sum"
	// The mean
	ReducerMean  ReducerID = "mean"
	ReducerMin   ReducerID = "min"
	ReducerMax   ReducerID = "max"
	ReducerCount ReducerID = "count"
	ReducerLast  ReducerID = "last"
)

type ResampleQuery

type ResampleQuery struct {
	// The math expression
	Expression string `json:"expression"`

	// A time duration string
	Window string `json:"window"`

	// The reducer
	Downsampler string `json:"downsampler"`

	// The reducer
	Upsampler string `json:"upsampler"`

	LoadedDimensions *data.Frame `json:"loadedDimensions"`
}

QueryType = resample

Jump to

Keyboard shortcuts

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