Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Bus ¶
type Bus struct {
// contains filtered or unexported fields
}
Bus 事件总线
func NewNatsBus ¶
NewNatsBus 使用nats构造事件总线
func NewRedisBus ¶
NewRedisBus 构造函数
type Options ¶
type Options struct { // ChannelName 通道名称,默认为nodehub:events // // 不同的总线实现内有不同的含义,在nats里面是topic,redis里面是channel ChannelName string }
Options 配置
type UserConnected ¶
type UserConnected struct { GatewayID string `json:"gatewayID"` UserID string `json:"userID"` RemoteAddr string `json:"remoteAddr"` }
UserConnected 用户连接事件
type UserDisconnected ¶
type UserDisconnected struct { GatewayID string `json:"gatewayID"` UserID string `json:"userID"` RemoteAddr string `json:"remoteAddr"` }
UserDisconnected 用户断开连接事件
Click to show internal directories.
Click to hide internal directories.