redis

package
v0.1.11 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

func Close

func Close() error

func DecreaseCounter

func DecreaseCounter(key string) (result int64, 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)

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)

Jump to

Keyboard shortcuts

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