gredis

package
v0.0.0-...-46fca04 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2022 License: MIT, MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultTTL = 10 * gtime.Minute
)

Variables

View Source
var (
	ErrNoKey = errors.New("redis missing key")
)

Functions

func Delete

func Delete(key string) (bool, error)

Delete delete a kye

func Exists

func Exists(key string) bool

Exists check a key

func Get

func Get(key string) (string, error)

Get get a key

func GetStruct

func GetStruct(key string, target interface{}) error

GetStruct get a key

func LikeDeletes

func LikeDeletes(key string) error

LikeDeletes batch delete

func MockExpectGet

func MockExpectGet(conn *redigomock.Conn, key string, value string, err error)

func MockExpectGetStruct

func MockExpectGetStruct(conn *redigomock.Conn, key string, value interface{}, err error)

func MockExpectPing

func MockExpectPing(conn *redigomock.Conn, err error)

func MockExpectSet

func MockExpectSet(conn *redigomock.Conn, key string, value string, time gtime.Duration, err error)

func MockExpectSetStruct

func MockExpectSetStruct(conn *redigomock.Conn, key string, value interface{}, time gtime.Duration, err error)

func MockRedis

func MockRedis() *redigomock.Conn

func Ping

func Ping() error

func Set

func Set(key string, value string, time ...gtime.Duration) error

Set a key/value

func SetStruct

func SetStruct(key string, value interface{}, time ...gtime.Duration) error

func Setup

func Setup()

Setup Initialize the Redis instance

Types

This section is empty.

Jump to

Keyboard shortcuts

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