cache

package
v0.0.0-...-3bbbb78 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Evict

func Evict(cache *LRUCache)

Remove the last item of the map

func New

func New(cacheConfig *model.CacheConfig) model.Cache

Types

type LRUCache

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

func NewLRU

func NewLRU(capacity int) *LRUCache

The new will initialize the map and linkedList

func (*LRUCache) Get

func (cache *LRUCache) Get(key string) string

Return the value of the key or -1 when it is not found

func (*LRUCache) Put

func (cache *LRUCache) Put(key, value string)

Jump to

Keyboard shortcuts

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