Skip to content

Go Cache is a least recently used caching mechanism. Check README for more details

Notifications You must be signed in to change notification settings

georgethomas111/lrucache

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

lrucache

Go Cache is a least recently used caching mechanism.

Example :

package main

import ( "lrucache" "fmt" "runtime" )

// End of Lib. Test Code follows

type MyInt int var UserStore *lrucache.CacheStore

func (mI MyInt) Save () { fmt.Println ("Saving ", mI) }

func main () { var value MyInt UserStore = lrucache.NewCacheStore (10) for i := 0; i <= 1000; i++ {

    value     = MyInt(i)
valueElem := lrucache.NewValueElem (value, UserStore)
fmt.Println ("Adding", valueElem.Value) 
UserStore.Add (fmt.Sprintf ("%d", i), *valueElem)
}

//delay

for i := 0 ; i < 1000000000; i++ { runtime.Gosched () }

}

Details Later !!!

About

Go Cache is a least recently used caching mechanism. Check README for more details

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published