Versions in this module Expand all Collapse all v1 v1.0.0 Sep 13, 2023 Changes in this version + func CleanFileExpiration(dir string) error + type Cache interface + Cast func(key string) (caster.Caster, error) + Decrement func(key string, value int64) (bool, error) + DecrementFloat func(key string, value float64) (bool, error) + Exists func(key string) (bool, error) + Forget func(key string) error + Get func(key string) (any, error) + Increment func(key string, value int64) (bool, error) + IncrementFloat func(key string, value float64) (bool, error) + Pull func(key string) (any, error) + Put func(key string, value any, ttl time.Duration) error + PutForever func(key string, value any) error + Set func(key string, value any) (bool, error) + TTL func(key string) (time.Duration, error) + func NewFileCache(prefix string, dir string) Cache + func NewRedisCache(prefix string, opt redis.Options) Cache + type RateLimiter interface + AvailableIn func() (time.Duration, error) + Clear func() error + Hit func() error + Lock func() error + MustLock func() (bool, error) + Reset func() error + RetriesLeft func() (uint32, error) + TotalAttempts func() (uint32, error) + func NewRateLimiter(key string, maxAttempts uint32, ttl time.Duration, cache Cache) (RateLimiter, error) + type VerificationCode interface + Clear func() error + Exists func() (bool, error) + Generate func() (string, error) + GenerateN func(count uint) (string, error) + Get func() (string, error) + Set func(value string) error + TTL func() (time.Duration, error) + func NewVerificationCode(key string, ttl time.Duration, cache Cache) (VerificationCode, error)