Redis

package
v0.0.0-...-9a85bd8 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache struct {
	// contains filtered or unexported fields
}

func (*Cache) ClearAll

func (rc *Cache) ClearAll() error

ClearAll clean all cache in redis. delete this redis collection.

func (*Cache) ConnectInit

func (rc *Cache) ConnectInit()

func (*Cache) Decr

func (rc *Cache) Decr(key string) error

Decr decrease counter in redis.

func (*Cache) Delete

func (rc *Cache) Delete(key string) error

Delete delete cache in redis.

func (*Cache) EvalSha

func (rc *Cache) EvalSha(sha string, data ...interface{}) (interface{}, error)

func (*Cache) ExistsScript

func (rc *Cache) ExistsScript(sha string) (error, int64)

func (*Cache) Expire

func (rc *Cache) Expire(key string, timeout time.Duration) error

Set cache ttl from redis.

func (*Cache) Get

func (rc *Cache) Get(key string) string

Get cache from redis.

func (*Cache) GetMulti

func (rc *Cache) GetMulti(keys []string) []interface{}

GetMulti get cache from redis.

func (*Cache) HmGet

func (rc *Cache) HmGet(key, v string) string

func (*Cache) HmGetAll

func (rc *Cache) HmGetAll(key string) ([]interface{}, error)

func (*Cache) HmSet

func (rc *Cache) HmSet(key string, v interface{}) error

func (*Cache) Incr

func (rc *Cache) Incr(key string) error

Incr increase counter in redis.

func (*Cache) IsExist

func (rc *Cache) IsExist(key string) bool

IsExist check cache's existence in redis.

func (*Cache) Load

func (rc *Cache) Load() error

func (*Cache) Lock

func (rc *Cache) Lock(key string, timeout time.Duration) (bool, error)

func (*Cache) Put

func (rc *Cache) Put(key string, val interface{}, timeout time.Duration) error

Put put cache to redis.

func (*Cache) Scan

func (rc *Cache) Scan(pattern string) (keys []string, err error)

Scan scan all keys matching the pattern. a better choice than `keys`

func (*Cache) Script

func (rc *Cache) Script(sha string) (error, string)

func (*Cache) Set

func (rc *Cache) Set(key string, val interface{}) error

Set set cache to redis.

func (*Cache) Ttl

func (rc *Cache) Ttl(key string) int64

Get cache ttl from redis.

func (*Cache) UnLock

func (rc *Cache) UnLock(key string) error

Jump to

Keyboard shortcuts

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