cache

package
v0.0.0-...-94d2ec4 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultCacheCapacity = 1000

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

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

func New

func New() *Cache

func (*Cache) Clear

func (c *Cache) Clear(name string)

Clear removes all the element within cache.

func (*Cache) Get

func (c *Cache) Get(name, key string) []byte

Get returns the value associated with key within specific cache.

func (*Cache) Put

func (c *Cache) Put(name, key string, value []byte)

Put Puts value at a key location under a specified cache. It initializes an empty cache if name does not exist. It returns zero if there is already a value at specified key, returns 1 otherwise.

func (*Cache) Remove

func (c *Cache) Remove(name, key string)

Remove removes value specified by key from a cache. It ignores if key is not in the cache.

Jump to

Keyboard shortcuts

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