memorycache

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache struct {
	// contains filtered or unexported fields
}

func NewCache

func NewCache() *Cache

func (*Cache) Delete

func (c *Cache) Delete(key interface{}) error

func (*Cache) Get

func (c *Cache) Get(key interface{}) (interface{}, error)

func (*Cache) Put

func (c *Cache) Put(key interface{}, value interface{}) error

type LRUCache

type LRUCache struct {
	// contains filtered or unexported fields
}

func NewLRUCache

func NewLRUCache(size int) (*LRUCache, error)

func (*LRUCache) Delete

func (c *LRUCache) Delete(key interface{}) error

func (*LRUCache) Get

func (c *LRUCache) Get(key interface{}) (interface{}, error)

func (*LRUCache) Put

func (c *LRUCache) Put(key interface{}, value interface{}) error

type TTLCache

type TTLCache struct {
	// contains filtered or unexported fields
}

func NewTTLCache

func NewTTLCache(ctx context.Context, ttl time.Duration, evictionInterval time.Duration) *TTLCache

func (*TTLCache) Delete

func (c *TTLCache) Delete(key interface{}) error

func (*TTLCache) Get

func (c *TTLCache) Get(key interface{}) (interface{}, error)

func (*TTLCache) Put

func (c *TTLCache) Put(key interface{}, value interface{}) error

Jump to

Keyboard shortcuts

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