Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

SoftwareEngineerVincent/cache

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

3 Commits

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

License

Stars

Watchers

Forks

Releases

No releases published

Packages

Contributors

Languages

  • Go 100.0%

AltStyle によって変換されたページ (->オリジナル) /