Documentation ¶
Index ¶
- Variables
- type Master
- type Message
- type Option
- func WithCatServer(catServer *cat.Server) Option
- func WithCodec(codec encoding.Codec) Option
- func WithContext(ctx context.Context) Option
- func WithDecryptor(decryptor crypto.Decryptor) Option
- func WithEncryptor(encryptor crypto.Encryptor) Option
- func WithID(id string) Option
- func WithLocator(locator locate.Locator) Option
- func WithName(name string) Option
- func WithRegistry(r registry.Registry) Option
- func WithTimeout(timeout time.Duration) Option
- func WithTransporter(transporter transport.Transporter) Option
- type Proxy
- func (p *Proxy) BlockConn(ctx context.Context, onid string, nnid string, target uint64)
- func (p *Proxy) Broadcast(ctx context.Context, kind session.Kind, message *Message) (int64, error)
- func (p *Proxy) BroadcastDeliver(ctx context.Context, kind link.DeliverKind, message *Message) error
- func (p *Proxy) Deliver(ctx context.Context, uid int64, message *Message) error
- func (p *Proxy) DeliverN(ctx context.Context, nid string, message *Message) error
- func (p *Proxy) Disconnect(ctx context.Context, uid int64, isForce bool) error
- func (p *Proxy) FetchCenterList(ctx context.Context, states ...cluster.State) ([]*registry.ServiceInstance, error)
- func (p *Proxy) FetchGameList(ctx context.Context, states ...cluster.State) ([]*registry.ServiceInstance, error)
- func (p *Proxy) FetchGateList(ctx context.Context, states ...cluster.State) ([]*registry.ServiceInstance, error)
- func (p *Proxy) FetchNodeList(ctx context.Context, states ...cluster.State) ([]*registry.ServiceInstance, error)
- func (p *Proxy) GetIP(ctx context.Context, uid int64) (string, error)
- func (p *Proxy) GetMasterID() string
- func (p *Proxy) GetMasterName() string
- func (p *Proxy) LocateGate(ctx context.Context, uid int64) (string, error)
- func (p *Proxy) LocateNode(ctx context.Context, uid int64) (string, error)
- func (p *Proxy) Multicast(ctx context.Context, uids []int64, message *Message) (int64, error)
- func (p *Proxy) MulticastDeliver(ctx context.Context, kind link.DeliverKind, targets []string, message *Message) error
- func (p *Proxy) Push(ctx context.Context, uid int64, message *Message) error
- func (p *Proxy) StatWithInsId(ctx context.Context, insId string) (int64, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidGID = link.ErrInvalidGID ErrInvalidNID = link.ErrInvalidNID ErrInvalidMessage = link.ErrInvalidMessage ErrInvalidArgument = link.ErrInvalidArgument ErrInvalidSessionKind = link.ErrInvalidSessionKind ErrNotFoundUserSource = link.ErrNotFoundUserSource ErrReceiveTargetEmpty = link.ErrReceiveTargetEmpty )
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(o *options)
func WithCatServer ¶ added in v0.0.23
WithCatServer 设置cat server
func WithTransporter ¶
func WithTransporter(transporter transport.Transporter) Option
WithTransporter 设置消息传输器
type Proxy ¶
type Proxy struct {
// contains filtered or unexported fields
}
func (*Proxy) BroadcastDeliver ¶ added in v0.0.23
func (p *Proxy) BroadcastDeliver(ctx context.Context, kind link.DeliverKind, message *Message) error
BroadcastDeliver 推送广播消息到node节点
func (*Proxy) Disconnect ¶
Disconnect 断开连接
func (*Proxy) FetchCenterList ¶ added in v0.0.23
func (p *Proxy) FetchCenterList(ctx context.Context, states ...cluster.State) ([]*registry.ServiceInstance, error)
FetchCenterList 拉取Center节点列表
func (*Proxy) FetchGameList ¶ added in v0.0.23
func (p *Proxy) FetchGameList(ctx context.Context, states ...cluster.State) ([]*registry.ServiceInstance, error)
FetchGameList 拉取游戏节点列表
func (*Proxy) FetchGateList ¶
func (p *Proxy) FetchGateList(ctx context.Context, states ...cluster.State) ([]*registry.ServiceInstance, error)
FetchGateList 拉取网关列表
func (*Proxy) FetchNodeList ¶
func (p *Proxy) FetchNodeList(ctx context.Context, states ...cluster.State) ([]*registry.ServiceInstance, error)
FetchNodeList 拉取节点列表
func (*Proxy) LocateGate ¶
LocateGate 定位用户所在网关
func (*Proxy) LocateNode ¶
LocateNode 定位用户所在节点
func (*Proxy) MulticastDeliver ¶ added in v0.0.23
func (p *Proxy) MulticastDeliver(ctx context.Context, kind link.DeliverKind, targets []string, message *Message) error
MulticastDeliver 推送广播消息到node节点
Click to show internal directories.
Click to hide internal directories.