优化结构

This commit is contained in:
Yvan
2026-08-21 19:11:14 +08:00
parent 690a2d71ca
commit a2ce3ae218
22 changed files with 1292 additions and 734 deletions
+10
View File
@@ -35,6 +35,16 @@ type Client interface {
Close() error
}
// Registry exposes named broker clients while preserving Client as the
// default EMQX/MQTT boundary for existing modules.
type Registry interface {
Client(provider string) Client
PublishTo(context.Context, string, string, []byte, byte, bool) error
SubscribeTo(context.Context, string, string, byte, Handler) error
UnsubscribeFrom(context.Context, string, ...string) error
ConnectedTo(provider string) bool
}
type Config struct {
Enabled bool
Broker string