cache

package
v0.0.0-...-18b278e Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2017 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option interface {
	Name() string
	Value() interface{}
}

func WithExpires

func WithExpires(t time.Duration) Option

type Redis

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

func NewRedis

func NewRedis(servers []string, options ...RedisOption) *Redis

func (*Redis) Delete

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

func (*Redis) Get

func (c *Redis) Get(key string, v interface{}) error

func (*Redis) GetOrSet

func (c *Redis) GetOrSet(key string, v interface{}, fn func() (interface{}, error), options ...Option) (interface{}, error)

func (*Redis) Key

func (c *Redis) Key(list ...string) string

func (*Redis) Set

func (c *Redis) Set(key string, v interface{}, options ...Option) error

type RedisOption

type RedisOption interface {
	Configure(*Redis)
}

func WithMagic

func WithMagic(s string) RedisOption

func WithPrefix

func WithPrefix(s string) RedisOption

type RedisOptionFunc

type RedisOptionFunc func(*Redis)

func (RedisOptionFunc) Configure

func (f RedisOptionFunc) Configure(r *Redis)

Jump to

Keyboard shortcuts

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