feat(pkg/db): postgres database

This commit is contained in:
2019-08-20 21:37:45 +02:00
parent c0aa155f36
commit 60ee044b88
53 changed files with 2269 additions and 81 deletions

View File

@ -4,10 +4,10 @@ import "time"
// Device ...
type Device struct {
DeviceID string `json:"device_id" xml:"device_id"`
DeviceName string `json:"device_name" xml:"device_name"`
DeviceLocation *string `json:"device_location" xml:"device_location"`
DeviceLastContact time.Time `json:"device_last_contact" xml:"device_last_contact"`
Logfile string `json:"logfile" xml:"logfile"`
CreationDate time.Time `json:"creation_date" xml:"creation_date"`
DeviceID string `json:"device_id" xml:"device_id"`
DeviceName string `json:"device_name" xml:"device_name"`
DeviceLocation *string `json:"device_location" xml:"device_location"`
DeviceLastContact *time.Time `json:"device_last_contact" xml:"device_last_contact"`
Logfile string `json:"logfile" xml:"logfile"`
CreationDate time.Time `json:"creation_date" xml:"creation_date"`
}

View File

@ -12,7 +12,7 @@ type MeasuredValue struct {
FromDate time.Time `json:"from_date" xml:"from_date"`
TillDate time.Time `json:"till_date" xml:"till_date"`
SensorID string `json:"sensor_id" xml:"sensor_id"`
CreationDate *time.Time `json:"creation_date" xml:"creation_date"`
CreationDate time.Time `json:"creation_date" xml:"creation_date"`
UpdateDate *time.Time `json:"update_date" xml:"update_date"`
}

View File

@ -18,7 +18,7 @@ type Sensor struct {
GPIONumber *GPIO `json:"gpio_number" xml:"gpio_number"`
SensorModel SensorModel `json:"sensor_model" xml:"sensor_model"`
SensorEnabled bool `json:"sensor_enabled" xml:"sensor_enabled"`
SensorLastContact time.Time `json:"sensor_last_contact" xml:"sensor_last_contact"`
SensorLastContact *time.Time `json:"sensor_last_contact" xml:"sensor_last_contact"`
DeviceID string `json:"device_id" xml:"device_id"`
CreationDate time.Time `json:"creation_date" xml:"creation_date"`
}