Documentation ¶
Index ¶
- type BroadcastArgs
- type DeliverArgs
- type DisconnectArgs
- type GetIPArgs
- type Link
- func (l *Link) AskGate(ctx context.Context, uid int64, gid string) (string, bool, error)
- func (l *Link) AskNode(ctx context.Context, uid int64, name, nid string) (string, bool, error)
- func (l *Link) BindGate(ctx context.Context, uid int64, gid string, cid int64) error
- func (l *Link) BindNode(ctx context.Context, uid int64, name, nid string) error
- func (l *Link) Broadcast(ctx context.Context, args *BroadcastArgs) (int64, error)
- func (l *Link) Deliver(ctx context.Context, args *DeliverArgs) error
- func (l *Link) Disconnect(ctx context.Context, args *DisconnectArgs) error
- func (l *Link) FetchServiceList(ctx context.Context, kind cluster.Kind, states ...cluster.State) ([]*registry.ServiceInstance, error)
- func (l *Link) GetIP(ctx context.Context, args *GetIPArgs) (string, error)
- func (l *Link) LocateGate(ctx context.Context, uid int64) (string, error)
- func (l *Link) LocateNode(ctx context.Context, uid int64, name string) (string, error)
- func (l *Link) Multicast(ctx context.Context, args *MulticastArgs) (int64, error)
- func (l *Link) Push(ctx context.Context, args *PushArgs) error
- func (l *Link) Stat(ctx context.Context, kind session.Kind) (int64, error)
- func (l *Link) Trigger(ctx context.Context, args *TriggerArgs) error
- func (l *Link) UnbindGate(ctx context.Context, uid int64) error
- func (l *Link) UnbindNode(ctx context.Context, uid int64, name, nid string) error
- func (l *Link) WatchServiceInstance(ctx context.Context, kinds ...cluster.Kind)
- func (l *Link) WatchUserLocate(ctx context.Context, kinds ...cluster.Kind)
- type Message
- type MulticastArgs
- 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 DeliverArgs ¶
type DisconnectArgs ¶
type Link ¶
type Link struct {
// contains filtered or unexported fields
}
func (*Link) BindNode ¶
BindNode 绑定节点 单个用户可以绑定到多个节点服务器上,相同名称的节点服务器只能绑定一个,多次绑定会到相同名称的节点服务器会覆盖之前的绑定。 绑定操作会通过发布订阅方式同步到网关服务器和其他相关节点服务器上。
func (*Link) Deliver ¶
func (l *Link) Deliver(ctx context.Context, args *DeliverArgs) error
Deliver 投递消息给节点处理
func (*Link) Disconnect ¶
func (l *Link) Disconnect(ctx context.Context, args *DisconnectArgs) error
Disconnect 断开连接
func (*Link) FetchServiceList ¶
func (l *Link) FetchServiceList(ctx context.Context, kind cluster.Kind, states ...cluster.State) ([]*registry.ServiceInstance, error)
FetchServiceList 拉取服务列表
func (*Link) LocateGate ¶
LocateGate 定位用户所在网关
func (*Link) LocateNode ¶
LocateNode 定位用户所在节点
func (*Link) Trigger ¶
func (l *Link) Trigger(ctx context.Context, args *TriggerArgs) error
Trigger 触发事件
func (*Link) UnbindGate ¶
UnbindGate 解绑网关
func (*Link) UnbindNode ¶
UnbindNode 解绑节点 解绑时会对对应名称的节点服务器进行解绑,解绑时会对解绑节点ID进行校验,不匹配则解绑失败。 解绑操作会通过发布订阅方式同步到网关服务器和其他相关节点服务器上。
func (*Link) WatchServiceInstance ¶
WatchServiceInstance 监听服务实例
type MulticastArgs ¶
type Options ¶
type Options struct { GID string // 网关ID NID string // 节点ID Codec encoding.Codec // 编解码器 Locator locate.Locator // 定位器 Registry registry.Registry // 注册器 Encryptor crypto.Encryptor // 加密器 Transporter transport.Transporter // 传输器 BalanceStrategy dispatcher.BalanceStrategy // 负载均衡策略 }
Click to show internal directories.
Click to hide internal directories.