Documentation ¶
Index ¶
- func HandleConnection(conn *ConBroker)
- type Broker
- type ConBroker
- func (slf *ConBroker) Close() error
- func (slf *ConBroker) Debug(fmt string, args ...interface{})
- func (slf *ConBroker) Error(fmt string, args ...interface{})
- func (slf *ConBroker) GetAddr() string
- func (slf *ConBroker) GetID() int64
- func (slf *ConBroker) GetSession() *sessions.Session
- func (slf *ConBroker) Info(fmt string, args ...interface{})
- func (slf *ConBroker) Kicker()
- func (slf *ConBroker) ParseMessage() (message.Message, error)
- func (slf *ConBroker) Ping()
- func (slf *ConBroker) SendPublishMessage(msg *message.Publish)
- func (slf *ConBroker) Terminate()
- func (slf *ConBroker) Warning(fmt string, args ...interface{})
- func (slf *ConBroker) Will()
- func (slf *ConBroker) WithAddr(remote string)
- func (slf *ConBroker) WithConn(conn io.ReadWriteCloser)
- func (slf *ConBroker) WithID(id int64)
- func (slf *ConBroker) WithSession(session *sessions.Session)
- func (slf *ConBroker) WriteMessage(msg message.Message) error
- type TCPBroker
- func (slf *TCPBroker) Debug(fmt string, args ...interface{})
- func (slf *TCPBroker) Error(fmt string, args ...interface{})
- func (slf *TCPBroker) Info(fmt string, args ...interface{})
- func (slf *TCPBroker) ListenAndServe(address string) error
- func (slf *TCPBroker) Listener() network.IListener
- func (slf *TCPBroker) Serve() error
- func (slf *TCPBroker) Shutdown()
- func (slf *TCPBroker) Warning(fmt string, args ...interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Broker ¶
type Broker interface { ListenAndServe(string) error Listener() network.IListener Serve() error Shutdown() }
Broker mqtt服务主框架
type ConBroker ¶
type ConBroker struct {
// contains filtered or unexported fields
}
ConBroker 连接器
func (*ConBroker) GetSession ¶
GetSession 返回关联的session对象
func (*ConBroker) ParseMessage ¶
ParseMessage 解析消息
func (*ConBroker) SendPublishMessage ¶
SendPublishMessage 发送publish消息
func (*ConBroker) WithConn ¶
func (slf *ConBroker) WithConn(conn io.ReadWriteCloser)
WithConn 设置连接器关键通信句柄
func (*ConBroker) WithSession ¶
WithSession 设置session对象
type TCPBroker ¶
type TCPBroker struct {
// contains filtered or unexported fields
}
TCPBroker mqtt tcp 服务
func (*TCPBroker) ListenAndServe ¶
ListenAndServe 启动监听并启动服务
Click to show internal directories.
Click to hide internal directories.