Versions in this module Expand all Collapse all v0 v0.25.3 Nov 1, 2026 Changes in this version + type Cache struct + DefaultTTL time.Duration + Enabled bool + Expiring Expiring + KeyPrefix string + Memory Memory + ModuleName string + Redis Redis + Ristretto Ristretto + Serializer string + Sharded Sharded + TwoLevel TwoLevel + Type CacheType + func Default() *Cache + func DefaultCache() Cache + func NewCache(opt *Cache) *Cache + func (c *Cache) Clone() internal.Configurable + func (c *Cache) Get() interface{} + func (c *Cache) GetDefaultTTL() time.Duration + func (c *Cache) GetKeyPrefix() string + func (c *Cache) GetModuleName() string + func (c *Cache) GetSerializer() string + func (c *Cache) GetType() CacheType + func (c *Cache) IsEnabled() bool + func (c *Cache) Set(data interface{}) + func (c *Cache) Validate() error + func (c *Cache) WithDefaultTTL(ttl time.Duration) *Cache + func (c *Cache) WithEnabled(enabled bool) *Cache + func (c *Cache) WithExpiring(expiring Expiring) *Cache + func (c *Cache) WithKeyPrefix(prefix string) *Cache + func (c *Cache) WithMemory(memory Memory) *Cache + func (c *Cache) WithModuleName(moduleName string) *Cache + func (c *Cache) WithRedis(redis Redis) *Cache + func (c *Cache) WithRistretto(ristretto Ristretto) *Cache + func (c *Cache) WithSerializer(serializer string) *Cache + func (c *Cache) WithSharded(sharded Sharded) *Cache + func (c *Cache) WithTwoLevel(twoLevel TwoLevel) *Cache + func (c *Cache) WithType(cacheType CacheType) *Cache + type CacheType string + const CacheTypeExpiring + const CacheTypeMemory + const CacheTypeRedis + const CacheTypeRistretto + const CacheTypeSharded + const CacheTypeTwoLevel + type Expiring struct + CleanupInterval time.Duration + DefaultTTL time.Duration + EnableLazyExpiry bool + EvictionPolicy string + MaxMemoryUsage int64 + MaxSize int + ModuleName string + func DefaultExpiring() *Expiring + func DefaultExpiringConfig() Expiring + func NewExpiring(opt *Expiring) *Expiring + func (e *Expiring) Clone() internal.Configurable + func (e *Expiring) Get() interface{} + func (e *Expiring) Set(data interface{}) + func (e *Expiring) Validate() error + type Memory struct + Capacity int + CleanupSize int + DefaultTTL time.Duration + MaxSize int + ModuleName string + func DefaultMemory() *Memory + func DefaultMemoryConfig() Memory + func NewMemory(opt *Memory) *Memory + func (m *Memory) Clone() internal.Configurable + func (m *Memory) Get() interface{} + func (m *Memory) Set(data interface{}) + func (m *Memory) Validate() error + func (m *Memory) WithCapacity(capacity int) *Memory + func (m *Memory) WithCleanupSize(cleanupSize int) *Memory + func (m *Memory) WithDefaultTTL(defaultTTL time.Duration) *Memory + func (m *Memory) WithMaxSize(maxSize int) *Memory + func (m *Memory) WithModuleName(moduleName string) *Memory + type Redis struct + Addr string + Addrs []string + ClientName string + ClusterMode bool + ContextTimeoutEnabled bool + DB int + DialTimeout time.Duration + IdleTimeout time.Duration + MasterName string + MaxActiveConns int + MaxConnAge time.Duration + MaxIdleConns int + MaxRedirects int + MaxRetries int + MaxRetryBackoff time.Duration + MinIdleConns int + MinRetryBackoff time.Duration + ModuleName string + Password string + PoolSize int + PoolTimeout time.Duration + Protocol int + ReadBufferSize int + ReadOnly bool + ReadTimeout time.Duration + RouteByLatency bool + RouteRandomly bool + SentinelPassword string + SentinelUsername string + Username string + WriteBufferSize int + WriteTimeout time.Duration + func DefaultRedis() *Redis + func DefaultRedisConfig() Redis + func NewRedis(opt *Redis) *Redis + func (r *Redis) Clone() internal.Configurable + func (r *Redis) Get() interface{} + func (r *Redis) Set(data interface{}) + func (r *Redis) Validate() error + func (r *Redis) WithAddr(addr string) *Redis + func (r *Redis) WithAddrs(addrs []string) *Redis + func (r *Redis) WithClientName(clientName string) *Redis + func (r *Redis) WithClusterMode(clusterMode bool) *Redis + func (r *Redis) WithContextTimeoutEnabled(enabled bool) *Redis + func (r *Redis) WithDB(db int) *Redis + func (r *Redis) WithIdleTimeout(idleTimeout time.Duration) *Redis + func (r *Redis) WithMasterName(masterName string) *Redis + func (r *Redis) WithMaxActiveConns(maxActiveConns int) *Redis + func (r *Redis) WithMaxConnAge(maxConnAge time.Duration) *Redis + func (r *Redis) WithMaxRedirects(maxRedirects int) *Redis + func (r *Redis) WithMaxRetries(maxRetries int) *Redis + func (r *Redis) WithMaxRetryBackoff(maxRetryBackoff time.Duration) *Redis + func (r *Redis) WithMinIdleConns(minIdleConns int) *Redis + func (r *Redis) WithMinRetryBackoff(minRetryBackoff time.Duration) *Redis + func (r *Redis) WithModuleName(moduleName string) *Redis + func (r *Redis) WithPassword(password string) *Redis + func (r *Redis) WithPoolSize(poolSize int) *Redis + func (r *Redis) WithPoolTimeout(poolTimeout time.Duration) *Redis + func (r *Redis) WithProtocol(protocol int) *Redis + func (r *Redis) WithReadBufferSize(readBufferSize int) *Redis + func (r *Redis) WithReadOnly(readOnly bool) *Redis + func (r *Redis) WithReadTimeout(readTimeout time.Duration) *Redis + func (r *Redis) WithRouteByLatency(routeByLatency bool) *Redis + func (r *Redis) WithRouteRandomly(routeRandomly bool) *Redis + func (r *Redis) WithSentinelPassword(password string) *Redis + func (r *Redis) WithSentinelUsername(username string) *Redis + func (r *Redis) WithUsername(username string) *Redis + func (r *Redis) WithWriteBufferSize(writeBufferSize int) *Redis + func (r *Redis) WithWriteTimeout(writeTimeout time.Duration) *Redis + type Ristretto struct + BufferItems int64 + Cost int64 + IgnoreInternalCost bool + KeyToHash bool + MaxCost int64 + Metrics bool + ModuleName string + NumCounters int64 + func DefaultRistretto() *Ristretto + func DefaultRistrettoConfig() Ristretto + func NewRistretto(opt *Ristretto) *Ristretto + func (r *Ristretto) Clone() internal.Configurable + func (r *Ristretto) Get() interface{} + func (r *Ristretto) GetBufferItems() int64 + func (r *Ristretto) GetCost() int64 + func (r *Ristretto) GetMaxCost() int64 + func (r *Ristretto) GetNumCounters() int64 + func (r *Ristretto) IsIgnoreInternalCost() bool + func (r *Ristretto) IsKeyToHash() bool + func (r *Ristretto) IsMetricsEnabled() bool + func (r *Ristretto) Set(data interface{}) + func (r *Ristretto) Validate() error + type Sharded struct + BaseType CacheType + HashFunc string + LoadBalancer string + ModuleName string + ShardCount int + func DefaultSharded() *Sharded + func DefaultShardedConfig() Sharded + func NewSharded(opt *Sharded) *Sharded + func (s *Sharded) Clone() internal.Configurable + func (s *Sharded) Get() interface{} + func (s *Sharded) Set(data interface{}) + func (s *Sharded) Validate() error + type TwoLevel struct + L1Size int + L1TTL time.Duration + L1Type CacheType + L2Size int + L2TTL time.Duration + L2Type CacheType + ModuleName string + PromoteThreshold int + SyncStrategy string + func DefaultTwoLevel() *TwoLevel + func DefaultTwoLevelConfig() TwoLevel + func NewTwoLevel(opt *TwoLevel) *TwoLevel + func (t *TwoLevel) Clone() internal.Configurable + func (t *TwoLevel) Get() interface{} + func (t *TwoLevel) Set(data interface{}) + func (t *TwoLevel) Validate() error