Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RedisCache ¶
type RedisCache struct {
// contains filtered or unexported fields
}
func NewRedisCache ¶ added in v4.3.1
func NewRedisCache(opts RedisCacheOpts) (*RedisCache, error)
func (*RedisCache) BatchStore ¶ added in v4.3.1
func (r *RedisCache) BatchStore(b []KV)
BatchStore stores a batch of kv into redis via redis pipeline.
func (*RedisCache) Get ¶
func (r *RedisCache) Get(key string) (v []byte, storedTime, expirationTime time.Time)
func (*RedisCache) Len ¶
func (r *RedisCache) Len() int
type RedisCacheOpts ¶ added in v4.3.1
type RedisCacheOpts struct { // Client cannot be nil. Client redis.Cmdable // ClientCloser closes Client when RedisCache.Close is called. // Optional. ClientCloser io.Closer // 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 }
func (*RedisCacheOpts) Init ¶ added in v4.3.1
func (opts *RedisCacheOpts) Init() error
Click to show internal directories.
Click to hide internal directories.