Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DeliverArgs ¶
type GateClient ¶
type GateClient interface { // Bind 绑定用户与连接 Bind(ctx context.Context, cid, uid int64) (miss bool, err error) // Unbind 解绑用户与连接 Unbind(ctx context.Context, uid int64) (miss bool, err error) // GetIP 获取客户端IP GetIP(ctx context.Context, kind session.Kind, target int64) (ip string, miss bool, err error) // Disconnect 断开连接 Disconnect(ctx context.Context, kind session.Kind, target int64, isForce bool) (miss bool, err error) // Push 推送消息 Push(ctx context.Context, kind session.Kind, target int64, message *Message) (miss bool, err error) // Multicast 推送组播消息 Multicast(ctx context.Context, kind session.Kind, targets []int64, message *Message) (total int64, err error) // Broadcast 推送广播消息 Broadcast(ctx context.Context, kind session.Kind, message *Message) (total int64, err error) }
type GateProvider ¶
type GateProvider interface { // Bind 绑定用户与网关间的关系 Bind(ctx context.Context, cid, uid int64) error // Unbind 解绑用户与网关间的关系 Unbind(ctx context.Context, uid int64) error // GetIP 获取客户端IP地址 GetIP(ctx context.Context, kind session.Kind, target int64) (ip string, err error) // Push 发送消息(异步) Push(ctx context.Context, kind session.Kind, target int64, message *packet.Message) error // Multicast 推送组播消息(异步) Multicast(ctx context.Context, kind session.Kind, targets []int64, message *packet.Message) (total int64, err error) // Broadcast 推送广播消息(异步) Broadcast(ctx context.Context, kind session.Kind, message *packet.Message) (total int64, err error) // Disconnect 断开连接 Disconnect(ctx context.Context, kind session.Kind, target int64, isForce bool) error }
type NewServiceClientFunc ¶
type NewServiceClientFunc func(target string) (ServiceClient, error)
type NodeClient ¶
type NodeClient interface { // Trigger 触发事件 Trigger(ctx context.Context, args *TriggerArgs) (miss bool, err error) // Deliver 投递消息 Deliver(ctx context.Context, args *DeliverArgs) (miss bool, err error) }
type NodeProvider ¶
type NodeProvider interface { // Trigger 触发事件 Trigger(ctx context.Context, args *TriggerArgs) (miss bool, err error) // Deliver 投递消息 Deliver(ctx context.Context, args *DeliverArgs) (miss bool, err error) }
type ServiceClient ¶
type Transporter ¶
type Transporter interface { // SetDefaultDiscovery 设置默认的服务发现组件 SetDefaultDiscovery(discovery registry.Discovery) // NewGateServer 新建网关服务器 NewGateServer(provider GateProvider) (Server, error) // NewNodeServer 新建节点服务器 NewNodeServer(provider NodeProvider) (Server, error) // NewServiceServer 新建微服务服务器 NewServiceServer() (Server, error) // NewGateClient 新建网关客户端 NewGateClient(ep *endpoint.Endpoint) (GateClient, error) // NewNodeClient 新建节点客户端 NewNodeClient(ep *endpoint.Endpoint) (NodeClient, error) // NewServiceClient 新建微服务客户端 NewServiceClient(target string) (ServiceClient, error) }
Click to show internal directories.
Click to hide internal directories.