Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultTimeout time.Duration = 30 * time.Minute
Functions ¶
func NewRedisClient ¶ added in v0.9.0
Types ¶
type CacheProvider ¶ added in v0.8.2
func NewCacheProvider ¶ added in v0.8.2
func NewCacheProvider[T any](t time.Duration) CacheProvider[T]
type CachedList ¶ added in v0.9.1
type CachedList[T any] interface { Append(ctx context.Context, key string, raw ...T) error GetAll(ctx context.Context, key string) ([]T, error) Del(ctx context.Context, key string) error }
func NewCachedList ¶ added in v0.9.1
func NewCachedList[T any](prefix string, dur time.Duration) CachedList[T]
type CachedListRedis ¶ added in v0.9.1
type CachedListRedis[T any] struct { Logger *zap.Logger Client *redis.Client Prefix string Timeout time.Duration }
func (*CachedListRedis[T]) Append ¶ added in v0.9.1
func (ll *CachedListRedis[T]) Append(ctx context.Context, key string, raw ...T) error
type RedisConfig ¶ added in v0.9.0
type RedisProvider ¶ added in v0.9.0
type RedisProvider[T any] struct { // contains filtered or unexported fields }
func (*RedisProvider[T]) Get ¶ added in v0.9.0
func (r *RedisProvider[T]) Get(key string) (T, bool)
Get implements CacheProvider.
func (*RedisProvider[T]) Set ¶ added in v0.9.0
func (r *RedisProvider[T]) Set(key string, value T)
Set implements CacheProvider.
Click to show internal directories.
Click to hide internal directories.