redis

package
v0.0.0-...-5fb67de Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2023 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Redis

type Redis struct {
	Client   *goredis.Client
	CTX      context.Context
	Server   string
	Password string
	DB       int
	Prefix   string
}

Redis struct about the redis connection

func New

func New(cfg *cfg.Config) *Redis

New will create a new Redis object

func (*Redis) Connect

func (e *Redis) Connect() bool

Connect will connect the redis DB and save the client pointer

func (*Redis) DelRedisKey

func (e *Redis) DelRedisKey(key string) int64

DelRedisKey will delete a redis key

func (*Redis) GetAllRedisKeys

func (e *Redis) GetAllRedisKeys(pattern string) *goredis.ScanIterator

GetAllRedisKeys get out all redis keys to a patter

func (*Redis) GetRedisKey

func (e *Redis) GetRedisKey(key string) string

GetRedisKey get out the data of a key

func (*Redis) PingRedis

func (e *Redis) PingRedis() error

PingRedis to check the health of redis

func (*Redis) SetRedisKey

func (e *Redis) SetRedisKey(data []byte, key string)

SetRedisKey store data in redis

Jump to

Keyboard shortcuts

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