redis_cache

package
v3.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2022 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RedisCache

type RedisCache struct {
	// Client is the redis.Client. This must not be nil.
	Client *redis.Client

	// ClientTimeout specifies the timeout for read and write operations.
	// Default is 50ms.
	ClientTimeout time.Duration

	// Logger is the *zap.Logger for this RedisCache.
	// A nil Logger will disable logging.
	Logger *zap.Logger
	// contains filtered or unexported fields
}

func (*RedisCache) Close

func (r *RedisCache) Close() error

Close closes the redis client.

func (*RedisCache) Get

func (r *RedisCache) Get(key string) (v []byte, storedTime, expirationTime time.Time)

func (*RedisCache) Store

func (r *RedisCache) Store(key string, v []byte, storedTime, expirationTime time.Time)

Store stores kv into redis asynchronously.

Jump to

Keyboard shortcuts

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