Categorygithub.com/mojotx/grpc-go-pool
modulepackage
0.0.0-20240310161447-5e7e94106d63
Repository: https://github.com/mojotx/grpc-go-pool.git
Documentation: pkg.go.dev

# README

grpc-go-pool

Go Coverage GoDoc golangci-lint codeql

This package aims to provide an easy to use and lightweight GRPC connection pool.

Please note that the goal isn't to replicate the client-side load-balancing feature of the official grpc package: the goal is rather to have multiple connections established to one endpoint (which can be server-side load-balanced).

# Functions

New creates a new clients pool with the given initial and maximum capacity, and the timeout for the idle clients.
NewWithContext creates a new clients pool with the given initial and maximum capacity, and the timeout for the idle clients.

# Variables

ErrAlreadyClosed is the error when the client conn was already closed.
ErrClosed is the error when the client pool is closed.
ErrFullPool is the error when the pool is already full.
ErrTimeout is the error when the client pool timed out.

# Structs

ClientConn is the wrapper for a grpc client conn.
Pool is the grpc client pool.

# Type aliases

Factory is a function type creating a grpc client.
FactoryWithContext is a function type creating a grpc client that accepts the context parameter that could be passed from Get or NewWithContext method.