Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ProviderSet = wire.NewSet( NewClient, )
ProviderSet 是客户端的依赖注入提供者集合
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface {
// CreateConn 创建指定类型的连接
CreateConn(ctx context.Context, connType ConnType, serviceName string) (Connection, error)
}
Client 客户端接口
type Connection ¶
type Connection interface {
// Value 返回原始连接对象
Value() interface{}
// Close 关闭连接
Close() error
// IsHealthy 检查连接健康状态
IsHealthy() bool
// GetType 返回连接类型
GetType() ConnType
}
Connection 顶层连接接口
type GrpcConn ¶
type GrpcConn struct {
// contains filtered or unexported fields
}
GrpcConn gRPC连接实现
func NewGrpcConn ¶
func NewGrpcConn(conn gogrpc.ClientConnInterface) *GrpcConn
NewGrpcConn 创建gRPC连接封装
Click to show internal directories.
Click to hide internal directories.