Documentation
¶
Index ¶
- Constants
- func New(defaultExpiration, cleanupInterval time.Duration) *cache.Cache
- type InMemoryStore
- func (c *InMemoryStore) Add(key string, value interface{}, expires time.Duration) error
- func (c *InMemoryStore) Decrement(key string, n int64) error
- func (c *InMemoryStore) Delete(key string) error
- func (c *InMemoryStore) Expire(key string, expires time.Duration) (bool, error)
- func (c *InMemoryStore) Flush() error
- func (c *InMemoryStore) Get(key string, value interface{}) error
- func (c *InMemoryStore) Increment(key string, n int64) error
- func (c *InMemoryStore) Replace(key string, value interface{}, expires time.Duration) error
- func (c *InMemoryStore) Set(key string, value interface{}, expires time.Duration) error
Constants ¶
View Source
const ( NoExpiration = cache.NoExpiration DefaultExpiration = cache.DefaultExpiration )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type InMemoryStore ¶
type InMemoryStore struct {
cache.Cache
}
InMemoryStore represents the cache with memory persistence
func NewInMemoryStore ¶
func NewInMemoryStore(defaultExpiration time.Duration) *InMemoryStore
NewInMemoryStore returns a InMemoryStore
func (*InMemoryStore) Add ¶
func (c *InMemoryStore) Add(key string, value interface{}, expires time.Duration) error
Add (see CacheStore interface)
func (*InMemoryStore) Decrement ¶
func (c *InMemoryStore) Decrement(key string, n int64) error
Decrement (see CacheStore interface)
func (*InMemoryStore) Delete ¶
func (c *InMemoryStore) Delete(key string) error
Delete (see CacheStore interface)
func (*InMemoryStore) Flush ¶
func (c *InMemoryStore) Flush() error
Flush (see CacheStore interface)
func (*InMemoryStore) Get ¶
func (c *InMemoryStore) Get(key string, value interface{}) error
Get (see CacheStore interface)
func (*InMemoryStore) Increment ¶
func (c *InMemoryStore) Increment(key string, n int64) error
Increment (see CacheStore interface)
Click to show internal directories.
Click to hide internal directories.