xconn

package
v0.0.0-...-80fcaa9 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2022 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

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 ServerKeepAlive

func ServerKeepAlive() grpc.ServerOption

ServerKeepAlive KeepAliveServer

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

type ClientPool struct {
	sync.Mutex
	// contains filtered or unexported fields
}

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

type MDReaderWriter struct {
	metadata.MD
}

func (MDReaderWriter) ForeachKey

func (c MDReaderWriter) ForeachKey(handler func(key, val string) error) error

func (MDReaderWriter) Set

func (c MDReaderWriter) Set(key, val string)

Jump to

Keyboard shortcuts

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