8000 GitHub - msvitok77/lruttl: Go LRU Cache with time based eviction (based on Google Vitesse Cache)
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

msvitok77/lruttl

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Time Evict LRU

At least Go 1.18 required. This is a modification of the Vitesse LRU to include Time Based Eviction

http://code.google.com/p/vitess/source/browse/go/cache

example::

l := lruttl.NewTimeEvictLru(10000, 10*time.Minute, 1*time.Second)

l.EvictCallback = func(key string, v lruttl.Value) {
	fmt.Println("evicting ", key)
}

for i := 0; i < 100; i++ {
	istr := strconv.FormatInt(int64(i), 10)
	l.Set("key"+istr, &CacheValue{i})
}

About

Go LRU Cache with time based eviction (based on Google Vitesse Cache)

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 100.0%
0