redismodule

package
v1.1.0 Latest Latest
Warning

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

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

Documentation

Overview

Package redismodule @Title redis模块 @Description redis模块 @Author yr 2024/7/25 下午3:13 @Update yr 2024/7/25 下午3:13

Package redismodule @Title 请填写文件名称(需要改) @Description 请填写文件描述(需要改) @Author yr 2024/7/5 下午6:43 @Update yr 2024/7/5 下午6:43

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Callback

type Callback func(tx *redis.Client, args ...interface{}) (interface{}, error)

type RedisBase

type RedisBase struct{}

func (*RedisBase) HGet

func (r *RedisBase) HGet(tx *redis.Tx, key string, field string) (bool, string, error)

func (*RedisBase) HGetAll

func (r *RedisBase) HGetAll(tx *redis.Client, key string, result interface{}) error

func (*RedisBase) HSet

func (r *RedisBase) HSet(tx *redis.Tx, key string, fields map[string]interface{}) error

func (*RedisBase) RedisKey

func (r *RedisBase) RedisKey(format string, args ...interface{}) string

type RedisModule

type RedisModule struct {
	core.Module
	// contains filtered or unexported fields
}

func NewRedisModule

func NewRedisModule() *RedisModule

func (*RedisModule) ApiRedisExecuteFun added in v1.1.0

func (rm *RedisModule) ApiRedisExecuteFun(f Callback, args ...interface{}) (interface{}, error)

ApiRedisExecuteFun 执行一个函数

func (*RedisModule) ApiRedisGetString added in v1.1.0

func (rm *RedisModule) ApiRedisGetString(key string) (string, error)

func (*RedisModule) ApiRedisGetStringJson added in v1.1.0

func (rm *RedisModule) ApiRedisGetStringJson(key string, value interface{}) error

func (*RedisModule) ApiRedisHGetStruct added in v1.1.0

func (rm *RedisModule) ApiRedisHGetStruct(key string, value interface{}) error

ApiRedisHGetStruct 获取结构体(结构体需要带redis标签)

func (*RedisModule) ApiRedisHSetStruct added in v1.1.0

func (rm *RedisModule) ApiRedisHSetStruct(key string, value interface{}) error

ApiRedisHSetStruct 保存结构体(结构体需要带redis标签)

func (*RedisModule) ApiRedisSetString added in v1.1.0

func (rm *RedisModule) ApiRedisSetString(key string, value interface{}, expire time.Duration) error

func (*RedisModule) ApiRedisSetStringJson added in v1.1.0

func (rm *RedisModule) ApiRedisSetStringJson(key string, value interface{}, expire time.Duration) error

func (*RedisModule) GetClient

func (rm *RedisModule) GetClient() *redis.Client

func (*RedisModule) Init

func (rm *RedisModule) Init(conf *redis.Options)

func (*RedisModule) OnRelease

func (rm *RedisModule) OnRelease()

Jump to

Keyboard shortcuts

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