gate

package
v2.0.0-...-993438d Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ServicePath = "Gate"
)

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(cli *cli.OneClient) *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 *packet.Message) (total int64, err 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 *packet.Message) (total int64, err error)

Multicast 推送组播消息

func (*Client) Push

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

Push 推送消息

func (*Client) Stat

func (c *Client) Stat(ctx context.Context, kind session.Kind) (total int64, err error)

Stat 推送广播消息

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