adsa-cms: Index | Files

package redis

import ""


Package Files


type Redis Uses

type Redis struct {
    Config *redis.Options
    Client *redis.Client

Redis provides a cache backed by a Redis server.

func New Uses

func New(config *redis.Options) *Redis

New returns an initialized Redis cache object.

func (*Redis) Delete Uses

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

Delete removes a specific key and its value from the Redis server.

func (*Redis) Fetch Uses

func (r *Redis) Fetch(key string, fc func() interface{}) (string, error)

Fetch returns the value for the key if it exists or sets and returns the value via the passed function.

func (*Redis) Get Uses

func (r *Redis) Get(key string) (string, error)

Get returns the value saved under a given key.

func (*Redis) Set Uses

func (r *Redis) Set(key string, value interface{}) error

Set saves an arbitrary value under a specific key.

func (*Redis) Unmarshal Uses

func (r *Redis) Unmarshal(key string, object interface{}) error

Unmarshal retrieves a value from the Redis server and unmarshals it into the passed object.

Package redis imports 2 packages (graph). Updated 2017-06-08. Refresh now. Tools for package owners. This is an inactive package (no imports and no commits in at least two years).