Documentation
¶
Index ¶
- Constants
- type MemoryCache
- func (c *MemoryCache) Delete(keys ...string)
- func (c *MemoryCache) DeleteExpired()
- func (c *MemoryCache) Flush()
- func (c *MemoryCache) Get(key string) (interface{}, bool)
- func (c *MemoryCache) GetExpiration(key string) (interface{}, time.Time, bool)
- func (c *MemoryCache) Items() map[string]interface{}
- func (c *MemoryCache) Set(key string, value interface{}, expiration time.Duration)
- func (c *MemoryCache) SetDefault(key string, value interface{})
- func (c *MemoryCache) Size() int
- type MemoryCacheCleaner
- type MemoryCacheItem
Constants ¶
View Source
const DefaultExpiration time.Duration = 0
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MemoryCache ¶
type MemoryCache struct {
// contains filtered or unexported fields
}
func NewMemoryCache ¶
func NewMemoryCache(defaultExpiration time.Duration, items map[string]MemoryCacheItem) *MemoryCache
func NewMemoryCacheWithCleaner ¶
func NewMemoryCacheWithCleaner(defaultExpiration, cleanInterval time.Duration, items map[string]MemoryCacheItem) *MemoryCache
func (*MemoryCache) Delete ¶
func (c *MemoryCache) Delete(keys ...string)
func (*MemoryCache) DeleteExpired ¶
func (c *MemoryCache) DeleteExpired()
func (*MemoryCache) Flush ¶
func (c *MemoryCache) Flush()
func (*MemoryCache) Get ¶
func (c *MemoryCache) Get(key string) (interface{}, bool)
func (*MemoryCache) GetExpiration ¶
func (c *MemoryCache) GetExpiration(key string) (interface{}, time.Time, bool)
func (*MemoryCache) Items ¶
func (c *MemoryCache) Items() map[string]interface{}
func (*MemoryCache) Set ¶
func (c *MemoryCache) Set(key string, value interface{}, expiration time.Duration)
func (*MemoryCache) SetDefault ¶
func (c *MemoryCache) SetDefault(key string, value interface{})
func (*MemoryCache) Size ¶
func (c *MemoryCache) Size() int
type MemoryCacheCleaner ¶
type MemoryCacheCleaner struct {
// contains filtered or unexported fields
}
type MemoryCacheItem ¶
type MemoryCacheItem struct {
Object interface{}
Expiration int64
}
func (MemoryCacheItem) Expired ¶
func (item MemoryCacheItem) Expired() bool
Click to show internal directories.
Click to hide internal directories.