Documentation ¶
Index ¶
- type MysqlCacher
- func (c *MysqlCacher) Decr(key string) error
- func (c *MysqlCacher) Delete(key string) error
- func (c *MysqlCacher) Flush() error
- func (c *MysqlCacher) Get(key string) interface{}
- func (c *MysqlCacher) Incr(key string) error
- func (c *MysqlCacher) IsExist(key string) bool
- func (c *MysqlCacher) Ping() error
- func (c *MysqlCacher) Put(key string, val interface{}, expire int64) error
- func (c *MysqlCacher) StartAndGC(opt cache.Options) (err error)
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) Delete ¶
func (c *MysqlCacher) Delete(key string) error
Delete deletes cached value by given key.
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) Ping ¶ added in v0.2.0
func (c *MysqlCacher) Ping() error
Ping tests if the cache is alive.
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.
Click to show internal directories.
Click to hide internal directories.