feat: монолит iot-service (Фаза 1) — config/store/api/bridge/consumer без k8s, устройства в PG, новые Dockerfile/Makefile

This commit is contained in:
“Naeel”
2026-08-16 10:07:51 +04:00
parent f0c36a11ee
commit 9d08473d5f
27 changed files with 3716 additions and 0 deletions
+29
View File
@@ -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
}