You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP

github.com/wunderlist/ttlcache

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/wunderlist/ttlcache

v0.0.0-20180801091818-7dbceb0d5094
Version published
Created

TTLCache - an in-memory LRU cache with expiration

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

  • Thread-safe
  • Auto-Expiring after a certain time
  • 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()
}

FAQs

Package last updated on 01 Aug 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts