Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
timedmap
✓ github.com/zekroTJA/timedmap
Create a timed map and set a key with TTL
package main
import (
"fmt"
"time"
"github.com/zekroTJA/timedmap"
)
func main() {
tm := timedmap.New(0)
tm.Set("key", "value", 1*time.Second)
val, ok := tm.Get("key")
fmt.Println(val, ok)
time.Sleep(2 * time.Second)
val, ok = tm.Get("key")
fmt.Println(val, ok)
}
Debug
Known issues
No known issues recorded.
Upgrade
Version history
1.5.2latest on pkg.go.dev
Audit
Dependencies
No dependency data recorded yet.