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-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"
|
|
|
|
MeasuredValueTypeTemperature MeasuredValueType = "temperature"
|
|
|
|
)
|
|
|
|
|
|
|
|
var MeasuredValueTypes = []MeasuredValueType{
|
|
|
|
MeasuredValueTypeHumidity,
|
|
|
|
MeasuredValueTypeTemperature,
|
|
|
|
}
|