Documentation ¶
Index ¶
- func New(config ...Config) (cache.Store, error)
- type Config
- type Redis
- func (r *Redis) Add(key string, value interface{}, seconds time.Duration) bool
- func (r *Redis) Connection(name string) cache.Store
- func (r *Redis) Flush() bool
- func (r *Redis) Forever(key string, value interface{}) bool
- func (r *Redis) Forget(key string) bool
- func (r *Redis) Get(key string, def interface{}) interface{}
- func (r *Redis) GetBool(key string, def bool) bool
- func (r *Redis) GetInt(key string, def int) int
- func (r *Redis) GetString(key string, def string) string
- func (r *Redis) Has(key string) bool
- func (r *Redis) Pull(key string, def interface{}) interface{}
- func (r *Redis) Put(key string, value interface{}, seconds time.Duration) error
- func (r *Redis) Remember(key string, ttl time.Duration, callback func() interface{}) (interface{}, error)
- func (r *Redis) RememberForever(key string, callback func() interface{}) (interface{}, error)
- func (r *Redis) WithContext(ctx context.Context) cache.Store
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Redis ¶
type Redis struct { Prefix string Redis *redis.Client // contains filtered or unexported fields }
func (*Redis) Remember ¶
func (r *Redis) Remember(key string, ttl time.Duration, callback func() interface{}) (interface{}, error)
Remember Get an item from the cache, or execute the given Closure and store the result.
func (*Redis) RememberForever ¶
RememberForever Get an item from the cache, or execute the given Closure and store the result forever.
Click to show internal directories.
Click to hide internal directories.