model

package
v0.0.0-...-f28986b Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ElementInArray

func ElementInArray(element interface{}, array []interface{}) bool

func RemoveElementFrom2D

func RemoveElementFrom2D(array [][]interface{}, index int) [][]interface{}

Removes an element form an array. If the array was ordered before, it will loose that order.

func Sort2D

func Sort2D(array [][]interface{}, index int, direction Direction) error

Sorts a 2D array by the specified column index in the specified direction. Panics if index is out of bounds. Allowed direction values are Desc and Asc. Supported types are nil, time.Time, string, json.Number and bool. Errors are given if direction or type are unknown.

Types

type Direction

type Direction string
const (
	Asc  Direction = "asc"
	Desc Direction = "desc"
)

type Format

type Format string
const (
	PerQuery Format = "per_query"
	Table    Format = "table"
)

type QueriesRequestElement

type QueriesRequestElement struct {
	Measurement      string
	Time             *QueriesRequestElementTime
	Limit            *int
	Columns          []QueriesRequestElementColumn
	Filters          *[]QueriesRequestElementFilter
	GroupTime        *string
	OrderColumnIndex *int
	OrderDirection   *Direction
}

func (*QueriesRequestElement) Valid

func (element *QueriesRequestElement) Valid(format Format) bool

type QueriesRequestElementColumn

type QueriesRequestElementColumn struct {
	Name      string
	GroupType *string
	Math      *string
}

func (*QueriesRequestElementColumn) Valid

func (elementColumn *QueriesRequestElementColumn) Valid(hasTime bool) bool

type QueriesRequestElementFilter

type QueriesRequestElementFilter struct {
	Column string
	Math   *string
	Type   string
	Value  interface{}
}

func (*QueriesRequestElementFilter) Valid

func (filter *QueriesRequestElementFilter) Valid() bool

type QueriesRequestElementTime

type QueriesRequestElementTime struct {
	Last  *string
	Ahead *string
	Start *string
	End   *string
}

func (*QueriesRequestElementTime) Valid

func (elementTime *QueriesRequestElementTime) Valid() bool

Jump to

Keyboard shortcuts

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