Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yiplee/go-cache
go-cache is a simple, fast, and efficient in-memory cache written in Go.
https://github.com/yiplee/go-cache
Last synced: about 6 hours ago
JSON representation
go-cache is a simple, fast, and efficient in-memory cache written in Go.
- Host: GitHub
- URL: https://github.com/yiplee/go-cache
- Owner: yiplee
- License: apache-2.0
- Created: 2022-07-08T08:28:32.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-07-16T13:35:49.000Z (over 2 years ago)
- Last Synced: 2023-10-24T09:26:42.293Z (about 1 year ago)
- Language: Go
- Size: 13.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-cache
go-cache is a simple, fast, and efficient in-memory cache written in Go.
### Installation
```bash
go get github.com/yiplee/go-cache
```### Example
```go
package cache-exampleimport (
"fmt"
"github.com/yiplee/go-cache"
)func main() {
cache := cache.New[string]()
cache.Set("key", "value", cache.WithTTL(10 * time.Second))
value, ok := cache.Get("key")
fmt.Println(value, ok)
}```