sqlite3

package
v0.0.0-...-8309057 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DataPoint

type DataPoint struct {
	Time  int64
	Value float64
}

DataPoint is a time-scalar tuple for reporting observations back to Grafana.

type QueryFilter

type QueryFilter struct {
	Key      string
	Operator string
	Value    string
}

QueryFilter stores a query limiter requested by Grafana.

type QueryRange

type QueryRange struct {
	From string
	To   string
	Raw  QueryRangeRaw
}

QueryRange represents a time period requested by Grafana.

type QueryRangeRaw

type QueryRangeRaw struct {
	From string
	To   string
}

QueryRangeRaw stores the grafana time query range as entered by user. The range values typically have relative values, such as "now-10d".

type QueryTarget

type QueryTarget struct {
	Target string
	RefID  string
	Type   string
}

QueryTarget represents a timeseries requested by Grafana or subsequence returned to Grafana of a requested timeseries where each observation is tagged by the Target field value.

type Set

type Set interface {
	Add(value string)
	Remove(value string)
	Contains(value string) bool
}

Set represents an unordered collection of strings.

func NewSet

func NewSet(contents ...string) Set

NewSet creates a collection of strings.

type TagKey

type TagKey struct {
	Type string `json:"type"`
	Text string ` json:"text"`
}

TagKey represents a column name and the declared type of column values.

type TimeSeriesManager

type TimeSeriesManager interface {
	GetTimeSeries(target string, fromTo *QueryRange, opts *TimeSeriesQueryOpts, dest *map[string][]DataPoint) error
	GetTagKeys(tableName string, dest *[]TagKey) error
	GetTagValues(tableName string, key string, dest *[]string) error
}

TimeSeriesManager exposes calls available to ReST end points to query SQLite table columns to Grafana.

func New

func New(dbFileName string, table string, timeColumn string) (TimeSeriesManager, error)

New builds a new timeseries manager backed by the DB file and table with indexed time column.

type TimeSeriesQueryOpts

type TimeSeriesQueryOpts struct {
	Interval      string
	MaxDataPoints int32
	Filters       []QueryFilter
}

TimeSeriesQueryOpts holds options for a query. Currently, only the MaxDataPoints field is respected by sqlite32grafana.

Jump to

Keyboard shortcuts

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