redis

package
v0.1.78 Latest Latest
Warning

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

Go to latest
Published: May 29, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMessageNotFoundErr = errors.New("messageNotFound")
)

Functions

func Close

func Close() error

func DecreaseCounter

func DecreaseCounter(key string) (result int64, err error)

func DoCmd added in v0.1.14

func DoCmd(cmd string, params ...any) (reply any, err error)

func GeoAdd

func GeoAdd(key, longitude, latitude, member string) (err error)

func GeoRadiusWithLua

func GeoRadiusWithLua(key, longitude, latitude, distance, unit string, page, limit int64) (result []int64, err error)

func GeoRemove

func GeoRemove(key, member string) (err error)

func GetCounter

func GetCounter(key string) (result int64, err error)

func GetInt64s

func GetInt64s(key string) (value []int64, err error)

func GetJSONObject

func GetJSONObject(key string, dest interface{}) error

func GetString

func GetString(key string) (value string, err error)

func IncreaseCounter

func IncreaseCounter(key string) (result int64, err error)

func InitRedis

func InitRedis(conf *Config) error

func IsBUSYGROUPErr

func IsBUSYGROUPErr(err error) bool

func IsExist

func IsExist(key string) (isExist bool, err error)

func IsMessageNotFound

func IsMessageNotFound(err error) bool

func Set

func Set(key, value interface{}, expireTime int64) (err error)

func SetInt64s

func SetInt64s(key string, value []int64, expireTime int64) (err error)

func SetJSONObjectWithNoExpireTime

func SetJSONObjectWithNoExpireTime(key string, value interface{}) (err error)

func SetWithOutExpire

func SetWithOutExpire(key, value interface{}) (err error)

func XACK added in v0.1.74

func XACK(key, groupName, messageID string) (err error)

func XAdd added in v0.1.74

func XAdd(key string, message interface{}) (messageID string, err error)

func XGroupCreate added in v0.1.74

func XGroupCreate(key string, groupName string) (err error)

func XReadBlock added in v0.1.74

func XReadBlock(key, groupName, consumer string, message IMessage) (err error)

Types

type Config

type Config struct {
	Host     string `json:",default=127.0.0.1"`
	Port     int    `json:",default=6379"`
	UserName string `json:",optional"`
	Password string `json:",optional"`
	DB       int    `json:",default=3"`
}

type GeoRadiusCoordinate

type GeoRadiusCoordinate struct {
	Longitude string
	Latitude  string
}

type GeoRadiusResult

type GeoRadiusResult struct {
	Member     string
	Distance   string
	Coordinate GeoRadiusCoordinate
}

func GeoRadius

func GeoRadius(key, longitude, latitude, distance, unit string) (result []GeoRadiusResult, err error)

type IMessage added in v0.1.74

type IMessage interface {
	SetMessageID(messageID string)
}

Jump to

Keyboard shortcuts

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