grpc

package
v1.5.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 26, 2023 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 3 more Imports: 22 Imported by: 0

Documentation

Index

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) Destroy

func (g *Connector) Destroy() error

Destroy 销毁插件,可用于释放资源

func (*Connector) GetConnectionManager

func (g *Connector) GetConnectionManager() network.ConnectionManager

GetConnectionManager 获取连接管理器

func (*Connector) Heartbeat

func (g *Connector) Heartbeat(req *model.InstanceHeartbeatRequest) error

Heartbeat 心跳上报

func (*Connector) Init

func (g *Connector) Init(ctx *plugin.InitContext) error

Init 初始化插件

func (*Connector) IsEnable

func (g *Connector) IsEnable(cfg config.Configuration) bool

IsEnable .插件开关

func (*Connector) Name

func (g *Connector) Name() string

Name 插件名,一个类型下插件名唯一

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

ReportClient 上报客户端信息 异常场景:当sdk已经退出过程中,则返回error 异常场景:当服务端不可用或者上报失败,则返回error,调用者需进行重试

func (*Connector) Start

func (g *Connector) Start() error

Start 启动插件

func (*Connector) Type

func (g *Connector) Type() common.Type

Type 插件类型

func (*Connector) UpdateServers

func (g *Connector) UpdateServers(key *model.ServiceEventKey) error

UpdateServers 更新服务端地址 异常场景:当地址列表为空,或者地址全部连接失败,则返回error,调用者需进行重试

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL