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: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LedisCacher

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

LedisCacher represents a ledis cache adapter implementation.

func (*LedisCacher) Decr

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

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

func (*LedisCacher) Delete

func (c *LedisCacher) Delete(key string) (err error)

Delete deletes cached value by given key.

func (*LedisCacher) Flush

func (c *LedisCacher) Flush() error

Flush deletes all cached data.

func (*LedisCacher) Get

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

Get gets cached value by given key.

func (*LedisCacher) Incr

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

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

func (*LedisCacher) IsExist

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

IsExist returns true if cached value exists.

func (*LedisCacher) Put

func (c *LedisCacher) 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 (*LedisCacher) StartAndGC

func (c *LedisCacher) StartAndGC(opts cache.Options) error

StartAndGC starts GC routine based on config string settings. AdapterConfig: data_dir=./app.db,db=0

Jump to

Keyboard shortcuts

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