Documentation ¶
Index ¶
- Constants
- type RedisStore
- func (s *RedisStore) Clear(ctx context.Context) error
- func (s *RedisStore) Del(ctx context.Context, key any) error
- func (s *RedisStore) Get(ctx context.Context, key any) (any, error)
- func (s *RedisStore) GetWithTTL(ctx context.Context, key any) (any, time.Duration, error)
- func (s *RedisStore) Set(ctx context.Context, key any, value any) error
- func (s *RedisStore) SetWithTTL(ctx context.Context, key any, value any, ttl time.Duration) error
- func (s *RedisStore) Wait(ctx context.Context)
Constants ¶
View Source
const (
// RedisType represents the storage type as a string value.
RedisType = "redis"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RedisStore ¶
type RedisStore struct {
// contains filtered or unexported fields
}
RedisStore is a store for Redis.
func NewRedis ¶
func NewRedis(client *redis.Client) *RedisStore
NewRedis creates a new store to Redis instance(s).
func (*RedisStore) Clear ¶
func (s *RedisStore) Clear(ctx context.Context) error
Clear resets all data in the store.
func (*RedisStore) Del ¶
func (s *RedisStore) Del(ctx context.Context, key any) error
Del removes data from Redis for given key identifier.
func (*RedisStore) GetWithTTL ¶
GetWithTTL returns data stored from a given key and its corresponding TTL.
func (*RedisStore) SetWithTTL ¶
Set defines data in Redis for given key identifier.
func (*RedisStore) Wait ¶
func (s *RedisStore) Wait(ctx context.Context)
Click to show internal directories.
Click to hide internal directories.