Documentation
¶
Index ¶
- Variables
- func DB(ctx context.Context) *gorm.DB
- func GetJSON[T any](ctx context.Context, key string, data *T) error
- func HGetJSON[T any](ctx context.Context, hashKey, fieldKey string, data *T) error
- func HSetJSON[T any](ctx context.Context, hashKey, fieldKey string, data T) error
- func PrefixedKey(key string) string
- func SetJSON[T any](ctx context.Context, key string, data T, expiration time.Duration) error
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ChConn driver.Conn
)
View Source
var (
Redis redis.UniversalClient
)
Functions ¶
func HGetJSON ¶
HGetJSON 从 Redis Hash 获取数据并反序列化为泛型类型 ctx: 上下文 hashKey: Redis Hash key fieldKey: Hash field key data: 用于接收数据的指针(泛型)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.