Documentation ¶
Index ¶
- Constants
- type Client
- func (c *Client) Close() error
- func (c *Client) GetID() string
- func (c *Client) GetSession() broker.Session
- func (c *Client) GetTopicAlias(u uint16) string
- func (c *Client) HandlePubAck(pubAck *packets.Puback)
- func (c *Client) HandlePubComp(pubRel *packets.Pubcomp)
- func (c *Client) HandlePubRec(pubRec *packets.Pubrec)
- func (c *Client) HandleSub(subscribe *packets.Subscribe) map[string]byte
- func (c *Client) HandleUnSub(topicName string)
- func (c *Client) IsState(state uint64) bool
- func (c *Client) MetaString() string
- func (c *Client) Publish(topic string, message *packet.PublishMessage) error
- func (c *Client) RemState(state uint64)
- func (c *Client) Run(ctx context.Context, handler Handler)
- func (c *Client) SetConnectProperties(properties *broker.SessionConnectProperties)
- func (c *Client) SetID(id string)
- func (c *Client) SetMeta(session broker.Session, keepAlive time.Duration) error
- func (c *Client) SetState(state uint64)
- func (c *Client) SetTopicAlias(topic string, alias uint16)
- func (c *Client) SetWill(message *broker.WillMessage) error
- func (c *Client) Write(data []byte) error
- func (c *Client) WritePacket(packet packets.Packet)
- type Config
- type HandleQoS2
- type Handler
- type Meta
- type NotifyClientClose
- type Option
- type Options
- type PacketIDFactory
- type Property
- type QoS2Message
- type WillProperty
Constants ¶
View Source
const (
ReceivedConnect = uint64(1 << iota)
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { ID string `json:"id"` QoS2 *HandleQoS2 // contains filtered or unexported fields }
func (*Client) GetSession ¶
func (*Client) GetTopicAlias ¶
func (*Client) HandlePubAck ¶
func (*Client) HandlePubComp ¶
func (*Client) HandlePubRec ¶
func (*Client) HandleUnSub ¶
func (*Client) MetaString ¶
func (*Client) Publish ¶
func (c *Client) Publish(topic string, message *packet.PublishMessage) error
func (*Client) SetConnectProperties ¶
func (c *Client) SetConnectProperties(properties *broker.SessionConnectProperties)
func (*Client) SetTopicAlias ¶
func (*Client) WritePacket ¶
type HandleQoS2 ¶
type HandleQoS2 struct {
// contains filtered or unexported fields
}
func NewHandleQoS2 ¶
func NewHandleQoS2() *HandleQoS2
func (*HandleQoS2) HandlePubRel ¶
func (*HandleQoS2) HandlePublish ¶
func (w *HandleQoS2) HandlePublish(publish *packets.Publish) bool
type Handler ¶
type Handler interface {
HandlePacket(*Client, *packets.ControlPacket)
}
type NotifyClientClose ¶
type NotifyClientClose interface { NotifyClientClose(c *Client) NotifyWillMessage(message *broker.WillMessage) }
type Option ¶
type Option func(*Options)
func WithConfig ¶
func WithNotifyClose ¶
func WithNotifyClose(notifyClose NotifyClientClose) Option
func WithStore ¶
func WithStore(store broker.TopicMessageStore) Option
type Options ¶
type Options struct { Store broker.TopicMessageStore // contains filtered or unexported fields }
type PacketIDFactory ¶
type PacketIDFactory interface {
Generate() uint16
}
type QoS2Message ¶
type QoS2Message struct {
// contains filtered or unexported fields
}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.