cache

package
v0.0.0-...-b8ffeed Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDBExists = errors.New("database already exists")
)

Functions

This section is empty.

Types

type NodbCacher

type NodbCacher struct {
	// contains filtered or unexported fields
}

NodbCacher represents a nodb cache adapter implementation.

func (*NodbCacher) Decr

func (c *NodbCacher) Decr(key string) error

Decr decreases cached int-type value by given key as a counter.

func (*NodbCacher) Delete

func (c *NodbCacher) Delete(key string) error

Delete deletes cached value by given key.

func (*NodbCacher) Flush

func (c *NodbCacher) Flush() (err error)

Flush deletes all cached data.

func (*NodbCacher) Get

func (c *NodbCacher) Get(key string) interface{}

Get gets cached value by given key.

func (*NodbCacher) Incr

func (c *NodbCacher) Incr(key string) error

Incr increases cached int-type value by given key as a counter.

func (*NodbCacher) IsExist

func (c *NodbCacher) IsExist(key string) bool

IsExist returns true if cached value exists.

func (*NodbCacher) Put

func (c *NodbCacher) Put(key string, val interface{}, expire int64) (err error)

Put puts value into cache with key and expire time. If expired is 0, it lives forever.

func (*NodbCacher) StartAndGC

func (c *NodbCacher) StartAndGC(opt cache.Options) error

StartAndGC starts GC routine based on config string settings.

Jump to

Keyboard shortcuts

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