model

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeviceGroupFilterCriteriaValid added in v0.0.2

func DeviceGroupFilterCriteriaValid(criteria models.DeviceGroupFilterCriteria) bool

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, float64 and bool. Errors are given if direction or type are unknown.

Types

type DataAvailabilityResponseElement

type DataAvailabilityResponseElement struct {
	ServiceId string     `json:"serviceId,omitempty"`
	From      *time.Time `json:"from,omitempty"`
	To        *time.Time `json:"to,omitempty"`
	GroupType *string    `json:"groupType,omitempty"`
	GroupTime *string    `json:"groupTime,omitempty"`
}

type DeviceUsage

type DeviceUsage struct {
	DeviceId    string    `json:"deviceId"`
	Bytes       uint64    `json:"bytes"`
	BytesPerDay float64   `json:"bytesPerDay"`
	UpdatedAt   time.Time `json:"updatedAt"`
}

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 LastValuesRequestElement

type LastValuesRequestElement struct {
	ExportId               *string
	DeviceId               *string
	ServiceId              *string
	Math                   *string
	SourceCharacteristicId *string
	TargetCharacteristicId *string
	ConceptId              *string
	ColumnName             string
}

type LastValuesResponseElement

type LastValuesResponseElement struct {
	Time  *string     `json:"time"`
	Value interface{} `json:"value"`
}

type PreparedQueriesRequestElement

type PreparedQueriesRequestElement struct {
	QueriesRequestElement
	Token      string
	TimeFormat string
}

type QueriesRequestElement

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

func (*QueriesRequestElement) Valid

func (element *QueriesRequestElement) Valid() bool

type QueriesRequestElementColumn

type QueriesRequestElementColumn struct {
	Name                   string
	GroupType              *string
	Math                   *string
	SourceCharacteristicId *string
	TargetCharacteristicId *string
	ConceptId              *string
	Criteria               models.DeviceGroupFilterCriteria
}

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

type QueriesV2ResponseElement added in v0.0.2

type QueriesV2ResponseElement struct {
	RequestIndex int               `json:"requestIndex"`
	SelIdx       int               `json:"-"`
	Data         [][][]interface{} `json:"data"`
}

Jump to

Keyboard shortcuts

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