views

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2022 License: Apache-2.0 Imports: 6 Imported by: 2

Documentation

Overview

Package views define views for Clarify resources.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DataFrame

type DataFrame map[string]DataSeries

DataFrame provides JSON encoding and decoding for a map of series identified by an arbitrary key.

func (DataFrame) MarshalJSON

func (df DataFrame) MarshalJSON() ([]byte, error)

func (*DataFrame) UnmarshalJSON

func (df *DataFrame) UnmarshalJSON(b []byte) error

type DataSeries

type DataSeries map[fields.Timestamp]float64

DataSeries contain a map of timestamps in micro seconds since the epoch to a floating point value.

type Item

Item describe the select view for an item.

type ItemAttributes

type ItemAttributes struct {
	ItemSaveAttributes
}

ItemAttributes contains attributes for the item select view.

type ItemInclude

type ItemInclude struct{}

type ItemRelationships

type ItemRelationships struct{}

ItemRelationships describe the item relationships that's exposed by the API.

type ItemSave

type ItemSave struct {
	ItemSaveAttributes
	resource.MetaSave
}

ItemSave describe the save view for an item.

func PublishedItem

func PublishedItem(signal Signal, transforms ...func(dest *ItemSave)) ItemSave

PublishedItem constructs a view for an item based on the passed in signal, including a set of base annotations referring the item back to the signal it was generated from. The passed in transforms, if any, are run in order.

type ItemSaveAttributes

type ItemSaveAttributes struct {
	Name           string               `json:"name"`
	Description    string               `json:"description"`
	ValueType      ValueType            `json:"valueType"`
	SourceType     SourceType           `json:"sourceType"`
	EngUnit        string               `json:"engUnit"`
	SampleInterval fields.FixedDuration `json:"sampleInterval"`
	GapDetection   fields.FixedDuration `json:"gapDetection"`
	Labels         fields.Labels        `json:"labels"`
	EnumValues     fields.EnumValues    `json:"enumValues"`
	Visible        bool                 `json:"visible"`
}

ItemSaveAttributes contains attributes that are part of the item save view.

type Signal

Signal describe the select view for a signal.

type SignalAttributes

type SignalAttributes struct {
	SignalSaveAttributes
	SignalReadOnlyAttributes
}

SignalAttributes contains attributes for the signal select view.

type SignalInclude

type SignalInclude struct {
	Items []Item `json:"items"`
}

type SignalReadOnlyAttributes

type SignalReadOnlyAttributes struct {
	Input string `json:"input"`
}

SignalReadOnlyAttributes contains read-only signal attributes.

type SignalRelationships

type SignalRelationships struct {
	Integration resource.ToOne `json:"integration"`
	Item        resource.ToOne `json:"item"`
}

SignalRelationships declare the available relationships for the signal model.

type SignalSave

type SignalSave struct {
	resource.MetaSave
	SignalSaveAttributes
}

SignalSave describe the save view for a signal.

type SignalSaveAttributes

type SignalSaveAttributes struct {
	Name           string               `json:"name"`
	Description    string               `json:"description"`
	ValueType      ValueType            `json:"valueType"`
	SourceType     SourceType           `json:"sourceType"`
	EngUnit        string               `json:"engUnit"`
	SampleInterval fields.FixedDuration `json:"sampleInterval"`
	GapDetection   fields.FixedDuration `json:"gapDetection"`
	Labels         fields.Labels        `json:"labels"`
	EnumValues     fields.EnumValues    `json:"enumValues"`
}

SignalSaveAttributes contains attributes that are part of the signal save view.

type SourceType

type SourceType string

SourceType describe how data values where produced.

const (
	// Measurement indicates that values are retrieved "directly" from a sensor.
	Measurement SourceType = "measurement"

	// Aggregation indicates that values are aggregated from one or more
	// sources.
	Aggregation SourceType = "aggregation"

	// Prediction indicates that values are predictions or forecasts.
	Prediction SourceType = "prediction"
)

Allowed signal/item source types.

type ValueType

type ValueType string

ValueType determine how data values should be interpreted.

const (
	// Numeric indicates that values should be treated as decimal numbers.
	Numeric ValueType = "numeric"

	// Enum indicates that values should be treated as integer indices to a map
	// of enumerated values.
	Enum ValueType = "enum"
)

Allowed signal/items types.

Jump to

Keyboard shortcuts

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