mqtt
This commit is contained in:
@@ -97,13 +97,29 @@ type MediaConfig struct {
|
||||
// EventLoggerConfig holds event logging configuration
|
||||
type EventLoggerConfig struct {
|
||||
Enabled bool `json:"enabled"`
|
||||
Targets []string `json:"targets"` // "file", "sqlite", "postgres"
|
||||
Targets []string `json:"targets"` // "file", "sqlite", "postgres", "mqtt"
|
||||
|
||||
// File-based logging
|
||||
FileDir string `json:"file_dir,omitempty"` // Base directory for event files
|
||||
|
||||
// Database logging (uses main Database config for connection)
|
||||
TableName string `json:"table_name,omitempty"` // Table name for event logs (default: "event_logs")
|
||||
|
||||
// MQTT logging
|
||||
MQTT MQTTConfig `json:"mqtt,omitempty"` // MQTT broker configuration
|
||||
}
|
||||
|
||||
// MQTTConfig holds MQTT broker configuration
|
||||
type MQTTConfig struct {
|
||||
Broker string `json:"broker"` // MQTT broker URL (e.g., "tcp://localhost:1883")
|
||||
ClientID string `json:"client_id,omitempty"` // Client ID (auto-generated if empty)
|
||||
Username string `json:"username,omitempty"` // Username for authentication
|
||||
Password string `json:"password,omitempty"` // Password for authentication
|
||||
TopicPrefix string `json:"topic_prefix,omitempty"` // Topic prefix (default: "whatshooked")
|
||||
QoS int `json:"qos,omitempty"` // Quality of Service (0, 1, or 2; default: 1)
|
||||
Retained bool `json:"retained,omitempty"` // Retain messages on broker
|
||||
Events []string `json:"events,omitempty"` // Events to publish (empty = all events)
|
||||
Subscribe bool `json:"subscribe,omitempty"` // Enable subscription for sending messages
|
||||
}
|
||||
|
||||
// Load reads configuration from a file
|
||||
|
||||
Reference in New Issue
Block a user