model

package
v0.0.33 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 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 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 `json:"exportId,omitempty"`
	DeviceId               *string `json:"deviceId,omitempty"`
	ServiceId              *string `json:"serviceId,omitempty"`
	Math                   *string `json:"math,omitempty"`
	SourceCharacteristicId *string `json:"sourceCharacteristicId,omitempty"`
	TargetCharacteristicId *string `json:"targetCharacteristicId,omitempty"`
	ConceptId              *string `json:"conceptId,omitempty"`
	ColumnName             string  `json:"columnName,omitempty"`
}

type LastValuesResponseElement

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

type PreparedQueriesRequestElement

type PreparedQueriesRequestElement struct {
	QueriesRequestElement
	Token      string `json:"token,omitempty"`
	TimeFormat string `json:"timeFormat,omitempty"`
}

type QueriesRequestElement

type QueriesRequestElement struct {
	ExportId         *string                        `json:"exportId,omitempty"`
	DeviceId         *string                        `json:"deviceId,omitempty"`
	ServiceId        *string                        `json:"serviceId,omitempty"`
	Time             *QueriesRequestElementTime     `json:"time,omitempty"`
	Limit            *int                           `json:"limit,omitempty"`
	Columns          []QueriesRequestElementColumn  `json:"columns,omitempty"`
	Filters          *[]QueriesRequestElementFilter `json:"filters,omitempty"`
	GroupTime        *string                        `json:"groupTime,omitempty"`
	OrderColumnIndex *int                           `json:"orderColumnIndex,omitempty"`
	OrderDirection   *Direction                     `json:"orderDirection,omitempty"`
	DeviceGroupId    *string                        `json:"deviceGroupId,omitempty"`
	LocationId       *string                        `json:"locationId,omitempty"`
}

func (*QueriesRequestElement) Valid

func (element *QueriesRequestElement) Valid() bool

type QueriesRequestElementColumn

type QueriesRequestElementColumn struct {
	Name                   string                           `json:"name,omitempty"`
	GroupType              *string                          `json:"groupType,omitempty"`
	Math                   *string                          `json:"math,omitempty"`
	SourceCharacteristicId *string                          `json:"sourceCharacteristicId,omitempty"`
	TargetCharacteristicId *string                          `json:"targetCharacteristicId,omitempty"`
	ConceptId              *string                          `json:"conceptId,omitempty"`
	Criteria               models.DeviceGroupFilterCriteria `json:"criteria,omitempty"`
}

func (*QueriesRequestElementColumn) Valid

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

type QueriesRequestElementFilter

type QueriesRequestElementFilter struct {
	Column string      `json:"column,omitempty"`
	Math   *string     `json:"math,omitempty"`
	Type   string      `json:"type,omitempty"`
	Value  interface{} `json:"value,omitempty"`
}

func (*QueriesRequestElementFilter) Valid

func (filter *QueriesRequestElementFilter) Valid() bool

type QueriesRequestElementTime

type QueriesRequestElementTime struct {
	Last  *string `json:"last,omitempty"`
	Ahead *string `json:"ahead,omitempty"`
	Start *string `json:"start,omitempty"`
	End   *string `json:"end,omitempty"`
}

func (*QueriesRequestElementTime) Copy added in v0.0.28

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"`
	DeviceId     *string           `json:"deviceId,omitempty"`
	ServiceId    *string           `json:"serviceId,omitempty"`
	ExportId     *string           `json:"exportId,omitempty"`
	ColumnNames  []string          `json:"columnNames,omitempty"`
}

type Usage added in v0.0.9

type Usage struct {
	DeviceId    string    `json:"deviceId,omitempty"`
	ExportId    string    `json:"exportId,omitempty"`
	Bytes       uint64    `json:"bytes"`
	BytesPerDay float64   `json:"bytesPerDay"`
	UpdatedAt   time.Time `json:"updatedAt"`
}

Jump to

Keyboard shortcuts

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