Documentation ¶
Index ¶
- Variables
- type NodbCacher
- 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) interface{}
- 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) StartAndGC(opt cache.Options) error
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrDBExists = errors.New("database already exists")
)
Functions ¶
This section is empty.
Types ¶
type NodbCacher ¶
type NodbCacher struct {
// contains filtered or unexported fields
}
NodbCacher represents a nodb cache adapter implementation.
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) interface{}
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) 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.