cache

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound = errors.New("not found")
	ErrExpired  = errors.New("expired")
)

Functions

func Drivers

func Drivers() (list []string)

func Register

func Register(name string, driver CacheDriver)

Types

type Cache

type Cache interface {
	SetRegion(region string) error
	Get(key string) (v interface{}, err error)
	Has(key string) (ok bool, err error)
	Add(key string, value interface{}, lifetime time.Duration) error
	Set(key string, value interface{}, lifetime time.Duration) error
	Delete(key string) error
	Keys() (keys []string, err error)
	Flush() error
}

func New

func New(url string) (cache Cache, err error)

type CacheDriver

type CacheDriver interface {
	Open(region string, args map[string]string) (cache Cache, err error)
}

Jump to

Keyboard shortcuts

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