PKGBUILD/pkg/types/temperature.go

32 lines
1.2 KiB
Go

package types
import (
"time"
)
// Temperature ...
type Temperature struct {
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"`
}
// TemperatureUnit of measurement for temperature
type TemperatureUnit string
const (
// TemperatureUnitCelsius indicates the temperature in Celsius
TemperatureUnitCelsius TemperatureUnit = "celsius"
// TemperatureUnitFahrenheit indicates the temperature in Fahrenheit
TemperatureUnitFahrenheit = "fahrenheit"
// TemperatureUnitKelvin indicates the temperature in Kelvin
TemperatureUnitKelvin = "kelvin"
)