Documentation ¶
Index ¶
- type PostgresCacher
- func (c *PostgresCacher) Decr(key string) error
- func (c *PostgresCacher) Delete(key string) error
- func (c *PostgresCacher) Flush() error
- func (c *PostgresCacher) Get(key string) interface{}
- func (c *PostgresCacher) Incr(key string) error
- func (c *PostgresCacher) IsExist(key string) bool
- func (c *PostgresCacher) Put(key string, val interface{}, expire int64) error
- func (c *PostgresCacher) StartAndGC(opt cache.Options) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PostgresCacher ¶
type PostgresCacher struct {
// contains filtered or unexported fields
}
PostgresCacher represents a postgres cache adapter implementation.
func NewPostgresCacher ¶
func NewPostgresCacher() *PostgresCacher
NewPostgresCacher creates and returns a new postgres cacher.
func (*PostgresCacher) Decr ¶
func (c *PostgresCacher) Decr(key string) error
Decrease cached int value.
func (*PostgresCacher) Delete ¶
func (c *PostgresCacher) Delete(key string) error
Delete deletes cached value by given key.
func (*PostgresCacher) Flush ¶
func (c *PostgresCacher) Flush() error
Flush deletes all cached data.
func (*PostgresCacher) Get ¶
func (c *PostgresCacher) Get(key string) interface{}
Get gets cached value by given key.
func (*PostgresCacher) Incr ¶
func (c *PostgresCacher) Incr(key string) error
Incr increases cached int-type value by given key as a counter.
func (*PostgresCacher) IsExist ¶
func (c *PostgresCacher) IsExist(key string) bool
IsExist returns true if cached value exists.
func (*PostgresCacher) Put ¶
func (c *PostgresCacher) 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 (*PostgresCacher) StartAndGC ¶
func (c *PostgresCacher) 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.