Versions in this module Expand all Collapse all v1 v1.2.0 Jun 6, 2026 v1.1.0 Jun 3, 2026 Changes in this version + const KindGoCache + const KindLocal + const KindRedis + func Clear(ctx context.Context) error + func CloseGlobalCache() error + func Delete(ctx context.Context, key string) error + func DeleteMulti(ctx context.Context, keys ...string) error + func Exists(ctx context.Context, key string) bool + func Get(ctx context.Context, key string) (interface{}, bool) + func GetMulti(ctx context.Context, keys ...string) map[string]interface + func InitGlobalCache(config Config) error + func InitGlobalCacheWithOptions(config Config, options *Options) error + func Set(ctx context.Context, key string, value interface{}, expiration time.Duration) error + func SetGlobalCache(c Cache) + func SetMulti(ctx context.Context, data map[string]interface{}, expiration time.Duration) error + type Cache interface + Clear func(ctx context.Context) error + Close func() error + Decrement func(ctx context.Context, key string, value int64) (int64, error) + Delete func(ctx context.Context, key string) error + DeleteMulti func(ctx context.Context, keys ...string) error + Exists func(ctx context.Context, key string) bool + Get func(ctx context.Context, key string) (interface{}, bool) + GetMulti func(ctx context.Context, keys ...string) map[string]interface{} + GetWithTTL func(ctx context.Context, key string) (interface{}, time.Duration, bool) + Increment func(ctx context.Context, key string, value int64) (int64, error) + Set func(ctx context.Context, key string, value interface{}, expiration time.Duration) error + SetMulti func(ctx context.Context, data map[string]interface{}, expiration time.Duration) error + func GetGlobalCache() Cache + func NewCache(config Config) (Cache, error) + func NewCacheWithOptions(config Config, options *Options) (Cache, error) + func NewGoCache(config LocalConfig) Cache + func NewLayeredCache(config Config, options *Options) (Cache, error) + func NewLocalCache(config LocalConfig) Cache + func NewRedisCache(config RedisConfig) (Cache, error) + type Config struct + Local LocalConfig + Redis RedisConfig + Type string + type LocalConfig struct + CleanupInterval time.Duration + DefaultExpiration time.Duration + MaxSize int + type Options struct + Expiration time.Duration + LocalExpiration time.Duration + UseLocalCache bool + func DefaultOptions() *Options + type RedisConfig struct + Addr string + DB int + DialTimeout time.Duration + IdleTimeout time.Duration + MinIdleConns int + Password string + PoolSize int + ReadTimeout time.Duration + WriteTimeout time.Duration