Documentation
¶
Index ¶
- type Client
- func (c *Client) Publish(topic string, m *sjson.Json) error
- func (c *Client) SetOnMsgRecv(handler OnClientMsgRecv) *Client
- func (c *Client) SetTLS(key, cert, ca []byte) *Client
- func (c *Client) Start() error
- func (c *Client) Stop()
- func (c *Client) Subscribe(topics []string) error
- func (c *Client) Unsubscribe(topics []string) error
- type MatchTopicFunc
- type OnClientMsgRecv
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
OnClientMsgRecv OnClientMsgRecv
// contains filtered or unexported fields
}
Client 客户端
func (*Client) SetOnMsgRecv ¶
func (c *Client) SetOnMsgRecv(handler OnClientMsgRecv) *Client
func (*Client) Unsubscribe ¶
Unsubscribe 客户端取消订阅主题
type MatchTopicFunc ¶
type OnClientMsgRecv ¶
type Server ¶
type Server struct {
MatchTopicFunc MatchTopicFunc
// contains filtered or unexported fields
}
Server 服务端
func (*Server) SetCluster ¶
func (*Server) SetMatchTopicFunc ¶
func (s *Server) SetMatchTopicFunc(match MatchTopicFunc) *Server
Click to show internal directories.
Click to hide internal directories.