timeseriesgateway

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DiscreteSensorValue

type DiscreteSensorValue struct {
	// the sensor value
	Value float64

	// the timestamp of the sensor value
	Timestamp time.Time

	// the alias of the sensor value, eg. 1 = ON; 0 = OFF
	Alias string

	// the duration of this sensor value (until the next value)
	LengthInSeconds int64
}

DiscreteSensorValue represents a discrete value

type DiscreteValueQuery

type DiscreteValueQuery struct {
	MachineID string
	SensorID  string
	StartTime time.Time
	EndTime   time.Time
}

type Gateway

type Gateway interface {
	// SensorDiscreteValueQuery returns a slice of Discrete Sensor Values
	SensorDiscreteValueQuery(context.Context, *DiscreteValueQuery) ([]DiscreteSensorValue, error)
	SensorAverageQuery(context.Context, *SensorAverageQuery) ([]SensorAverageResult, error)
}

func NewAdapter

func NewAdapter(client restclient.RestClient, env types.Environment) Gateway

type SensorAverageQuery

type SensorAverageQuery struct {
	MachineID            string
	SensorID             string
	StartTime            time.Time
	EndTime              time.Time
	IncludePreviousValue bool
}

type SensorAverageResult

type SensorAverageResult struct {
	Timestamp time.Time `json:"t"`
	Value     float64   `json:"v"`
}

Jump to

Keyboard shortcuts

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