Skip to content

codinl/ttlmap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TtlMap - an in-memory TTL map with expiration

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

Usage

import (
  "time"
  "github.com/codinl/ttlmap"
)

func main () {
  m := ttlmap.NewTtlMap(time.Second)
  m.Set("key", "value")
  value, exists := m.Get("key")
  count := m.Count()
}

Releases

No releases published

Packages

No packages published

Languages