redis

package
v2.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 21, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	UniversalClient redis.UniversalClient
	Client          *redis.Client
)

Functions

func Del

func Del(ctx context.Context, keys ...string) (int64, error)

func Expire

func Expire(ctx context.Context, key string, seconds int64, option ...gredis.ExpireOption) (int64, error)

func ExpireAt

func ExpireAt(ctx context.Context, key string, time time.Time, option ...gredis.ExpireOption) (int64, error)

func Get

func Get(ctx context.Context, key string) (*gvar.Var, error)

func GetInt

func GetInt(ctx context.Context, key string) (int, error)

func GetStr

func GetStr(ctx context.Context, key string) (string, error)

func HDel

func HDel(ctx context.Context, key string, fields ...string) (int64, error)

func HGet

func HGet(ctx context.Context, key, field string) (*gvar.Var, error)

func HGetInt

func HGetInt(ctx context.Context, key, field string) (int, error)

func HGetStr

func HGetStr(ctx context.Context, key, field string) (string, error)

func HIncrBy

func HIncrBy(ctx context.Context, key, field string, increment int64) (int64, error)

func HMGet

func HMGet(ctx context.Context, key string, fields ...string) (gvar.Vars, error)

func HSet

func HSet(ctx context.Context, key string, fields map[string]any) (int64, error)

func HSetStrAny

func HSetStrAny(ctx context.Context, key string, field string, value any) (int64, error)

func HSetStrStr

func HSetStrStr(ctx context.Context, key string, field, value string) (int64, error)

func HVals

func HVals(ctx context.Context, key string) (gvar.Vars, error)

func Incr

func Incr(ctx context.Context, key string) (int64, error)

func Keys added in v2.3.0

func Keys(ctx context.Context, pattern string) ([]string, error)

func LLen

func LLen(ctx context.Context, key string) (int64, error)

func LPush

func LPush(ctx context.Context, key string, values ...any) (int64, error)

func LRange

func LRange(ctx context.Context, key string, start, stop int64) (gvar.Vars, error)

func LTrim

func LTrim(ctx context.Context, key string, start, stop int64) error

func PSubscribe

func PSubscribe(ctx context.Context, pattern string, patterns ...string) (gredis.Conn, []*gredis.Subscription, error)

func Pipeline

func Pipeline(ctx context.Context) redis.Pipeliner

func Pipelined

func Pipelined(ctx context.Context, pipe pipeliner) ([]redis.Cmder, error)

func Publish

func Publish(ctx context.Context, channel string, message any) (int64, error)

func RPush

func RPush(ctx context.Context, key string, values ...any) (int64, error)

func Set

func Set(ctx context.Context, key string, value any, option ...gredis.SetOption) (*gvar.Var, error)

func SetEX

func SetEX(ctx context.Context, key string, value any, ttlInSeconds int64) error

func SetNX

func SetNX(ctx context.Context, key string, value any) (bool, error)

func Subscribe

func Subscribe(ctx context.Context, channel string, channels ...string) (gredis.Conn, []*gredis.Subscription, error)

func TTL

func TTL(ctx context.Context, key string) (int64, error)

func ZAdd added in v2.3.0

func ZAdd(ctx context.Context, key string, score float64, member string) (int64, error)

func ZCard added in v2.3.0

func ZCard(ctx context.Context, key string) (int64, error)

func ZRange added in v2.3.0

func ZRange(ctx context.Context, key string, start, stop int64) ([]string, error)

func ZRem added in v2.3.0

func ZRem(ctx context.Context, key string, members ...string) (int64, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL