1
0
mirror of https://github.com/astaxie/beego.git synced 2025-07-10 13:31:02 +00:00

Revert "hible"

This commit is contained in:
astaxie
2018-07-31 20:07:03 +08:00
committed by GitHub
parent 2486f3826a
commit 6d84db1e93
10 changed files with 1 additions and 284 deletions

18
cache/redis/redis.go vendored
View File

@ -128,30 +128,12 @@ func (rc *Cache) Incr(key string) error {
return err
}
// IncrBy increase counter in redis by num.
func (rc *Cache) IncrBy(key string, num int) error {
if num < 1 {
return errors.New("increase num should be a positive number")
}
_, err := redis.Bool(rc.do("INCRBY", key, num))
return err
}
// Decr decrease counter in redis.
func (rc *Cache) Decr(key string) error {
_, err := redis.Bool(rc.do("INCRBY", key, -1))
return err
}
// DecrBy decrease counter in redis by num.
func (rc *Cache) DecrBy(key string, num int) error {
if num < 1 {
return errors.New("decrease num should be a positive number")
}
_, err := redis.Bool(rc.do("DECRBY", key, num))
return err
}
// ClearAll clean all cache in redis. delete this redis collection.
func (rc *Cache) ClearAll() error {
c := rc.p.Get()