https://github.com/d1ksim/in-memory-cache-go
Golang tool for storing data in the system RAM
https://github.com/d1ksim/in-memory-cache-go
go golang in-memory-caching
Last synced: 3 months ago
JSON representation
Golang tool for storing data in the system RAM
- Host: GitHub
- URL: https://github.com/d1ksim/in-memory-cache-go
- Owner: d1ksim
- License: mit
- Created: 2022-12-19T06:37:52.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-12-19T07:23:36.000Z (over 2 years ago)
- Last Synced: 2024-06-21T12:18:07.088Z (about 1 year ago)
- Topics: go, golang, in-memory-caching
- Language: Go
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# in-memory-cache-go
Golang tool for storing data in the system RAMMy first experience as a development package for storing data of the in-memory-cache type
## Example
```go
package mainimport (
"fmt"
"github.com/d1mpi/in-memory-cache-go"
)func main() {
newCache := cache.New()
setErr := newCache.Set("Alina", 12)
if setErr != nil {
fmt.Println(err)
return
}userId, getErr := newCache.Get("Alina")
if getErr != nil {
fmt.Println(err)
return
} else {
fmt.Println(userId)
}delErr := newCache.Delete("Alina")
if delErr != nil {
fmt.Println(err)
return
}userId = newCache.Get("Alina")
fmt.Println(userId)
}
```## Install
Use go get -u github.com/d1mpi/in-memory-cache-go