beeq

package module
v0.0.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 17, 2020 License: GPL-3.0 Imports: 11 Imported by: 0

README

beeq

Embed MQTT server, MQTT服务器,主要作为库使用

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MatchSubscribe

func MatchSubscribe(topic []byte, sub []byte) bool

func ValidSubscribe

func ValidSubscribe(topic []byte) error

func ValidTopic

func ValidTopic(topic []byte) error

Types

type Bee

type Bee struct {
	// contains filtered or unexported fields
}

func NewBee

func NewBee(conn net.Conn) *Bee

func (*Bee) ClientId added in v0.0.3

func (b *Bee) ClientId() string

func (*Bee) Close added in v0.0.2

func (b *Bee) Close() error

func (*Bee) Disconnect added in v0.0.2

func (b *Bee) Disconnect() error

type Hive

type Hive struct {
	// contains filtered or unexported fields
}

func NewHive

func NewHive() *Hive

TODO 添加参数

func (*Hive) ListenAndServe

func (h *Hive) ListenAndServe(addr string) error

func (*Hive) OnConnect

func (h *Hive) OnConnect(fn func(*packet.Connect, *Bee) bool)

func (*Hive) OnDisconnect

func (h *Hive) OnDisconnect(fn func(*packet.DisConnect, *Bee))

func (*Hive) OnPublish

func (h *Hive) OnPublish(fn func(*packet.Publish, *Bee) bool)

func (*Hive) OnSubscribe

func (h *Hive) OnSubscribe(fn func(*packet.Subscribe, *Bee) bool)

func (*Hive) OnUnSubscribe

func (h *Hive) OnUnSubscribe(fn func(*packet.UnSubscribe, *Bee))

func (*Hive) Publish added in v0.0.6

func (h *Hive) Publish(pub *packet.Publish)

func (*Hive) Receive

func (h *Hive) Receive(conn net.Conn)

func (*Hive) Receive2 added in v0.0.4

func (h *Hive) Receive2(conn net.Conn)

func (*Hive) Serve

func (h *Hive) Serve(ln net.Listener)

func (*Hive) Subscribe added in v0.0.6

func (h *Hive) Subscribe(topic string, callback SubscribeCallback)

type RetainNode

type RetainNode struct {
	// contains filtered or unexported fields
}

func (*RetainNode) Fetch

func (rn *RetainNode) Fetch(topics []string, cb func(clientId string, pub *packet.Publish))

func (*RetainNode) Retain

func (rn *RetainNode) Retain(topics []string, clientId string, pub *packet.Publish) *RetainNode

type RetainTree

type RetainTree struct {
	// contains filtered or unexported fields
}

func (*RetainTree) Fetch

func (rt *RetainTree) Fetch(topic []byte, cb func(clientId string, pub *packet.Publish))

func (*RetainTree) Retain

func (rt *RetainTree) Retain(topic []byte, clientId string, pub *packet.Publish)

func (*RetainTree) UnRetain

func (rt *RetainTree) UnRetain(clientId string)

type SubNode

type SubNode struct {
	// contains filtered or unexported fields
}

func (*SubNode) Callback added in v0.0.6

func (sn *SubNode) Callback(topics []string, pub *packet.Publish)

func (*SubNode) ClearClient

func (sn *SubNode) ClearClient(clientId string)

func (*SubNode) Publish

func (sn *SubNode) Publish(topics []string, subs map[string]packet.MsgQos)

func (*SubNode) Subscribe

func (sn *SubNode) Subscribe(topics []string, clientId string, qos packet.MsgQos)

func (*SubNode) SubscribeCallback added in v0.0.6

func (sn *SubNode) SubscribeCallback(topics []string, callback SubscribeCallback)

func (*SubNode) UnSubscribe

func (sn *SubNode) UnSubscribe(topics []string, clientId string)

type SubTree

type SubTree struct {
	// contains filtered or unexported fields
}

func (*SubTree) Callback added in v0.0.6

func (st *SubTree) Callback(pub *packet.Publish)

func (*SubTree) ClearClient

func (st *SubTree) ClearClient(clientId string)

func (*SubTree) Publish

func (st *SubTree) Publish(topic []byte, subs map[string]packet.MsgQos)

func (*SubTree) Subscribe

func (st *SubTree) Subscribe(topic []byte, clientId string, qos packet.MsgQos)

func (*SubTree) SubscribeCallback added in v0.0.6

func (st *SubTree) SubscribeCallback(topic []byte, callback SubscribeCallback)

func (*SubTree) UnSubscribe

func (st *SubTree) UnSubscribe(topic []byte, clientId string)

type SubscribeCallback added in v0.0.6

type SubscribeCallback func(pub *packet.Publish)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL