mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-22 17:31:03 +01:00
40 lines
1.8 KiB
Go
40 lines
1.8 KiB
Go
package db
|
|
|
|
import "time"
|
|
|
|
type RedisClient interface {
|
|
Ping() (err error)
|
|
Keys(pattern string) (values []string, err error)
|
|
AllKeys() (values []string, err error)
|
|
Get(collection string) (value string, err error)
|
|
Set(collection string, value string) (err error)
|
|
Del(collection string) (err error)
|
|
RPush(collection string, value interface{}) (err error)
|
|
LPush(collection string, value interface{}) (err error)
|
|
LPop(collection string) (value string, err error)
|
|
RPop(collection string) (value string, err error)
|
|
LLen(collection string) (count int, err error)
|
|
BRPop(collection string, timeout int) (value string, err error)
|
|
BLPop(collection string, timeout int) (value string, err error)
|
|
HSet(collection string, key string, value string) (err error)
|
|
HGet(collection string, key string) (value string, err error)
|
|
HDel(collection string, key string) (err error)
|
|
HScan(collection string) (results map[string]string, err error)
|
|
HKeys(collection string) (results []string, err error)
|
|
ZAdd(collection string, score float32, value interface{}) (err error)
|
|
ZCount(collection string, min string, max string) (count int, err error)
|
|
ZCountAll(collection string) (count int, err error)
|
|
ZScan(collection string, pattern string, count int) (results []string, err error)
|
|
ZPopMax(collection string, count int) (results []string, err error)
|
|
ZPopMin(collection string, count int) (results []string, err error)
|
|
ZPopMaxOne(collection string) (value string, err error)
|
|
ZPopMinOne(collection string) (value string, err error)
|
|
BZPopMax(collection string, timeout int) (value string, err error)
|
|
BZPopMin(collection string, timeout int) (value string, err error)
|
|
Lock(lockKey string) (value int64, err error)
|
|
UnLock(lockKey string, value int64)
|
|
MemoryStats() (stats map[string]int64, err error)
|
|
SetBackoffMaxInterval(interval time.Duration)
|
|
SetTimeout(timeout int)
|
|
}
|