Documentation ¶
Index ¶
- Variables
- func AsClient(client interface{}) *nodb.Nodb
- func New() cache.Cache
- type NodbCacher
- func (c *NodbCacher) Client() interface{}
- func (c *NodbCacher) Close() error
- func (c *NodbCacher) Codec() encoding.Codec
- func (c *NodbCacher) Decr(key string) error
- func (c *NodbCacher) Delete(key string) error
- func (c *NodbCacher) Flush() (err error)
- func (c *NodbCacher) Get(key string, value interface{}) error
- func (c *NodbCacher) Incr(key string) error
- func (c *NodbCacher) IsExist(key string) bool
- func (c *NodbCacher) Put(key string, val interface{}, expire int64) (err error)
- func (c *NodbCacher) SetCodec(codec encoding.Codec)
- func (c *NodbCacher) StartAndGC(opt cache.Options) error
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrDBExists = errors.New("database already exists")
)
Functions ¶
Types ¶
type NodbCacher ¶
NodbCacher represents a nodb cache adapter implementation.
func (*NodbCacher) Client ¶
func (c *NodbCacher) Client() interface{}
func (*NodbCacher) Close ¶
func (c *NodbCacher) Close() error
func (*NodbCacher) Codec ¶
func (c *NodbCacher) Codec() encoding.Codec
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) Get ¶
func (c *NodbCacher) Get(key string, value interface{}) error
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) SetCodec ¶
func (c *NodbCacher) SetCodec(codec encoding.Codec)
func (*NodbCacher) StartAndGC ¶
func (c *NodbCacher) StartAndGC(opt cache.Options) error
StartAndGC starts GC routine based on config string settings.
Click to show internal directories.
Click to hide internal directories.