Skip to content
/ ttlmap Public

Efficient concurrent map implementation with TTL support.

License

Notifications You must be signed in to change notification settings

Job79/ttlmap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ttlmap

Efficient concurrent map with TTL support. See the documentation for more information.

ttlmap := New[string, string](time.Hour, time.Minute)
ttlmap.Store("key", "value")

val, ok := ttlmap.Load("key", "value")
val, ok := ttlmap.LoadOrStore("key", "value")
val, ok := ttlmap.LoadAndDelete("key")
ttlmap.Delete("key")
ttlmap.Range(func(key string, value string) bool {
	fmt.Println(key)
	return true
})

About

Efficient concurrent map implementation with TTL support.

Resources

License

Stars

Watchers

Forks

Languages