Documentation ¶
Index ¶
- Variables
- func AdditionalStreamServerOptWithBase(item ...grpc.StreamServerInterceptor) []grpc.StreamServerInterceptor
- func AdditionalUnaryServerOptWithBase(item ...grpc.UnaryServerInterceptor) []grpc.UnaryServerInterceptor
- func ClientUnaryOpentracing() grpc.UnaryClientInterceptor
- func ClientUnaryOpentracingAndTimeOut(servername string, timeout time.Duration) grpc.UnaryClientInterceptor
- func CloseGrpcConn()
- func CreateWithStreamServerChain(item ...grpc.StreamServerInterceptor) grpc.ServerOption
- func CreateWithUnaryServerChain(item ...grpc.UnaryServerInterceptor) grpc.ServerOption
- func GrpcConnPool(target string, opt ...grpc.DialOption) (*grpc.ClientConn, error)
- func GrpcConnPoolv2(target string, cap int, opt ...grpc.DialOption) (*grpc.ClientConn, error)
- func RegisterPool(target string, cli *ClientPool) error
- func RetryOption(times uint, retrycode ...codes.Code) []grpc.CallOption
- func ServerKeepAlive() grpc.ServerOption
- func ServerUnaryInvokerLog() grpc.UnaryServerInterceptor
- func ServerUnaryOpentracing(tracer opentracing.Tracer) grpc.UnaryServerInterceptor
- func ServerUnaryRecoveryInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, ...) (ret interface{}, err error)
- func SeverKeepAliveEnforcementPolicy() grpc.ServerOption
- type ClientPool
- type MDReaderWriter
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrConnShutdown = errors.New("grpc-conn-shutdown")
)
Functions ¶
func AdditionalStreamServerOptWithBase ¶
func AdditionalStreamServerOptWithBase(item ...grpc.StreamServerInterceptor) []grpc.StreamServerInterceptor
AdditionalStreamServerOptWithBase add base
func AdditionalUnaryServerOptWithBase ¶
func AdditionalUnaryServerOptWithBase(item ...grpc.UnaryServerInterceptor) []grpc.UnaryServerInterceptor
func ClientUnaryOpentracing ¶
func ClientUnaryOpentracing() grpc.UnaryClientInterceptor
ClientUnaryOpentracing
func ClientUnaryOpentracingAndTimeOut ¶
func ClientUnaryOpentracingAndTimeOut(servername string, timeout time.Duration) grpc.UnaryClientInterceptor
GetUnaryTimeOut
func CloseGrpcConn ¶
func CloseGrpcConn()
func CreateWithStreamServerChain ¶
func CreateWithStreamServerChain(item ...grpc.StreamServerInterceptor) grpc.ServerOption
CreateWithStreamServerChain WithStreamServerChain
func CreateWithUnaryServerChain ¶
func CreateWithUnaryServerChain(item ...grpc.UnaryServerInterceptor) grpc.ServerOption
func GrpcConnPool ¶
func GrpcConnPool(target string, opt ...grpc.DialOption) (*grpc.ClientConn, error)
func GrpcConnPoolv2 ¶
func GrpcConnPoolv2(target string, cap int, opt ...grpc.DialOption) (*grpc.ClientConn, error)
func RegisterPool ¶
func RegisterPool(target string, cli *ClientPool) error
func RetryOption ¶
func RetryOption(times uint, retrycode ...codes.Code) []grpc.CallOption
RetryOption RetryOption @times 重试次数 @retrycode 返回那些错误码则发生重试
func ServerUnaryInvokerLog ¶
func ServerUnaryInvokerLog() grpc.UnaryServerInterceptor
ServerUnaryInvokerLog grpc server call log
func ServerUnaryOpentracing ¶
func ServerUnaryOpentracing(tracer opentracing.Tracer) grpc.UnaryServerInterceptor
ServerUnaryOpentracing rewrite server's interceptor with open tracing
func ServerUnaryRecoveryInterceptor ¶
func ServerUnaryRecoveryInterceptor( ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (ret interface{}, err error)
ServerUnaryRecoveryInterceptor RecoveryInterceptor,
func SeverKeepAliveEnforcementPolicy ¶
func SeverKeepAliveEnforcementPolicy() grpc.ServerOption
SeverKeepAliveEnforcementPolicy EnforcementPolicy
Types ¶
type ClientPool ¶
func NewClientPool ¶
func NewClientPool(target string, poolsize int, option ...grpc.DialOption) *ClientPool
func (*ClientPool) Close ¶
func (cc *ClientPool) Close()
func (*ClientPool) GetConn ¶
func (cc *ClientPool) GetConn() (*grpc.ClientConn, error)
type MDReaderWriter ¶
func (MDReaderWriter) ForeachKey ¶
func (c MDReaderWriter) ForeachKey(handler func(key, val string) error) error
func (MDReaderWriter) Set ¶
func (c MDReaderWriter) Set(key, val string)
Click to show internal directories.
Click to hide internal directories.