All Projects → microsoftarchive → Ttlcache

microsoftarchive / Ttlcache

Licence: mit
an in-memory LRU string-string map with expiration for golang

Programming Languages

go
31211 projects - #10 most used programming language

TTLCache - an in-memory LRU cache with expiration

TTLCache is a minimal wrapper over a string map in golang, entries of which are

  1. Thread-safe
  2. Auto-Expiring after a certain time
  3. Auto-Extending expiration on Gets

Build Status

Usage

import (
  "time"
  "github.com/wunderlist/ttlcache"
)

func main () {
  cache := ttlcache.NewCache(time.Second)
  cache.Set("key", "value")
  value, exists := cache.Get("key")
  count := cache.Count()
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].