Documentation ¶
Index ¶
- Variables
- type Master
- type Message
- type 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) Broadcast(ctx context.Context, kind session.Kind, message *Message) (int64, error)
- func (p *Proxy) Deliver(ctx context.Context, uid int64, message *Message) error
- func (p *Proxy) Disconnect(ctx context.Context, uid int64, isForce bool) 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) NewServiceClient(target string) (transport.ServiceClient, error)
- func (p *Proxy) Push(ctx context.Context, uid int64, message *Message) 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 WithTransporter ¶
func WithTransporter(transporter transport.Transporter) Option
WithTransporter 设置消息传输器
type Proxy ¶
type Proxy struct {
// contains filtered or unexported fields
}
func (*Proxy) Disconnect ¶
Disconnect 断开连接
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) GetMasterID ¶ added in v0.0.10
GetMasterID 获取当前管理节点ID
func (*Proxy) GetMasterName ¶ added in v0.0.10
GetMasterName 获取当前管理节点名称
func (*Proxy) LocateGate ¶
LocateGate 定位用户所在网关
func (*Proxy) LocateNode ¶
LocateNode 定位用户所在节点
func (*Proxy) NewServiceClient ¶ added in v0.0.17
func (p *Proxy) NewServiceClient(target string) (transport.ServiceClient, error)
NewServiceClient 新建微服务客户端 target参数可分为两种模式: 直连模式: direct://127.0.0.1:8011 服务发现模式: discovery://service_name
Click to show internal directories.
Click to hide internal directories.