https://github.com/dastergon/golang-timemap
Time-based key-value store for Go
https://github.com/dastergon/golang-timemap
go golang golang-datastructure golang-library golang-package map
Last synced: 8 months ago
JSON representation
Time-based key-value store for Go
- Host: GitHub
- URL: https://github.com/dastergon/golang-timemap
- Owner: dastergon
- License: mit
- Created: 2019-10-11T20:11:02.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-10-15T08:45:40.000Z (over 6 years ago)
- Last Synced: 2025-02-08T14:23:28.130Z (over 1 year ago)
- Topics: go, golang, golang-datastructure, golang-library, golang-package, map
- Language: Go
- Homepage: https://pkg.go.dev/github.com/dastergon/golang-timemap
- Size: 3.91 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# golang-timemap
A thread-safe time-based key-value store for Go.
## Documentation
Full docs are available on [Godoc](http://godoc.org/github.com/dastergon/golang-timemap)
## Example
```go
func main() {
l := timemap.New()
l.Set("name", "Rustacean", time.Now())
time.Sleep(10 * time.Millisecond)
l.Set("name", "Gopher", time.Now())
v, _ := l.Get("name", time.Now())
fmt.Println(v) # Expect "Gopher" :-)
}
```