Documentation ¶
Index ¶
- type BroadcastArgs
- type DisconnectArgs
- type GetIPArgs
- type Mesh
- type Message
- type MulticastArgs
- type Option
- func WithCodec(codec encoding.Codec) Option
- func WithContext(ctx context.Context) Option
- func WithEncryptor(encryptor crypto.Encryptor) 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) AddServiceProvider(name string, desc interface{}, provider interface{})
- func (p *Proxy) BindGate(ctx context.Context, uid int64, gid string, cid int64) error
- func (p *Proxy) BindNode(ctx context.Context, uid int64, name, nid string) error
- func (p *Proxy) Broadcast(ctx context.Context, args *BroadcastArgs) (int64, error)
- func (p *Proxy) Disconnect(ctx context.Context, args *DisconnectArgs) 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, args *GetIPArgs) (string, error)
- func (p *Proxy) LocateGate(ctx context.Context, uid int64) (string, error)
- func (p *Proxy) LocateNode(ctx context.Context, uid int64, name string) (string, error)
- func (p *Proxy) Multicast(ctx context.Context, args *MulticastArgs) (int64, error)
- func (p *Proxy) NewServiceClient(target string) (transport.ServiceClient, error)
- func (p *Proxy) Push(ctx context.Context, args *PushArgs) error
- func (p *Proxy) Stat(ctx context.Context, kind session.Kind) (int64, error)
- func (p *Proxy) UnbindGate(ctx context.Context, uid int64) error
- func (p *Proxy) UnbindNode(ctx context.Context, uid int64, name, nid string) error
- type PushArgs
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BroadcastArgs ¶
type BroadcastArgs = link.BroadcastArgs
type DisconnectArgs ¶
type DisconnectArgs = link.DisconnectArgs
type MulticastArgs ¶
type MulticastArgs = link.MulticastArgs
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) AddServiceProvider ¶
AddServiceProvider 添加服务提供者
func (*Proxy) BindNode ¶
BindNode 绑定节点 单个用户可以绑定到多个节点服务器上,相同名称的节点服务器只能绑定一个,多次绑定会到相同名称的节点服务器会覆盖之前的绑定。 绑定操作会通过发布订阅方式同步到网关服务器和其他相关节点服务器上。
func (*Proxy) Disconnect ¶
func (p *Proxy) Disconnect(ctx context.Context, args *DisconnectArgs) error
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) LocateGate ¶
LocateGate 定位用户所在网关
func (*Proxy) LocateNode ¶
LocateNode 定位用户所在节点
func (*Proxy) NewServiceClient ¶
func (p *Proxy) NewServiceClient(target string) (transport.ServiceClient, error)
NewServiceClient 新建微服务客户端 target参数可分为两种模式: 直连模式: direct://127.0.0.1:8011 服务发现模式: discovery://service_name
func (*Proxy) UnbindGate ¶
UnbindGate 解绑网关
Click to show internal directories.
Click to hide internal directories.