Documentation ¶
Index ¶
- type HookHandler
- type Master
- type Option
- func WithCodec(codec encoding.Codec) Option
- func WithConfigSource(source config.Source) Option
- func WithContext(ctx context.Context) 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) AddHookListener(hook cluster.Hook, handler HookHandler)
- func (p *Proxy) Broadcast(ctx context.Context, kind session.Kind, message *cluster.Message) error
- func (p *Proxy) Disconnect(ctx context.Context, args *cluster.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) GetGateState(ctx context.Context, gid string) (cluster.State, error)
- func (p *Proxy) GetID() string
- func (p *Proxy) GetIP(ctx context.Context, uid int64) (string, error)
- func (p *Proxy) GetName() string
- func (p *Proxy) GetNodeState(ctx context.Context, nid string) (cluster.State, error)
- func (p *Proxy) IsOnline(ctx context.Context, args *cluster.IsOnlineArgs) (bool, error)
- func (p *Proxy) LoadConfig(ctx context.Context, file string) ([]*config.Configuration, 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, uids []int64, message *cluster.Message) error
- func (p *Proxy) NewMeshClient(target string) (transport.Client, error)
- func (p *Proxy) Push(ctx context.Context, uid int64, message *cluster.Message) error
- func (p *Proxy) SetGateState(ctx context.Context, gid string, state cluster.State) error
- func (p *Proxy) SetNodeState(ctx context.Context, nid string, state cluster.State) error
- func (p *Proxy) Stat(ctx context.Context, kind session.Kind) (int64, error)
- func (p *Proxy) StoreConfig(ctx context.Context, file string, content interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HookHandler ¶ added in v2.1.0
type HookHandler func(proxy *Proxy)
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) AddHookListener ¶ added in v2.1.0
func (p *Proxy) AddHookListener(hook cluster.Hook, handler HookHandler)
AddHookListener 添加钩子监听器
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) GetGateState ¶ added in v2.1.0
GetGateState 获取网关状态
func (*Proxy) GetNodeState ¶ added in v2.1.0
GetNodeState 获取节点状态
func (*Proxy) LoadConfig ¶
LoadConfig 加载配置
func (*Proxy) LocateGate ¶
LocateGate 定位用户所在网关
func (*Proxy) LocateNode ¶
LocateNode 定位用户所在节点
func (*Proxy) NewMeshClient ¶ added in v2.1.0
NewMeshClient 新建微服务客户端 target参数可分为两种模式: 服务直连模式: direct://127.0.0.1:8011 服务发现模式: discovery://service_name
func (*Proxy) SetGateState ¶ added in v2.1.0
SetGateState 设置网关状态
func (*Proxy) SetNodeState ¶ added in v2.1.0
SetNodeState 设置节点状态
Click to show internal directories.
Click to hide internal directories.