cache

package module
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2020 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache interface {
	Add(key string, value interface{}) error
	Get(key string, out interface{}) (ok bool, err error)
	Remove(key string) error
}

func NewDisk added in v1.0.3

func NewDisk(dir string) Cache

func NewLRU added in v1.0.3

func NewLRU(size int) Cache

func NewRedis added in v1.0.2

func NewRedis(conf RedisConfig) Cache

type MultiCache added in v1.0.3

type MultiCache []Cache

MultiCache makes multi-layer caching a breeze

func (MultiCache) Add added in v1.0.3

func (mc MultiCache) Add(key string, value interface{}) error

func (MultiCache) Get added in v1.0.3

func (mc MultiCache) Get(key string, out interface{}) (bool, error)

func (MultiCache) Remove added in v1.0.3

func (mc MultiCache) Remove(key string) error

type RedisConfig added in v1.0.2

type RedisConfig struct {
	Servers    map[string]string
	Password   string
	Database   int
	Prefix     string
	Expiration time.Duration
}

Jump to

Keyboard shortcuts

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