gtbox_redis

package
v0.1.92 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2024 License: BSD-3-Clause Imports: 4 Imported by: 1

Documentation

Overview

Package gtbox_redis en: Redis handle, zh-cn: Redis封装处理

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetupRedisConnection

func SetupRedisConnection(redisCfg RedisConfig, prefixStr string) (success bool)

SetupRedisConnection 初始化Redis连接

Types

type GTRedis added in v0.1.70

type GTRedis struct {
	// contains filtered or unexported fields
}
var (
	OwnerRedis *GTRedis
)

func (*GTRedis) Del added in v0.1.70

func (gtr *GTRedis) Del(key string) error

Del 删除单条数据

func (*GTRedis) Get added in v0.1.70

func (gtr *GTRedis) Get(key string) (string, error)

Get 获取单条数据

func (*GTRedis) HDel added in v0.1.70

func (gtr *GTRedis) HDel(key string, subKey string) error

HDel Hash类型-删除单条数据

func (*GTRedis) HExists added in v0.1.70

func (gtr *GTRedis) HExists(key string, subKey string) bool

HExists Hash类型-判断是否存在

func (*GTRedis) HGet added in v0.1.70

func (gtr *GTRedis) HGet(key string, subKey string) (string, error)

HGet Hash类型-获取单条数据

func (*GTRedis) HGetAll added in v0.1.70

func (gtr *GTRedis) HGetAll(key string) (map[string]string, error)

func (*GTRedis) HKeys added in v0.1.70

func (gtr *GTRedis) HKeys(key string) ([]string, error)

func (*GTRedis) HSet added in v0.1.70

func (gtr *GTRedis) HSet(key string, subKey string, jsonByte []byte) error

HSet Hash类型-插入单条数据

func (*GTRedis) Keys added in v0.1.70

func (gtr *GTRedis) Keys(key string) ([]string, error)

Keys 删除单条数据

func (*GTRedis) SAdd added in v0.1.70

func (gtr *GTRedis) SAdd(key1 string, values ...interface{}) error

SAdd 集合--添加数据

func (*GTRedis) SMembers added in v0.1.70

func (gtr *GTRedis) SMembers(key1 string, values ...interface{}) []string

SMembers 集合--获取数据

func (*GTRedis) Scard added in v0.1.70

func (gtr *GTRedis) Scard(key1 string, key2 string) (Cnt int64)

Scard 集合--获取数据数量

func (*GTRedis) Set added in v0.1.70

func (gtr *GTRedis) Set(key string, value string) error

Set 插入单条数据

type RedisConfig

type RedisConfig struct {
	Addr       string `yaml:"addr" json:"addr"`              // address
	Pwd        string `yaml:"pwd" json:"pwd"`                // pwd
	SocketBuck int    `yaml:"socketBuck" json:"socket_buck"` // 插槽
}

Jump to

Keyboard shortcuts

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