Documentation ¶
Index ¶
- type BroadcastArgs
- type DeliverArgs
- type DisconnectArgs
- type GateLinker
- func (l *GateLinker) Ask(ctx context.Context, gid string, uid int64) (string, bool, error)
- func (l *GateLinker) Bind(ctx context.Context, gid string, cid, uid int64) error
- func (l *GateLinker) Broadcast(ctx context.Context, args *BroadcastArgs) error
- func (l *GateLinker) Disconnect(ctx context.Context, args *DisconnectArgs) error
- func (l *GateLinker) FetchGateList(ctx context.Context, states ...cluster.State) ([]*registry.ServiceInstance, error)
- func (l *GateLinker) GetIP(ctx context.Context, args *GetIPArgs) (string, error)
- func (l *GateLinker) GetState(ctx context.Context, gid string) (cluster.State, error)
- func (l *GateLinker) Has(gid string) bool
- func (l *GateLinker) IsOnline(ctx context.Context, args *IsOnlineArgs) (bool, error)
- func (l *GateLinker) Locate(ctx context.Context, uid int64) (string, error)
- func (l *GateLinker) Multicast(ctx context.Context, args *MulticastArgs) error
- func (l *GateLinker) PackBuffer(message interface{}, encrypt bool) ([]byte, error)
- func (l *GateLinker) PackMessage(message *Message, encrypt bool) (buffer.Buffer, error)
- func (l *GateLinker) Push(ctx context.Context, args *PushArgs) error
- func (l *GateLinker) SetState(ctx context.Context, gid string, state cluster.State) error
- func (l *GateLinker) Stat(ctx context.Context, kind session.Kind) (int64, error)
- func (l *GateLinker) Unbind(ctx context.Context, uid int64) error
- func (l *GateLinker) WatchClusterInstance()
- func (l *GateLinker) WatchUserLocate()
- type GetIPArgs
- type IsOnlineArgs
- type Message
- type MulticastArgs
- type NodeLinker
- func (l *NodeLinker) Ask(ctx context.Context, uid int64, name, nid string) (string, bool, error)
- func (l *NodeLinker) Bind(ctx context.Context, uid int64, name, nid string) error
- func (l *NodeLinker) Deliver(ctx context.Context, args *DeliverArgs) error
- func (l *NodeLinker) FetchNodeList(ctx context.Context, states ...cluster.State) ([]*registry.ServiceInstance, error)
- func (l *NodeLinker) GetState(ctx context.Context, nid string) (cluster.State, error)
- func (l *NodeLinker) Has(nid string) bool
- func (l *NodeLinker) Locate(ctx context.Context, uid int64, name string) (string, error)
- func (l *NodeLinker) SetState(ctx context.Context, nid string, state cluster.State) error
- func (l *NodeLinker) Trigger(ctx context.Context, args *TriggerArgs) error
- func (l *NodeLinker) Unbind(ctx context.Context, uid int64, name, nid string) error
- func (l *NodeLinker) WatchClusterInstance()
- func (l *NodeLinker) WatchUserLocate()
- type Options
- type PushArgs
- type TriggerArgs
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BroadcastArgs ¶
type BroadcastArgs = cluster.BroadcastArgs
type DeliverArgs ¶
type DisconnectArgs ¶
type DisconnectArgs = cluster.DisconnectArgs
type GateLinker ¶ added in v2.1.0
type GateLinker struct {
// contains filtered or unexported fields
}
func NewGateLinker ¶ added in v2.1.0
func NewGateLinker(ctx context.Context, opts *Options) *GateLinker
func (*GateLinker) Broadcast ¶ added in v2.1.0
func (l *GateLinker) Broadcast(ctx context.Context, args *BroadcastArgs) error
Broadcast 推送广播消息
func (*GateLinker) Disconnect ¶ added in v2.1.0
func (l *GateLinker) Disconnect(ctx context.Context, args *DisconnectArgs) error
Disconnect 断开连接
func (*GateLinker) FetchGateList ¶ added in v2.1.0
func (l *GateLinker) FetchGateList(ctx context.Context, states ...cluster.State) ([]*registry.ServiceInstance, error)
FetchGateList 拉取网关列表
func (*GateLinker) IsOnline ¶ added in v2.1.0
func (l *GateLinker) IsOnline(ctx context.Context, args *IsOnlineArgs) (bool, error)
IsOnline 检测是否在线
func (*GateLinker) Multicast ¶ added in v2.1.0
func (l *GateLinker) Multicast(ctx context.Context, args *MulticastArgs) error
Multicast 推送组播消息
func (*GateLinker) PackBuffer ¶ added in v2.2.0
func (l *GateLinker) PackBuffer(message interface{}, encrypt bool) ([]byte, error)
PackBuffer 消息转buffer
func (*GateLinker) PackMessage ¶ added in v2.2.0
PackMessage 打包消息
func (*GateLinker) Push ¶ added in v2.1.0
func (l *GateLinker) Push(ctx context.Context, args *PushArgs) error
Push 推送消息
func (*GateLinker) Unbind ¶ added in v2.1.0
func (l *GateLinker) Unbind(ctx context.Context, uid int64) error
Unbind 解绑网关
func (*GateLinker) WatchClusterInstance ¶ added in v2.1.0
func (l *GateLinker) WatchClusterInstance()
WatchClusterInstance 监听集群实例
func (*GateLinker) WatchUserLocate ¶ added in v2.1.0
func (l *GateLinker) WatchUserLocate()
WatchUserLocate 监听用户定位
type IsOnlineArgs ¶ added in v2.1.0
type IsOnlineArgs = cluster.IsOnlineArgs
type MulticastArgs ¶
type MulticastArgs = cluster.MulticastArgs
type NodeLinker ¶ added in v2.1.0
type NodeLinker struct {
// contains filtered or unexported fields
}
func NewNodeLinker ¶ added in v2.1.0
func NewNodeLinker(ctx context.Context, opts *Options) *NodeLinker
func (*NodeLinker) Bind ¶ added in v2.1.0
Bind 绑定节点 单个用户可以绑定到多个节点服务器上,相同名称的节点服务器只能绑定一个,多次绑定会到相同名称的节点服务器会覆盖之前的绑定。 绑定操作会通过发布订阅方式同步到网关服务器和其他相关节点服务器上。
func (*NodeLinker) Deliver ¶ added in v2.1.0
func (l *NodeLinker) Deliver(ctx context.Context, args *DeliverArgs) error
Deliver 投递消息给节点处理
func (*NodeLinker) FetchNodeList ¶ added in v2.1.0
func (l *NodeLinker) FetchNodeList(ctx context.Context, states ...cluster.State) ([]*registry.ServiceInstance, error)
FetchNodeList 拉取节点列表
func (*NodeLinker) Trigger ¶ added in v2.1.0
func (l *NodeLinker) Trigger(ctx context.Context, args *TriggerArgs) error
Trigger 触发事件
func (*NodeLinker) Unbind ¶ added in v2.1.0
Unbind 解绑节点 解绑时会对对应名称的节点服务器进行解绑,解绑时会对解绑节点ID进行校验,不匹配则解绑失败。 解绑操作会通过发布订阅方式同步到网关服务器和其他相关节点服务器上。
func (*NodeLinker) WatchClusterInstance ¶ added in v2.1.0
func (l *NodeLinker) WatchClusterInstance()
WatchClusterInstance 监听集群实例
func (*NodeLinker) WatchUserLocate ¶ added in v2.1.0
func (l *NodeLinker) WatchUserLocate()
WatchUserLocate 监听用户定位
Click to show internal directories.
Click to hide internal directories.