Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type GrpcClientMiddlewareOpts ¶
type GrpcClientMiddlewareOpts struct { GrpcClientMiddleware struct { StreamInterceptors []grpc.StreamClientInterceptor UnaryInterceptors []grpc.UnaryClientInterceptor } }
type GrpcClientPool ¶
type GrpcClientPool struct {
// contains filtered or unexported fields
}
func NewGrpcClientPool ¶
func NewGrpcClientPool(name string, poolConf *GrpcClientPoolConf, middlewareOpts *GrpcClientMiddlewareOpts) (*GrpcClientPool, error)
func (*GrpcClientPool) Close ¶
func (p *GrpcClientPool) Close()
func (*GrpcClientPool) GetClientConnect ¶
func (p *GrpcClientPool) GetClientConnect() (*grpc.ClientConn, error)
func (*GrpcClientPool) PutClientConnect ¶
func (p *GrpcClientPool) PutClientConnect(c *grpc.ClientConn)
PutClientConnect 正常回归,返回 connection 是没有错误的
type GrpcClientPoolConf ¶
type GrpcClientPoolConf struct { ServerAddress string `json:"serverAddress" yaml:"serverAddress"` ServerPort uint16 `json:"serverPort" yaml:"serverPort"` DisableKeepalive bool `json:"disableKeepalive,omitempty" yaml:"disable_keepalive,omitempty"` PingIntervalTimeout uint32 `json:"pingIntervalTimeout,omitempty" yaml:"pingIntervalTimeout,omitempty"` RetryCount uint32 `json:"retryCount,omitempty" yaml:"retryCount,omitempty"` RetryPerCallTimeout uint32 `json:"retryPerCallTimeout,omitempty" yaml:"retryPerCallTimeout,omitempty"` }
type Pool ¶
type Pool struct { New func() (interface{}, error) // New create connection function Ping func(interface{}) bool // Ping check connection is ok Close func(interface{}) // Close close connection // contains filtered or unexported fields }
Pool common connection pool
func NewClientConnPool ¶
NewClientConnPool New create a pool with capacity
Click to show internal directories.
Click to hide internal directories.