Versions in this module Expand all Collapse all v1 v1.0.0 Oct 29, 2022 Changes in this version + var ErrAddrEliminated = errors.New("address has been eliminated") + var ErrGetConnWaitTimeout = errors.New("get connection wait timeout") + var ErrIllegalAddress = errors.New("unknown address") + var ErrNotUsableAddr = errors.New("not usable addr") + var ErrPoolClosed = errors.New("pool closed") + type Close = func(interface{}) + type ConnPool interface + Close func() + Discard func(interface{}) + Get func(addr ...string) (interface{}, error) + Put func(interface{}) + func NewPool(addrs []string, d Dial, closer Close, ops ...Option) ConnPool + type Connection interface + Value func(k interface{}) interface{} + WithValue func(k, v interface{}) + type Dial = func(addr string) (interface{}, error) + type EliminatedHook = func(addr string) + type Option func(p *pool) + func CoreNums(nums int) Option + func DialBackoffPolicy(policy backoff.Policy) Option + func EliminateAddr(maxErrorTimes int, maxErrorPeriod time.Duration, hook EliminatedHook) Option + func Lazy() Option + func MaxIdleTime(d time.Duration) Option + func MaxNums(nums int) Option + func MaxWaitingCapacity(nums int) Option + func WaitTimeout(d time.Duration) Option + func WithWarmUp(wu WarmUp) Option + type Registrar struct + func NewRegistrar(cp ConnPool) *Registrar + func (r *Registrar) Register(addrs ...string) error + type WarmUp = func(waits, idles, actives, max uint32) uint32