Documentation ¶
Index ¶
- Constants
- type Connector
- func (g *Connector) CreateConnection(address string, timeout time.Duration, clientInfo *network.ClientInfo) (network.ClosableConn, error)
- func (g *Connector) DeRegisterServiceHandler(key *model.ServiceEventKey) error
- func (g *Connector) DeregisterInstance(req *model.InstanceDeRegisterRequest) error
- func (g *Connector) Destroy() error
- func (g *Connector) GetConnectionManager() network.ConnectionManager
- func (g *Connector) Heartbeat(req *model.InstanceHeartbeatRequest) error
- func (g *Connector) Init(ctx *plugin.InitContext) error
- func (g *Connector) IsEnable(cfg config.Configuration) bool
- func (g *Connector) Name() string
- func (g *Connector) RegisterInstance(req *model.InstanceRegisterRequest, header map[string]string) (*model.InstanceRegisterResponse, error)
- func (g *Connector) RegisterServiceHandler(svcEventHandler *serverconnector.ServiceEventHandler) error
- func (g *Connector) ReportClient(req *model.ReportClientRequest) (*model.ReportClientResponse, error)
- func (g *Connector) Start() error
- func (g *Connector) Type() common.Type
- func (g *Connector) UpdateServers(key *model.ServiceEventKey) error
Constants ¶
View Source
const ( // DefaultMaxCallRecvMsgSize 默认GRPC链路包接收大小 DefaultMaxCallRecvMsgSize = 50 * 1024 * 1024 // MaxMaxCallRecvMsgSize GRPC链路包接收大小的设置上限 MaxMaxCallRecvMsgSize = 500 * 1024 * 1024 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Connector ¶
type Connector struct { *plugin.PluginBase *common.RunContext // contains filtered or unexported fields }
Connector cl5服务端代理,使用GRPC协议对接
func (*Connector) CreateConnection ¶
func (g *Connector) CreateConnection( address string, timeout time.Duration, clientInfo *network.ClientInfo) (network.ClosableConn, error)
CreateConnection 创建连接
func (*Connector) DeRegisterServiceHandler ¶
func (g *Connector) DeRegisterServiceHandler(key *model.ServiceEventKey) error
DeRegisterServiceHandler 反注册事件监听器 异常场景:当sdk已经退出过程中,则返回error
func (*Connector) DeregisterInstance ¶
func (g *Connector) DeregisterInstance(req *model.InstanceDeRegisterRequest) error
DeregisterInstance 同步反注册服务
func (*Connector) GetConnectionManager ¶
func (g *Connector) GetConnectionManager() network.ConnectionManager
GetConnectionManager 获取连接管理器
func (*Connector) Heartbeat ¶
func (g *Connector) Heartbeat(req *model.InstanceHeartbeatRequest) error
Heartbeat 心跳上报
func (*Connector) IsEnable ¶
func (g *Connector) IsEnable(cfg config.Configuration) bool
IsEnable .插件开关
func (*Connector) RegisterInstance ¶
func (g *Connector) RegisterInstance(req *model.InstanceRegisterRequest, header map[string]string) (*model.InstanceRegisterResponse, error)
RegisterInstance 同步注册服务
func (*Connector) RegisterServiceHandler ¶
func (g *Connector) RegisterServiceHandler(svcEventHandler *serverconnector.ServiceEventHandler) error
RegisterServiceHandler 注册服务监听器 异常场景:当key不合法或者sdk已经退出过程中,则返回error
func (*Connector) ReportClient ¶
func (g *Connector) ReportClient(req *model.ReportClientRequest) (*model.ReportClientResponse, error)
ReportClient 上报客户端信息 异常场景:当sdk已经退出过程中,则返回error 异常场景:当服务端不可用或者上报失败,则返回error,调用者需进行重试
func (*Connector) UpdateServers ¶
func (g *Connector) UpdateServers(key *model.ServiceEventKey) error
UpdateServers 更新服务端地址 异常场景:当地址列表为空,或者地址全部连接失败,则返回error,调用者需进行重试
Click to show internal directories.
Click to hide internal directories.