Documentation ¶
Index ¶
- type CacheTTL
- func (c *CacheTTL) Clear() error
- func (c *CacheTTL) Get(key string, data interface{}) bool
- func (c *CacheTTL) GetGobBytes(key string) ([]byte, bool)
- func (c *CacheTTL) GetInterface(key string) (interface{}, bool)
- func (c *CacheTTL) Set(key string, data interface{}) error
- func (c *CacheTTL) SetExpire(key string, data interface{}, ttl int64) error
- func (c *CacheTTL) SetTTL(ttl int64)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CacheTTL ¶
type CacheTTL struct {
// contains filtered or unexported fields
}
CacheTTL is a cache source for on-memory cache When item size reaches maxSize, the item is selected by FIFO or TTL and erased.
func NewCacheTTL ¶
NewCacheTTL returns initialized CacheTTL max value limits maximum saved item size.
func (*CacheTTL) Get ¶
Get searches cache on memory by given key and returns flag of cache is existed or not. when cache hit, data is assigned.
func (*CacheTTL) GetGobBytes ¶
GetGobBytes searches cache on memory by given key and returns gob-encoded value.
func (*CacheTTL) GetInterface ¶
GetInterface searches cache on memory by given key and returns interface value.
Click to show internal directories.
Click to hide internal directories.