memory

package
v0.2.55 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 26, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NoExpiration      = cache.NoExpiration
	DefaultExpiration = cache.DefaultExpiration
)

Variables

This section is empty.

Functions

func New

func New(defaultExpiration, cleanupInterval time.Duration) *cache.Cache

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) Expire

func (c *InMemoryStore) Expire(key string, expires time.Duration) (bool, error)

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)

func (*InMemoryStore) Replace

func (c *InMemoryStore) Replace(key string, value interface{}, expires time.Duration) error

Replace (see CacheStore interface)

func (*InMemoryStore) Set

func (c *InMemoryStore) Set(key string, value interface{}, expires time.Duration) error

Set (see CacheStore interface)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL