2019-06-25 20:22:34 +00:00
|
|
|
package types
|
|
|
|
|
2019-06-26 21:36:01 +00:00
|
|
|
import "time"
|
|
|
|
|
2019-06-25 20:22:34 +00:00
|
|
|
type MeasuredValue interface {
|
|
|
|
GetID() string
|
2019-06-27 16:44:26 +00:00
|
|
|
GetMeasuredValueType() MeasuredValueType
|
2019-06-28 11:04:04 +00:00
|
|
|
GetValue() float64
|
2019-06-27 16:44:26 +00:00
|
|
|
GetFromDate() time.Time
|
|
|
|
GetTillDate() time.Time
|
2019-06-25 20:22:34 +00:00
|
|
|
GetSensorID() string
|
2019-06-28 11:04:04 +00:00
|
|
|
GetCreationDate() *time.Time
|
|
|
|
GetUpdateDate() *time.Time
|
|
|
|
|
2019-06-30 12:34:13 +00:00
|
|
|
SetValue(value float64)
|
2019-06-26 21:36:01 +00:00
|
|
|
SetTillDate(date time.Time)
|
2019-06-28 11:04:04 +00:00
|
|
|
SetCreationDate(date *time.Time)
|
2019-06-26 21:36:01 +00:00
|
|
|
SetUpdateDate(date *time.Time)
|
2019-06-25 20:22:34 +00:00
|
|
|
}
|
2019-06-27 16:44:26 +00:00
|
|
|
|
|
|
|
type MeasuredValueType string
|
|
|
|
|
|
|
|
const (
|
|
|
|
MeasuredValueTypeHumidity MeasuredValueType = "humidity"
|
2019-06-30 13:06:23 +00:00
|
|
|
MeasuredValueTypePressure MeasuredValueType = "pressure"
|
2019-06-27 16:44:26 +00:00
|
|
|
MeasuredValueTypeTemperature MeasuredValueType = "temperature"
|
|
|
|
)
|
|
|
|
|
|
|
|
var MeasuredValueTypes = []MeasuredValueType{
|
|
|
|
MeasuredValueTypeHumidity,
|
2019-06-30 13:06:23 +00:00
|
|
|
MeasuredValueTypePressure,
|
2019-06-27 16:44:26 +00:00
|
|
|
MeasuredValueTypeTemperature,
|
|
|
|
}
|