Skip to content

Gocache is an in-memory key:value store/cache (similar to Memcached) library for Go, suitable for single-machine applications. it is safe with concorent go routine access.

License

Notifications You must be signed in to change notification settings

yuseferi/gocache

Repository files navigation

gocache (basic go in-memory caching)

codecov CodeQL Check & Build License: AGPL v3 GitHub release (latest SemVer)

gocache is a data race-free cache implementation in Go, providing efficient caching capabilities for your applications.

Installation

  go get -u github.com/yuseferi/gocache

Usage:

cache := gocache.NewCache(time.Minute * 2) // with 2 minutes interval cleaning expired items
cache.Set("key", "value", time.Minute) // set cache 
value, found := cache.Get("key") // retrive cache data 
cache.Delete("key") // delete specific key manually
cache.Clear() // clear all cache items ( purge)
size := cache.Size() // get cache size

Contributing

We strongly believe in open-source ❤️😊. Please feel free to contribute by raising issues and submitting pull requests to make gocache even better!

Released under the GNU GENERAL PUBLIC LICENSE.

About

Gocache is an in-memory key:value store/cache (similar to Memcached) library for Go, suitable for single-machine applications. it is safe with concorent go routine access.

Topics

Resources

License

Stars

Watchers

Forks

Languages