memorycache

package
v0.30.0 Latest Latest
Warning

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

Go to latest
Published: May 10, 2022 License: Apache-2.0 Imports: 6 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 string) error

func (*Cache) Get

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

func (*Cache) GetAll

func (c *Cache) GetAll() (map[string]interface{}, error)

func (*Cache) Put

func (c *Cache) Put(key string, 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 string) error

func (*LRUCache) Get

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

func (*LRUCache) GetAll

func (c *LRUCache) GetAll() (map[string]interface{}, error)

func (*LRUCache) Put

func (c *LRUCache) Put(key string, 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 string) error

func (*TTLCache) Get

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

func (*TTLCache) GetAll

func (c *TTLCache) GetAll() (map[string]interface{}, error)

func (*TTLCache) Put

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

Jump to

Keyboard shortcuts

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