Documentation
¶
Index ¶
- func InitRedis() error
- func Ping(ctx context.Context) error
- type ConfigItem
- type Redis
- func (r *Redis) Del(ctx context.Context, key string) error
- func (r *Redis) Expire(ctx context.Context, key string, expire time.Duration) error
- func (r *Redis) Get(ctx context.Context, key string) (string, error)
- func (r *Redis) GetBytes(ctx context.Context, key string) ([]byte, error)
- func (r *Redis) HDel(ctx context.Context, key string, field ...string) error
- func (r *Redis) HGet(ctx context.Context, key, field string) (string, error)
- func (r *Redis) HGetAll(ctx context.Context, key string) (map[string]string, error)
- func (r *Redis) HSet(ctx context.Context, key, field, value string, expire time.Duration) error
- func (r *Redis) HSetNX(ctx context.Context, key, field, value string, expire time.Duration) error
- func (r *Redis) Incr(ctx context.Context, key string) (int64, error)
- func (r *Redis) LLen(ctx context.Context, key string) (int64, error)
- func (r *Redis) LPush(ctx context.Context, key string, values ...any) error
- func (r *Redis) LRange(ctx context.Context, key string, start, stop int64) ([]string, error)
- func (r *Redis) MGet(ctx context.Context, keys []string) ([]any, error)
- func (r *Redis) Ping(ctx context.Context) error
- func (r *Redis) RPush(ctx context.Context, key string, values ...any) error
- func (r *Redis) Set(ctx context.Context, key string, value any, expire time.Duration) error
- func (r *Redis) SetNX(ctx context.Context, key string, value any, expire time.Duration) (bool, error)
- func (r *Redis) TTL(ctx context.Context, key string) (time.Duration, error)
- func (r *Redis) ZAdd(ctx context.Context, key string, score float64, data string) error
- func (r *Redis) ZCount(ctx context.Context, key, min, max string) (int64, error)
- func (r *Redis) ZRange(ctx context.Context, key string, start, stop int64) ([]string, error)
- func (r *Redis) ZRem(ctx context.Context, key string, members ...any) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ConfigItem ¶
type Redis ¶
type Redis struct { Config *redis.Options Client *redis.Client }
Redis provides a cache backed by a Redis server.
Click to show internal directories.
Click to hide internal directories.