Documentation ¶
Index ¶
- func NewBoltPersist(bucket *bolt.Bucket) mqtt.PersistMethod
- func NewEtcdPersist(client *clientv3.Client) mqtt.PersistMethod
- func NewRedisPersist(conn *redis.Client, mainKey string) mqtt.PersistMethod
- type EtcdPersist
- func (r *EtcdPersist) Delete(key string) error
- func (r *EtcdPersist) Destroy() error
- func (r *EtcdPersist) Load(key string) (mqtt.Packet, bool)
- func (r *EtcdPersist) Name() string
- func (r *EtcdPersist) Range(f func(string, mqtt.Packet) bool)
- func (r *EtcdPersist) Store(key string, p mqtt.Packet) error
- type HttpRouter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewBoltPersist ¶
func NewBoltPersist(bucket *bolt.Bucket) mqtt.PersistMethod
NewBoltPersist creates a new boltPersist for session persist with provided bucket
func NewEtcdPersist ¶
func NewEtcdPersist(client *clientv3.Client) mqtt.PersistMethod
NewEtcdPersist creates a new EtcdPersist for session persist with provided etcd client
func NewRedisPersist ¶
func NewRedisPersist(conn *redis.Client, mainKey string) mqtt.PersistMethod
NewRedisPersist creates a new redisPersist for session persist with provided redis connection and mainKey,
if mainKey is empty here, the default mainKey "libmqtt" will be used if no redis client (nil) provided, will return nil
Types ¶
type EtcdPersist ¶
type EtcdPersist struct { }
func (*EtcdPersist) Delete ¶
func (r *EtcdPersist) Delete(key string) error
func (*EtcdPersist) Destroy ¶
func (r *EtcdPersist) Destroy() error
func (*EtcdPersist) Name ¶
func (r *EtcdPersist) Name() string
Name of redisPersist is "EtcdPersist"
type HttpRouter ¶
type HttpRouter struct { }
HttpRouter is a HTTP URL style router
func (*HttpRouter) Dispatch ¶
func (r *HttpRouter) Dispatch(p *mqtt.PublishPacket)
Dispatch the received packet
func (*HttpRouter) Handle ¶
func (r *HttpRouter) Handle(topic string, h mqtt.TopicHandler)
Handle the topic with TopicHandler h
Click to show internal directories.
Click to hide internal directories.