Documentation
¶
Overview ¶
pkg/redisx/redisx.go
Index ¶
- Variables
- func Client() (redis.UniversalClient, error)
- func Close() error
- func Del(ctx context.Context, keys ...string) (int64, error)
- func Exists(ctx context.Context, keys ...string) (int64, error)
- func GetJSON(ctx context.Context, key string, out any) error
- func GetString(ctx context.Context, key string) (string, error)
- func HGet(ctx context.Context, key, field string) (string, error)
- func HSet(ctx context.Context, key string, values ...any) error
- func IncrBy(ctx context.Context, key string, n int64) (int64, error)
- func Init(cfg Config) error
- func MustClient() redis.UniversalClient
- func RDB() redis.UniversalClient
- func Set(ctx context.Context, key string, val any, ttl time.Duration) error
- func SetJSON(ctx context.Context, key string, v any, ttl time.Duration) error
- func TTL(ctx context.Context, key string) (time.Duration, error)
- func TryClient() (redis.UniversalClient, bool)
- type Config
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNotInitialized = errors.New("redis not initialized")
)
Functions ¶
func MustClient ¶
func MustClient() redis.UniversalClient
MustClient 与 RDB 等价:返回已初始化的客户端(未初始化将 panic)
Types ¶
Click to show internal directories.
Click to hide internal directories.