redis

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2018 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ZRANGEBYSCORE command
	ZRANGEBYSCORE = "ZRANGEBYSCORE"
	// ZREVRANGEBYSCORE command
	ZREVRANGEBYSCORE = "ZREVRANGEBYSCORE"
	// ZCOUNT command
	ZCOUNT = "ZCOUNT"
	// SETEX command
	SETEX = "SETEX"
	// ZADD command
	ZADD = "ZADD"
	// LIMIT command
	LIMIT = "LIMIT"
	// ZREM command
	ZREM = "ZREM"
	// GET command
	GET = "GET"
	// MGET command
	MGET = "MGET"
	// ZRANGE command
	ZRANGE = "ZRANGE"
	// ZCARD command
	ZCARD = "ZCARD"
	// ZREMRANGEBYSCORE command
	ZREMRANGEBYSCORE = "ZREMRANGEBYSCORE"
	// MaxInfinite is +inf
	MaxInfinite = "+inf"
	// MinInfinite is -inf
	MinInfinite = "-inf"
)

Variables

This section is empty.

Functions

func AddSortedSet

func AddSortedSet(conn *redis2.Conn, key string, data interface{}, score int64) error

AddSortedSet add a data into a sorted set

func CreateRedisConn

func CreateRedisConn(url string, connTimeout time.Duration, readTimeout time.Duration, writeTimeout time.Duration) (redis2.Conn, error)

CreateRedisConn create a connection to redis

func DeleteSortSetItem

func DeleteSortSetItem(conn *redis2.Conn, key string, data interface{}) error

DeleteSortSetItem delete the item from a sorted set

func GetSortSet

func GetSortSet(conn *redis2.Conn, key string, pageNo int, pageRow int, max, min int64, isDESC bool) ([]string, error)

GetSortSet get a range data from sorted set key if you need sort all items without range, set max = min = 0

func GetSortedSetCount

func GetSortedSetCount(conn *redis2.Conn, key string, max, min int64) (int, error)

GetSortedSetCount get sorted set count in range if no range limited, set max = min = 0

func GetString

func GetString(conn *redis2.Conn, key string, data interface{}) error

GetString get a value from a string key

func GetStrings

func GetStrings(conn *redis2.Conn, keys []string) (interface{}, error)

GetStrings get multi-values

func RangeScoreDeleteSortedSet

func RangeScoreDeleteSortedSet(conn *redis2.Conn, key string, max, min int64) (int, error)

RangeScoreDeleteSortedSet delete a rangable items

func SetString

func SetString(conn *redis2.Conn, key string, data interface{}, expiredSeconds int) error

SetString set a value to the string key

Types

This section is empty.

Jump to

Keyboard shortcuts

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