brpc

package
v0.0.0-...-7404c28 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: MIT Imports: 22 Imported by: 0

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

func RecoveryHandlerFuncContext(ctx context.Context, p interface{}) (err error)

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.

Jump to

Keyboard shortcuts

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