gate

package
v0.0.0-...-c4dba0f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 4, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewServer

func NewServer(provider transport.GateProvider, opts *server.Options) (*server.Server, error)

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(cc *grpc.ClientConn) *Client

func (*Client) Bind

func (c *Client) Bind(ctx context.Context, cid, uid int64) (miss bool, err error)

Bind 绑定用户与连接

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 推送组播消息

func (*Client) Push

func (c *Client) Push(ctx context.Context, kind session.Kind, target int64, message *transport.Message) (miss bool, err error)

Push 推送消息

func (*Client) Unbind

func (c *Client) Unbind(ctx context.Context, uid int64) (miss bool, err error)

Unbind 解绑用户与连接

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL