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: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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