Documentation
¶
Index ¶
- type Cache
- type RedisCache
- func (r *RedisCache) Close() error
- func (r *RedisCache) Del(ctx context.Context, key string) error
- func (r *RedisCache) Get(ctx context.Context, key string, dest any) (bool, error)
- func (r *RedisCache) IsExpired(ctx context.Context, key string) (bool, error)
- func (r *RedisCache) Set(ctx context.Context, key string, value any, ttl time.Duration) error
- func (r *RedisCache) SetNX(ctx context.Context, key string, value interface{}, ttl time.Duration) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache interface {
Get(ctx context.Context, key string, dest any) (bool, error)
Set(ctx context.Context, key string, value any, ttl time.Duration) error
Del(ctx context.Context, key string) error
SetNX(ctx context.Context, key string, value interface{}, ttl time.Duration) (bool, error)
IsExpired(ctx context.Context, key string) (bool, error)
Close() error
}
Click to show internal directories.
Click to hide internal directories.