feat: монолит iot-service (Фаза 1) — config/store/api/bridge/consumer без k8s, устройства в PG, новые Dockerfile/Makefile
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
// Package store — хранилище устройств IoT в PostgreSQL.
|
||||
//
|
||||
// Таблица iot_devices заменяет CRD IoTDevice и k8s Secrets старого IoT.
|
||||
// Устройства: namespace, name, device_id, enabled, mqtt_password, metadata.
|
||||
package store
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"time"
|
||||
)
|
||||
|
||||
// ErrNotFound — устройство не найдено.
|
||||
var ErrNotFound = errors.New("device not found")
|
||||
|
||||
// ErrAlreadyExists — конфликт уникальности (namespace, name) или (namespace, device_id).
|
||||
var ErrAlreadyExists = errors.New("device already exists")
|
||||
|
||||
// Device — устройство IoT из таблицы iot_devices.
|
||||
type Device struct {
|
||||
Namespace string
|
||||
Name string
|
||||
DeviceID string
|
||||
Enabled bool
|
||||
MQTTPassword string
|
||||
Metadata map[string]string
|
||||
Phase string
|
||||
LastConnected *time.Time
|
||||
CreatedAt time.Time
|
||||
}
|
||||
Reference in New Issue
Block a user