refac(pkg/sensor): temperature measurement unit

This commit is contained in:
2019-06-23 14:17:57 +02:00
parent 3bb10a4f78
commit 5e03d987c5
19 changed files with 91 additions and 76 deletions

View File

@ -6,26 +6,26 @@ import (
// Temperature ...
type Temperature struct {
TemperatureID string `json:"temperature_id" xml:"temperature_id"`
TemperatureValue float64 `json:"temperature_value,string" xml:"temperature_value,string"`
TemperatureDegree Degree `json:"temperature_degree" xml:"temperature_degree"`
TemperatureFromDate time.Time `json:"temperature_from_date" xml:"temperature_from_date"`
TemperatureTillDate time.Time `json:"temperature_till_date" xml:"temperature_till_date"`
SensorID string `json:"sensor_id" xml:"sensor_id"`
CreationDate *time.Time `json:"creation_date" xml:"creation_date"`
UpdateDate *time.Time `json:"update_date" xml:"update_date"`
TemperatureID string `json:"temperature_id" xml:"temperature_id"`
TemperatureValue float64 `json:"temperature_value,string" xml:"temperature_value,string"`
TemperatureUnit TemperatureUnit `json:"temperature_unit" xml:"temperature_unit"`
TemperatureFromDate time.Time `json:"temperature_from_date" xml:"temperature_from_date"`
TemperatureTillDate time.Time `json:"temperature_till_date" xml:"temperature_till_date"`
SensorID string `json:"sensor_id" xml:"sensor_id"`
CreationDate *time.Time `json:"creation_date" xml:"creation_date"`
UpdateDate *time.Time `json:"update_date" xml:"update_date"`
}
// Degree unit of measurement for temperature
type Degree string
// TemperatureUnit of measurement for temperature
type TemperatureUnit string
const (
// DegreeCelsius indicates the temperature in Celsius
DegreeCelsius Degree = "celsius"
// TemperatureUnitCelsius indicates the temperature in Celsius
TemperatureUnitCelsius TemperatureUnit = "celsius"
// DegreeFahrenheit indicates the temperature in Fahrenheit
DegreeFahrenheit = "fahrenheit"
// TemperatureUnitFahrenheit indicates the temperature in Fahrenheit
TemperatureUnitFahrenheit = "fahrenheit"
// DegreeKelvin indicates the temperature in Kelvin
DegreeKelvin = "kelvin"
// TemperatureUnitKelvin indicates the temperature in Kelvin
TemperatureUnitKelvin = "kelvin"
)