Versions in this module Expand all Collapse all v0 v0.1.5 Feb 22, 2026 v0.1.1 Feb 22, 2026 v0.1.0 Feb 22, 2026 Changes in this version + type CacheConfig struct + DefaultTTL time.Duration + MaxSize int + func DefaultCacheConfig() CacheConfig + type CacheLayer struct + func NewCacheLayer(cfg CacheConfig) *CacheLayer + func (c *CacheLayer) Clear() + func (c *CacheLayer) Delete(key string) + func (c *CacheLayer) Get(key string) (any, bool) + func (c *CacheLayer) GetOrSet(key string, loader func() (any, error)) (any, error) + func (c *CacheLayer) GetOrSetWithTTL(key string, ttl time.Duration, loader func() (any, error)) (any, error) + func (c *CacheLayer) Len() int + func (c *CacheLayer) PurgeExpired() int + func (c *CacheLayer) Set(key string, value any) + func (c *CacheLayer) SetWithTTL(key string, value any, ttl time.Duration) + func (c *CacheLayer) Stats() CacheStats + type CacheStats struct + Evictions int64 + HitRate float64 + Hits int64 + MaxSize int + Misses int64 + Size int + type Conn interface + Close func() error + Ping func(ctx context.Context) error + type ConnFactory func(ctx context.Context) (Conn, error) + type ConnectionPool struct + func NewConnectionPool(cfg ConnectionPoolConfig, factory ConnFactory) *ConnectionPool + func (p *ConnectionPool) Acquire(ctx context.Context) (Conn, error) + func (p *ConnectionPool) Close() error + func (p *ConnectionPool) Start(ctx context.Context) error + func (p *ConnectionPool) Stats() ConnectionPoolStats + type ConnectionPoolConfig struct + AcquireTimeout time.Duration + HealthCheckInterval time.Duration + IdleTimeout time.Duration + MaxConns int + MinConns int + func DefaultConnectionPoolConfig() ConnectionPoolConfig + type ConnectionPoolStats struct + AcquireCount int64 + AcquireErr int64 + ActiveConns int + IdleConns int + MaxConns int + TotalConns int