优化结构
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user