Versions in this module Expand all Collapse all v0 v0.6.1 Jul 31, 2023 v0.0.4 Jul 31, 2023 Changes in this version + func SetReporter(r Reporter) + type ConnWithPkgSize struct + Readn int32 + Written int32 + func (c *ConnWithPkgSize) Close() error + func (c *ConnWithPkgSize) Read(b []byte) (n int, err error) + func (c *ConnWithPkgSize) Write(b []byte) (n int, err error) + type ConnectionPoolType int8 + const Long + const Short + type DummyPool struct + func (p *DummyPool) Clean(network, address string) + func (p *DummyPool) Close() error + func (p *DummyPool) Discard(conn net.Conn) error + func (p *DummyPool) Get(ctx context.Context, network, address string, opt remote.ConnOption) (net.Conn, error) + func (p *DummyPool) Put(conn net.Conn) error + type DummyReporter struct + func (dcm *DummyReporter) ConnFailed(poolType ConnectionPoolType, serviceName string, addr net.Addr) + func (dcm *DummyReporter) ConnSucceed(poolType ConnectionPoolType, serviceName string, addr net.Addr) + func (dcm *DummyReporter) ReuseSucceed(poolType ConnectionPoolType, serviceName string, addr net.Addr) + type LongPool struct + func NewLongPool(serviceName string, idlConfig connpool.IdleConfig) *LongPool + func (lp *LongPool) Clean(network, address string) + func (lp *LongPool) Close() error + func (lp *LongPool) Discard(conn net.Conn) error + func (lp *LongPool) Dump() interface{} + func (lp *LongPool) EnableReporter() + func (lp *LongPool) Evict() + func (lp *LongPool) Get(ctx context.Context, network, address string, opt remote.ConnOption) (net.Conn, error) + func (lp *LongPool) Put(conn net.Conn) error + func (lp *LongPool) Tick() + func (lp *LongPool) WarmUp(eh warmup.ErrorHandling, wuo *warmup.PoolOption, co remote.ConnOption) error + type PoolDump struct + ConnsDeadline []time.Time + IdleNum int + type Reporter interface + ConnFailed func(poolType ConnectionPoolType, serviceName string, addr net.Addr) + ConnSucceed func(poolType ConnectionPoolType, serviceName string, addr net.Addr) + ReuseSucceed func(poolType ConnectionPoolType, serviceName string, addr net.Addr) + func GetCommonReporter() Reporter + type ShortPool struct + func NewShortPool(serviceName string) *ShortPool + func (p *ShortPool) Close() error + func (p *ShortPool) Discard(conn net.Conn) error + func (p *ShortPool) EnableReporter() + func (p *ShortPool) Get(ctx context.Context, network, address string, opt remote.ConnOption) (net.Conn, error) + func (p *ShortPool) Put(conn net.Conn) error