redis

package
v0.0.0-...-4b55cb2 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RedisStore

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

Wraps the Redis client to meet the Cache interface.

func NewRedisCache

func NewRedisCache(host string, password string, defaultExpiration time.Duration) *RedisStore

until redigo supports sharding/clustering, only one host will be in hostList

func (*RedisStore) Add

func (c *RedisStore) Add(key string, value interface{}, expires time.Duration) error

func (*RedisStore) Decrement

func (c *RedisStore) Decrement(key string, delta uint64) (newValue uint64, err error)

func (*RedisStore) Delete

func (c *RedisStore) Delete(key string) error

func (*RedisStore) Flush

func (c *RedisStore) Flush() error

func (*RedisStore) Get

func (c *RedisStore) Get(key string, ptrValue interface{}) error

func (*RedisStore) Increment

func (c *RedisStore) Increment(key string, delta uint64) (uint64, error)

func (*RedisStore) Replace

func (c *RedisStore) Replace(key string, value interface{}, expires time.Duration) error

func (*RedisStore) Set

func (c *RedisStore) Set(key string, value interface{}, expires time.Duration) error

Jump to

Keyboard shortcuts

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