cache

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2019 License: MIT Imports: 8 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 {
	Has(key string) (bool, error)
	Get(key string) (interface{}, error)
	Set(key string, value interface{}) error
	SetTemp(key string, value interface{}, lifetime time.Duration) error
	Delete(key string) error
	Flush() error
	Run(name string, args ...interface{}) error
}

func New

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

New returns a new cache by url

type CacheDriver

type CacheDriver interface {
	Open(addr 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