Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConnectHandler ¶
type ConnectHandler func(mqtt.Client)
type ConnectLostHandler ¶
type ConnectLostHandler func(mqtt.Client, error)
type Context ¶
type Engine ¶
type Engine struct { *Options Topic string TopicLen int Wildcard bool BeforeHook []HookHandler AfterHook []HookHandler // contains filtered or unexported fields }
func (*Engine) Register ¶
func (e *Engine) Register(url string, handler HandlerFunc)
Register 注册方法到前缀树
func (*Engine) UseAfter ¶
func (e *Engine) UseAfter(handler ...HookHandler)
func (*Engine) UseBefore ¶
func (e *Engine) UseBefore(handler ...HookHandler)
type HandlerFunc ¶
type HandlerFunc func(*Context)
type HookHandler ¶
type HookHandler func(*Context)
type MQTT ¶
type MQTT struct { *Options // contains filtered or unexported fields }
func GetConnect ¶
func GetConnect() *MQTT
func InitClient ¶
type Options ¶
type Options struct { Addr string ID string Username string Password string KeepAlive time.Duration SetPingTimeout time.Duration Engine []*Engine ConnectHandler ConnectHandler ConnectLostHandler ConnectLostHandler Logger logger.Interface }
Options 默认配置 本组件放弃维护,建议使用emq5工具包 Deprecated
type PublishHook ¶
type PublishHook func()
Click to show internal directories.
Click to hide internal directories.