34 lines
756 B
Go
34 lines
756 B
Go
package types
|
|
|
|
import "time"
|
|
|
|
type MeasuredValue interface {
|
|
GetID() string
|
|
GetMeasuredValueType() MeasuredValueType
|
|
GetValue() float64
|
|
GetFromDate() time.Time
|
|
GetTillDate() time.Time
|
|
GetSensorID() string
|
|
GetCreationDate() *time.Time
|
|
GetUpdateDate() *time.Time
|
|
|
|
SetValue(value float64)
|
|
SetTillDate(date time.Time)
|
|
SetCreationDate(date *time.Time)
|
|
SetUpdateDate(date *time.Time)
|
|
}
|
|
|
|
type MeasuredValueType string
|
|
|
|
const (
|
|
MeasuredValueTypeHumidity MeasuredValueType = "humidity"
|
|
MeasuredValueTypePressure MeasuredValueType = "pressure"
|
|
MeasuredValueTypeTemperature MeasuredValueType = "temperature"
|
|
)
|
|
|
|
var MeasuredValueTypes = []MeasuredValueType{
|
|
MeasuredValueTypeHumidity,
|
|
MeasuredValueTypePressure,
|
|
MeasuredValueTypeTemperature,
|
|
}
|