Documentation ¶
Overview ¶
* @Author: lisheng * @Date: 2022-10-12 17:57:22 * @LastEditTime: 2023-01-06 14:16:24 * @LastEditors: lisheng * @Description: Redis驱动 * @FilePath: /jf-go-kit/database/redis/redis.go
* @Author: lisheng * @Date: 2022-10-25 15:11:22 * @LastEditTime: 2023-01-06 14:17:17 * @LastEditors: lisheng * @Description: redis字符串数据操作 * @FilePath: /jf-go-kit/database/redis/redis_set.go
* @Author: lisheng * @Date: 2022-10-25 15:11:22 * @LastEditTime: 2023-01-06 14:17:22 * @LastEditors: lisheng * @Description: redis字符串数据操作 * @FilePath: /jf-go-kit/database/redis/redis_string.go
Index ¶
- func CreateDBEngnine(addr, pwd string) *redis.Client
- func DBKeepAlive()
- func HashDelete(engineName string, key string, fields ...string) (int64, error)
- func HashGet(engineName string, key string) (map[string]string, error)
- func HashGetFields(engineName string, key, field string) (string, error)
- func HashSet(engineName string, key, field string, value interface{}) (bool, error)
- func InitRedisClient() func() error
- func SetAdd(engineName string, key string, value ...interface{}) (affected int64, err error)
- func SetMembers(engineName string, key string) (map[string][]string, error)
- func SetZange(engineName string, key string, start, stop int64) (map[string][]string, error)
- func StringDelete(engineName string, keys ...string) (bool, error)
- func StringGet(engineName string, key string) (map[string]string, error)
- func StringSet(engineName string, key string, value interface{}, expiration time.Duration) (bool, error)
- type RdsManager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateDBEngnine ¶
func CreateDBEngnine(addr, pwd string) *redis.Client
func HashDelete ¶
*
- @description: Hash Delete
- @param {string} key
- @param {...string} fields
- @return {*}
- @author: liqiyuWorks
func HashGet ¶
*
- @description:
- @param {*} key
- @param {string} field
- @return {*}
- @author: liqiyuWorks
func HashGetFields ¶
*
- @description: HashGetFields
- @param {*} key
- @param {string} field
- @return {*}
- @author: liqiyuWorks
func HashSet ¶
*
- @description: HashSet
- @param {*} key
- @param {string} field
- @param {interface{}} value
- @return {*}
- @author: liqiyuWorks
func InitRedisClient ¶
func InitRedisClient() func() error
*
- @description: 初始化redisClient
- @return {*}
- @author: liqiyuWorks
func SetAdd ¶
*
- @description: SetAdd
- @param {string} engineName
- @param {string} key
- @param {...interface{}} value
- @return {*}
- @author: liqiyuWorks
func SetMembers ¶
*
- @description: SetMembers
- @param {string} engineName
- @param {string} key
- @return {*}
- @author: liqiyuWorks
func SetZange ¶
*
- @description: SetZange
- @param {string} engineName
- @param {string} key
- @param {*} start
- @param {int64} stop
- @return {*}
- @author: liqiyuWorks
func StringDelete ¶
*
- @description: String Delete
- @param {...string} keys
- @return {*}
- @author: liqiyuWorks
Types ¶
type RdsManager ¶
type RdsManager struct {
EngineMap map[string]*redis.Client
}
var (
GRdsManager *RdsManager = new(RdsManager)
)
Click to show internal directories.
Click to hide internal directories.