redis

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

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

Go to latest
Published: May 25, 2020 License: MIT Imports: 3 Imported by: 1

Documentation

Overview

Package redis provides a cache implementation of onecache using redis as the backend

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(r *RedisStore)

Option is a redis option type

func CacheKeyGenerator

func CacheKeyGenerator(fn onecache.KeyFunc) Option

CacheKeyGenerator allows configuring the cache key generation process

func ClientOptions

func ClientOptions(opts *redis.Options) Option

ClientOptions is an Option type that allows configuring a redis client

type RedisStore

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

func New

func New(opts ...Option) *RedisStore

New returns a new RedisStore by applying all options passed into it It also sets sensible defaults too

func NewRedisStore

func NewRedisStore(opts *redis.Options, prefix string) *RedisStore

Deprecated -- Use New instead Returns a new instance of the RedisStore If prefix is an empty string, the default cache prefix is used

func (*RedisStore) Delete

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

func (*RedisStore) Flush

func (r *RedisStore) Flush() error

func (*RedisStore) Get

func (r *RedisStore) Get(key string) ([]byte, error)

func (*RedisStore) Has

func (r *RedisStore) Has(key string) bool

func (*RedisStore) Set

func (r *RedisStore) Set(k string, data []byte, expires time.Duration) error

Jump to

Keyboard shortcuts

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