models

package
v0.0.0-...-d66e16b Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	QueryTypeAWG     = "AWG"
	QueryTypeEasings = "easing"
)

Variables

This section is empty.

Functions

func GetStreamKey

func GetStreamKey(query *SignalQuery) string

Types

type BaseSignalField

type BaseSignalField struct {
	Name   string            `json:"name,omitempty"`
	Config *data.FieldConfig `json:"config,omitempty"`
	Labels data.Labels       `json:"labels,omitempty"`
}

func (*BaseSignalField) SetValue

func (b *BaseSignalField) SetValue(v string) error

type DatasourceSettings

type DatasourceSettings struct {
}

type ExpressionConfig

type ExpressionConfig struct {
	BaseSignalField

	Expr     string         `json:"expr,omitempty"`
	DataType data.FieldType `json:"type,omitempty"`
}

type RangeFieldConfig

type RangeFieldConfig struct {
	BaseSignalField

	Min   float64 `json:"min,omitempty"`   // The frame name
	Max   float64 `json:"max,omitempty"`   // time string
	Count int64   `json:"count,omitempty"` // 0 will use maxDataPoints
	Ease  string  `json:"ease,omitempty"`  // easing funciton 0-1
}

type SignalConfig

type SignalConfig struct {
	Name string `json:"name,omitempty"` // The frame name

	Time  TimeFieldConfig  `json:"time,omitempty"`
	Range RangeFieldConfig `json:"range,omitempty"`

	// The non-time fields
	Fields []ExpressionConfig `json:"fields,omitempty"`
}

type SignalQuery

type SignalQuery struct {
	Signal SignalConfig `json:"signal,omitempty"` // all components get added together
	Stream bool         `json:"stream,omitempty"` // flag if this should be a streaming query

	// These are added from the base query
	Interval      time.Duration     `json:"-"`
	TimeRange     backend.TimeRange `json:"-"`
	MaxDataPoints int64             `json:"-"`
	QueryType     string            `json:"-"`
}

func GetSignalQuery

func GetSignalQuery(dq *backend.DataQuery) (*SignalQuery, error)

type TimeFieldConfig

type TimeFieldConfig struct {
	BaseSignalField

	Period string `json:"period,omitempty"` // time string
}

Jump to

Keyboard shortcuts

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