Documentation ¶
Index ¶
- Constants
- Variables
- type Builder
- type Logger
- type LogicConn
- type Option
- func WithCleanIntervalTime(t time.Duration) Option
- func WithClientIdleTimeout(t time.Duration) Option
- func WithDebug() Option
- func WithGrpcPoolSize(size int) Option
- func WithLogger(logger Logger) Option
- func WithMaxIdle(num int) Option
- func WithMaxStreamsClient(num int) Option
- func WithNonblocking() Option
- type Pool
Constants ¶
View Source
const ( // OPENED represents that the pool is opened. OPENED = iota // CLOSED represents that the pool is closed. CLOSED )
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Logger ¶
type Logger interface { // Printf must have the same semantics as log.Printf. Printf(format string, args ...interface{}) }
Logger is used for logging formatted messages.
type LogicConn ¶
type LogicConn interface { Conn() grpc.ClientConnInterface // contains filtered or unexported methods }
LogicConn grpc 逻辑连接接口
type Option ¶
type Option func(*option)
Option .
func WithCleanIntervalTime ¶
WithCleanIntervalTime set interval time to clean up idle connections or create new tcp connection
func WithClientIdleTimeout ¶
WithClientIdleTimeout .
func WithGrpcPoolSize ¶
WithGrpcPoolSize returns a Option which sets the value for pool size
func WithLogger ¶
WithLogger returns a Option which sets the value for pool logger
func WithMaxIdle ¶
WithMaxIdle set number of idle connections in the pool.
func WithMaxStreamsClient ¶
WithMaxStreamsClient returns a Option which set the value for http2 client maxConcurrentStreams
func WithNonblocking ¶
func WithNonblocking() Option
WithNonblocking returns a Option which Pool.Get can never be blocked. ErrPoolOverload will be returned when Pool is exhausted.
Click to show internal directories.
Click to hide internal directories.