Documentation
¶
Index ¶
- func AsClient(client interface{}) *sql.DB
- func New() cache.Cache
- type MysqlCacher
- func (c *MysqlCacher) Client() interface{}
- func (c *MysqlCacher) Close() error
- func (c *MysqlCacher) Codec() encoding.Codec
- 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, value interface{}) error
- func (c *MysqlCacher) Incr(key string) error
- func (c *MysqlCacher) IsExist(key string) bool
- func (c *MysqlCacher) Put(key string, val interface{}, expire int64) error
- func (c *MysqlCacher) SetCodec(codec encoding.Codec)
- func (c *MysqlCacher) StartAndGC(opt cache.Options) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type MysqlCacher ¶
MysqlCacher represents a mysql cache adapter implementation.
func (*MysqlCacher) Client ¶
func (c *MysqlCacher) Client() interface{}
func (*MysqlCacher) Close ¶
func (c *MysqlCacher) Close() error
func (*MysqlCacher) Codec ¶
func (c *MysqlCacher) Codec() encoding.Codec
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, value interface{}) error
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) SetCodec ¶
func (c *MysqlCacher) SetCodec(codec encoding.Codec)
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.