Versions in this module Expand all Collapse all v1 v1.0.0 Dec 16, 2024 Changes in this version + var ErrAlreadyClosed = errors.New("grpc pool: the connection was already closed") + var ErrClosed = errors.New("grpc pool: client pool is closed") + var ErrFullPool = errors.New("grpc pool: closing a ClientConn into a full pool") + var ErrTimeout = errors.New("grpc pool: client pool timed out") + func GetListener() net.Listener + func GetRPCAddress() string + func GetRPCServer() *grpc.Server + func Setup(cfg *config.RPCConfig) + func StartRPCServer() + type ClientConn struct + func ObtainConnection(addr string) (client *ClientConn, err error) + func ObtainLocalConnection() (conn *ClientConn, err error) + func (c *ClientConn) Close() error + func (c *ClientConn) Unhealthy() + type Factory func() (*grpc.ClientConn, error) + type FactoryWithContext func(context.Context) (*grpc.ClientConn, error) + type Pool struct + func New(factory Factory, init, capacity int, idleTimeout time.Duration, ...) (*Pool, error) + func NewWithContext(ctx context.Context, factory FactoryWithContext, init, capacity int, ...) (*Pool, error) + func (p *Pool) Available() int + func (p *Pool) Capacity() int + func (p *Pool) Close() + func (p *Pool) Get(ctx context.Context) (*ClientConn, error) + func (p *Pool) IsClosed() bool