Documentation
¶
Index ¶
- Variables
- func ExceededConnectionRateLimit() bool
- func GetServerName() string
- func ServerBeingShutDown() bool
- func ServiceBusy() bool
- func SetExceededConnectionRateLimit(ecrl bool)
- func SetServerBeingShutDown(sbsd bool)
- func SetServiceBusy(sb bool)
- func SetUnsupportedRetention(ur bool)
- func SetUnsupportedSharedSubscriptions(uss bool)
- func SetUnsupportedSubscriptionIdentifiers(sui bool)
- func SetUnsupportedWildcardSubscriptions(uws bool)
- func UnsupportedRetention() bool
- func UnsupportedSharedSubscriptions() bool
- func UnsupportedSubscriptionIdentifiers() bool
- func UnsupportedWildcardSubscriptions() bool
- type GCore
- type OnCompleteFunc
- type OnPublishFunc
- type Server
- type Sign
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidConnectionType error = errors.New("service: Invalid connection type") ErrInvalidSubscriber error = errors.New("service: Invalid subscriber") ErrBufferNotReady error = errors.New("service: buffer is not ready") ErrBufferInsufficientData error = errors.New("service: buffer has insufficient data.") //缓冲区数据不足。 )
Functions ¶
func ExceededConnectionRateLimit ¶
func ExceededConnectionRateLimit() bool
ExceededConnectionRateLimit 超出连接速率限制 CONNACK, DISCONNECT
func GetServerName ¶
func GetServerName() string
func SetExceededConnectionRateLimit ¶
func SetExceededConnectionRateLimit(ecrl bool)
func SetServerBeingShutDown ¶
func SetServerBeingShutDown(sbsd bool)
func SetServiceBusy ¶
func SetServiceBusy(sb bool)
func SetUnsupportedRetention ¶
func SetUnsupportedRetention(ur bool)
func SetUnsupportedSharedSubscriptions ¶
func SetUnsupportedSharedSubscriptions(uss bool)
func SetUnsupportedSubscriptionIdentifiers ¶
func SetUnsupportedSubscriptionIdentifiers(sui bool)
func SetUnsupportedWildcardSubscriptions ¶
func SetUnsupportedWildcardSubscriptions(uws bool)
func UnsupportedRetention ¶
func UnsupportedRetention() bool
UnsupportedRetention 不支持保留 CONNACK, DISCONNECT
func UnsupportedSharedSubscriptions ¶
func UnsupportedSharedSubscriptions() bool
UnsupportedSharedSubscriptions 不支持共享订阅 SUBACK, DISCONNECT
func UnsupportedSubscriptionIdentifiers ¶
func UnsupportedSubscriptionIdentifiers() bool
UnsupportedSubscriptionIdentifiers 不支持订阅标识符 SUBACK, DISCONNECT
func UnsupportedWildcardSubscriptions ¶
func UnsupportedWildcardSubscriptions() bool
UnsupportedWildcardSubscriptions 不支持通配符订阅 SUBACK, DISCONNECT
Types ¶
type OnCompleteFunc ¶
OnCompleteFunc 完成的回调方法
type OnPublishFunc ¶
type OnPublishFunc func(msg *message.PublishMessage, sub topic.Sub, sender string, shareMsg bool) error
OnPublishFunc 发布的func类型 sender表示当前发送消息的客户端是哪个,shareMsg=true表示是共享消息,不能被Local 操作
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) ListenAndServe ¶
ListenAndServe 监听请求的URI上的连接,并处理任何连接 传入的MQTT客户机会话。 在调用Close()之前,它不应该返回 或者有一些关键的错误导致服务器停止运行。 URI 提供的格式应该是“protocol://host:port”,可以通过它进行解析 url.Parse ()。 例如,URI可以是“tcp://0.0.0.0:1883”。
type Sign ¶
type Sign struct {
// contains filtered or unexported fields
}
Sign 用于三个处理协程的通讯
func (*Sign) AddQuota ¶
func (s *Sign) AddQuota()
AddQuota 新增一个配额 1. 每当收到一个PUBACK报文或PUBCOMP报文,不管PUBACK或PUBCOMP报文是否包含错误码。 2. 每次收到一个包含返回码大于等于0x80的PUBREC报文。 在初始发送配额之上尝试增加配额可能是由建立新的网络连接后重新发送PUBREL数据包引起的。
func (*Sign) BeyondQuota ¶
BeyondQuota 超过配额信号 CONNACK, PUBACK, PUBREC, SUBACK, DISCONNECT
func (*Sign) TooManyMessages ¶
TooManyMessages 消息太过频繁 DISCONNECT