redishelper

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2023 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Del

func Del(ctx context.Context, key ...string) bool

Del 删除key。

func HashGet

func HashGet(ctx context.Context, key string, fields ...string) map[string]any

HashGet 获取指定key的指定字段。

func HashSetIfAbsent

func HashSetIfAbsent(ctx context.Context, key string, mv map[string]any, expiration time.Duration) bool

HashSetIfAbsent 设置Hash,如果指定的key不存在。 返回值 是否指定的key不存在且成功设置了值。

func HashSetIfExists

func HashSetIfExists(ctx context.Context, key string, mv map[string]any) bool

HashSetIfExists 设置Hash,如果指定的key存在,同时保留ttl。

func InitRedis

func InitRedis(addr, username, password, prefix string, db int) error

InitRedis 初始化Redis。

Types

This section is empty.

Jump to

Keyboard shortcuts

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