internal_pool

package
v1.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 16, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InternalConnPool

type InternalConnPool struct {
	// contains filtered or unexported fields
}

func NewConnPool

func NewConnPool(factory func() (driver.Conn, error), opts *InternalPoolConfig) *InternalConnPool

func (*InternalConnPool) Close

func (p *InternalConnPool) Close() error

func (*InternalConnPool) Get

func (p *InternalConnPool) Get() (driver.Conn, error)

type InternalPoolConfig

type InternalPoolConfig struct {
	// contains filtered or unexported fields
}

func NewInternalPoolOptions

func NewInternalPoolOptions(opts ...InternalPoolOption) *InternalPoolConfig

func (*InternalPoolConfig) GetMaxConnIdleTime

func (c *InternalPoolConfig) GetMaxConnIdleTime() time.Duration

func (*InternalPoolConfig) GetMaxConnLifetime

func (c *InternalPoolConfig) GetMaxConnLifetime() time.Duration

func (*InternalPoolConfig) GetMaxIdleConns

func (c *InternalPoolConfig) GetMaxIdleConns() int

type InternalPoolOption

type InternalPoolOption func(*InternalPoolConfig)

func WithMaxConnIdleTime

func WithMaxConnIdleTime(d time.Duration) InternalPoolOption

func WithMaxConnLifetime

func WithMaxConnLifetime(d time.Duration) InternalPoolOption

func WithMaxIdleConns

func WithMaxIdleConns(n int) InternalPoolOption

type InternalPooledConnectionProvider

type InternalPooledConnectionProvider struct {
	// contains filtered or unexported fields
}

func NewInternalPooledConnectionProvider

func NewInternalPooledConnectionProvider(internalPoolOptions *InternalPoolConfig,
	poolExpirationDuration time.Duration) *InternalPooledConnectionProvider

func NewInternalPooledConnectionProviderWithPoolKeyFunc

func NewInternalPooledConnectionProviderWithPoolKeyFunc(internalPoolOptions *InternalPoolConfig,
	poolExpirationDuration time.Duration,
	poolKeyFunc internalPoolKeyFunc) *InternalPooledConnectionProvider

func (*InternalPooledConnectionProvider) AcceptsStrategy

func (p *InternalPooledConnectionProvider) AcceptsStrategy(strategy string) bool

func (*InternalPooledConnectionProvider) AcceptsUrl

func (*InternalPooledConnectionProvider) Connect

func (*InternalPooledConnectionProvider) GetHostInfoByStrategy

func (p *InternalPooledConnectionProvider) GetHostInfoByStrategy(hosts []*host_info_util.HostInfo,
	role host_info_util.HostRole, strategy string, props map[string]string) (*host_info_util.HostInfo, error)

func (*InternalPooledConnectionProvider) GetHostSelectorStrategy

func (p *InternalPooledConnectionProvider) GetHostSelectorStrategy(strategy string) (driver_infrastructure.HostSelector, error)

func (*InternalPooledConnectionProvider) ReleaseResources

func (p *InternalPooledConnectionProvider) ReleaseResources()

type PoolKey

type PoolKey struct {
	// contains filtered or unexported fields
}

func NewPoolKey

func NewPoolKey(url string, driverName string, extraKey string) *PoolKey

func (*PoolKey) GetDriverName

func (pk *PoolKey) GetDriverName() string

func (*PoolKey) GetExtraKey

func (pk *PoolKey) GetExtraKey() string

func (*PoolKey) GetUrl

func (pk *PoolKey) GetUrl() string

func (*PoolKey) String

func (pk *PoolKey) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL