Documentation
¶
Overview ¶
Package brpc NOTES
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GrpcServerHandledTotalInterceptor ¶
func GrpcServerHandledTotalInterceptor() grpc.UnaryServerInterceptor
GrpcServerHandledTotalInterceptor count grpc operands
func LogUnaryServerInterceptor ¶
func LogUnaryServerInterceptor() grpc.UnaryServerInterceptor
LogUnaryServerInterceptor 添加请求日志
func RecoveryHandlerFuncContext ¶
RecoveryHandlerFuncContext 异常日志输出
Types ¶
type PoolInterface ¶
type PoolInterface interface {
// Pick one gRPC client from the gRPC client pool
Pick() interface{}
}
PoolInterface defines the gRPC client pool supported operations.
func NewClientPool ¶
func NewClientPool(opt PoolOption) (PoolInterface, error)
NewClientPool create an gRPC client pool instance.
type PoolOption ¶
type PoolOption struct { PoolSize int ReadBufferSizeMB int WriteBufferSizeMB int ServiceName cc.Name SvrDiscover serviced.Discover TLS cc.TLSConfig NewClient func(conn *grpc.ClientConn) interface{} }
PoolOption defines the gRPC client pool related options.
func (*PoolOption) Validate ¶
func (o *PoolOption) Validate() error
Validate the pool option is validate or not.
Click to show internal directories.
Click to hide internal directories.