store

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: May 5, 2018 License: AGPL-3.0 Imports: 5 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCacheMiss = errors.New("cache miss")
	ErrNotFound  = errors.New("not found")
	ErrExpired   = errors.New("expired")
	ErrInternal  = errors.New("internal error")
)

Errors

Functions

This section is empty.

Types

type Cache

type Cache interface {
	Put(key string, value interface{}) error
	PutUntil(time time.Time, key string, value interface{}) error
	Get(key string) (interface{}, error)
	Delete(key string) error
}

Cache describes very simple TTL cache interface.

func NewBoltDBCache

func NewBoltDBCache(path string) (Cache, error)

NewBoltDBCache implementes Cache with a BoltDB back-end;

func NewMemoryCache

func NewMemoryCache() Cache

NewMemoryCache implementes Cache with an in-memory store

Jump to

Keyboard shortcuts

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