cache

package
v0.0.0-...-53bb481 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2020 License: Apache-2.0 Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MysqlCacher

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

MysqlCacher represents a mysql cache adapter implementation.

func NewMysqlCacher

func NewMysqlCacher() *MysqlCacher

NewMysqlCacher creates and returns a new mysql cacher.

func (*MysqlCacher) Decr

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

Decrease cached int value.

func (*MysqlCacher) Delete

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

Delete deletes cached value by given key.

func (*MysqlCacher) Flush

func (c *MysqlCacher) Flush() error

Flush deletes all cached data.

func (*MysqlCacher) Get

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

Get gets cached value by given key.

func (*MysqlCacher) Incr

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

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

func (*MysqlCacher) IsExist

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

IsExist returns true if cached value exists.

func (*MysqlCacher) Put

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

Put puts value into cache with key and expire time. If expired is 0, it will be deleted by next GC operation.

func (*MysqlCacher) StartAndGC

func (c *MysqlCacher) StartAndGC(opt cache.Options) (err 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