Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// Broker
BrokerURL string
ClientID string
Username string
Password string
KeepAlive time.Duration
ConnectRetry time.Duration
CleanSession bool
// Behaviour
QoS byte // default 1
BufferSize int // default 512
MaxConcurrency int // default 64, 0 = unlimited
StatusTopic string // default v1/services/{client_id}/status
TLS *TLSConfig
}
type Event ¶
type Event struct {
DeviceID string `json:"device_id"`
Kind string `json:"kind"` // meter.electric | meter.water | status | ...
Value float64 `json:"value,omitempty"`
RoomID string `json:"room_id"`
Unit string `json:"unit,omitempty"`
ReadingAt time.Time `json:"reading_at"`
ReceivedAt time.Time `json:"received_at"`
Seq uint64 `json:"seq,omitempty"`
Raw map[string]any `json:"raw,omitempty"`
Status string `json:"status"` // pending | confirmed | disputed
}
type EventBus ¶
type EventBus struct {
// contains filtered or unexported fields
}
func NewEventBus ¶
type HandlerFunc ¶
type MemoryStore ¶
type MemoryStore struct {
// contains filtered or unexported fields
}
func NewMemoryStore ¶
func NewMemoryStore() *MemoryStore
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.