- Thread-safe
- Auto-Expiring after a certain time
- Auto-Extending expiration on
Get
s
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()
}