🚀 Big News:Socket Has Acquired Secure Annex.Learn More →
Socket
Book a DemoSign in
Socket

github.com/wunderlist/ttlcache

Package Overview
Dependencies
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/wunderlist/ttlcache

Source
Go Modules
Version
v0.0.0-20180801091818-7dbceb0d5094
Version published
Created
Source

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