Skip to content
 
 

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cache

A golang memcache with LRU to swap

Install

go get github.com/g4zhuj/cache

Usage

init

// If maxItemSize is zero, the cache has no limit.
	var cache Cache
	maxSize = 1024
	cache = NewMemCache(maxSize)

Get

value, ok := cache.Get("key")

Set

cache.Set("key", "value")

Delete

cache.Delete("delKey")

Status

status := cache.Status()
fmt.Println("Gets Count: ",	status.Gets)
fmt.Println("Hits Count: ",	status.Hits)
fmt.Println("MaxItemSize: ",	status.MaxItemSize)
fmt.Println("CurrentSize: ",	status.CurrentSize)

About

A golang memcache with LRU to swap

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages