Documentation ¶
Index ¶
- type HttpRouter
- type RedisPersist
- func (r *RedisPersist) Delete(key string) error
- func (r *RedisPersist) Destroy() error
- func (r *RedisPersist) Load(key string) (lib.Packet, bool)
- func (r *RedisPersist) Name() string
- func (r *RedisPersist) Range(f func(string, lib.Packet) bool)
- func (r *RedisPersist) Store(key string, p lib.Packet) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HttpRouter ¶
type HttpRouter struct { }
HttpRouter is a HTTP URL style router
func (*HttpRouter) Dispatch ¶
func (r *HttpRouter) Dispatch(p *lib.PublishPacket)
Dispatch the received packet
func (*HttpRouter) Handle ¶
func (r *HttpRouter) Handle(topic string, h lib.TopicHandler)
Handle the topic with TopicHandler h
type RedisPersist ¶
type RedisPersist struct {
// contains filtered or unexported fields
}
RedisPersist defines the persist method with redis
func NewRedisPersist ¶
func NewRedisPersist(conn *redis.Client, mainKey string) *RedisPersist
NewRedisPersist will create a new RedisPersist for session persist with provided redis connection and key mainKey, if passed empty mainKey here, the default mainKey "libmqtt" will be used if no redis client (nil) provided, will return nil
func (*RedisPersist) Delete ¶
func (r *RedisPersist) Delete(key string) error
Delete a persisted packet with key
func (*RedisPersist) Load ¶
func (r *RedisPersist) Load(key string) (lib.Packet, bool)
Load a packet from stored data according to the key
func (*RedisPersist) Name ¶
func (r *RedisPersist) Name() string
Name of RedisPersist is "RedisPersist"
Click to show internal directories.
Click to hide internal directories.