Documentation ¶
Overview ¶
实现文件 基于 grpc 实现的 rpc-client
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrServiceNotAvailable 服务不可用,通常是因为没有查询到中心节点(coordinate) ErrServiceNotAvailable = errors.New("caller service not available") // ErrConfigConvert 配置转换失败 ErrConfigConvert = errors.New("convert linker config") // ErrCantFindNode 在注册中心找不到对应的服务节点 ErrCantFindNode = errors.New("can't find service node in center") )
View Source
var ( DefaultClientParm = Parm{ PoolInitNum: 8, PoolCapacity: 64, PoolIdle: time.Second * 100, } )
Functions ¶
func BuildWithOption ¶
Types ¶
type Option ¶
type Option func(*Parm)
Option config wraps
func AppendStreamInterceptors ¶
func AppendStreamInterceptors(interceptor grpc.StreamClientInterceptor) Option
func AppendUnaryInterceptors ¶
func AppendUnaryInterceptors(interceptor grpc.UnaryClientInterceptor) Option
type Parm ¶
type Parm struct { PoolInitNum int PoolCapacity int PoolIdle time.Duration UnaryInterceptors []grpc.UnaryClientInterceptor StreamInterceptors []grpc.StreamClientInterceptor }
Parm 调用器配置项
Click to show internal directories.
Click to hide internal directories.