Versions in this module Expand all Collapse all v0 v0.1.1 Aug 18, 2025 v0.1.0 Jun 10, 2025 Changes in this version + var ErrInvalidConfig = errors.New("invalid cache configuration") + var ErrInvalidDriver = errors.New("invalid cache driver") + var ErrInvalidTTL = errors.New("invalid TTL value") + var ErrKeyNotFound = errors.New("key not found") + var ErrNotInitialized = errors.New("cache not initialized") + func Clear(ctx context.Context) error + func Delete(ctx context.Context, key string) error + func Exists(ctx context.Context, key string) (bool, error) + func Get(ctx context.Context, key string) ([]byte, error) + func Health(ctx context.Context) error + func Init(configs ...Config) error + func InitFromEnv() error + func IsHealthy() bool + func MustInit(configs ...Config) + func Ping(ctx context.Context) error + func Reset() + func Set(ctx context.Context, key string, value []byte, ttl time.Duration) error + func Shutdown(ctx context.Context) error + type Builder struct + func WithPrefix(prefix string) *Builder + func (b *Builder) Init() error + func (b *Builder) New() (Cache, error) + type Cache interface + Clear func(ctx context.Context) error + Close func() error + Delete func(ctx context.Context, key string) error + Exists func(ctx context.Context, key string) (bool, error) + Get func(ctx context.Context, key string) ([]byte, error) + Ping func(ctx context.Context) error + Set func(ctx context.Context, key string, value []byte, ttl time.Duration) error + func Default() Cache + func New(cfg Config) (Cache, error) + func NewFromEnv() (Cache, error) + type Config struct + CAFile string + CertFile string + CleanupInterval string + ConnMaxIdleTime int + ConnMaxLifetime int + Database int + DefaultTTL string + Driver string + Host string + KeyFile string + KeyPrefix string + MaxIdleConns int + MaxKeys int + MaxRetries int + MaxSize int64 + MinIdleConns int + Namespace string + Password string + PoolSize int + Port string + URL string + UseTLS bool + func GetConfig() (*Config, error) + func (c Config) ParsedCleanupInterval() time.Duration + func (c Config) ParsedDefaultTTL() time.Duration