Skip to content

an in-memory LRU string-string map with expiration for golang

Notifications You must be signed in to change notification settings

thinkslynk/ttlcache

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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()
}

About

an in-memory LRU string-string map with expiration for golang

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%