Documentation ¶
Index ¶
- func NewServer(provider transport.GateProvider, opts *server.Options) (*server.Server, error)
- type Client
- func (c *Client) Bind(ctx context.Context, cid, uid int64) (miss bool, err error)
- func (c *Client) Broadcast(ctx context.Context, kind session.Kind, message *transport.Message) (int64, error)
- func (c *Client) Disconnect(ctx context.Context, kind session.Kind, target int64, isForce bool) (miss bool, err error)
- func (c *Client) GetIP(ctx context.Context, kind session.Kind, target int64) (ip string, miss bool, err error)
- func (c *Client) Multicast(ctx context.Context, kind session.Kind, targets []int64, ...) (int64, error)
- func (c *Client) Push(ctx context.Context, kind session.Kind, target int64, ...) (miss bool, err error)
- func (c *Client) Unbind(ctx context.Context, uid int64) (miss bool, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(cc *grpc.ClientConn) *Client
func (*Client) Broadcast ¶
func (c *Client) Broadcast(ctx context.Context, kind session.Kind, message *transport.Message) (int64, error)
Broadcast 推送广播消息
func (*Client) Disconnect ¶
func (c *Client) Disconnect(ctx context.Context, kind session.Kind, target int64, isForce bool) (miss bool, err error)
Disconnect 断开连接
func (*Client) GetIP ¶
func (c *Client) GetIP(ctx context.Context, kind session.Kind, target int64) (ip string, miss bool, err error)
GetIP 获取客户端IP
func (*Client) Multicast ¶
func (c *Client) Multicast(ctx context.Context, kind session.Kind, targets []int64, message *transport.Message) (int64, error)
Multicast 推送组播消息
Click to show internal directories.
Click to hide internal directories.