Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yuseferi/gocache
Gocache is an in-memory key:value store/cache (similar to Memcached) library for Go, suitable for single-machine applications. it is safe with concorent go routine access.
https://github.com/yuseferi/gocache
cache go-parallel-caching gocache golang parallel-cache
Last synced: 2 months ago
JSON representation
Gocache is an in-memory key:value store/cache (similar to Memcached) library for Go, suitable for single-machine applications. it is safe with concorent go routine access.
- Host: GitHub
- URL: https://github.com/yuseferi/gocache
- Owner: yuseferi
- License: gpl-3.0
- Created: 2023-06-09T21:33:06.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-03-04T12:05:07.000Z (10 months ago)
- Last Synced: 2024-07-31T20:49:00.754Z (5 months ago)
- Topics: cache, go-parallel-caching, gocache, golang, parallel-cache
- Language: Go
- Homepage:
- Size: 24.4 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
- awesome-go - gocache - A data race free Go ache library with high performance and auto pruge functionality (Database / Caches)
README
# gocache (basic go in-memory caching)
[![codecov](https://codecov.io/github/yuseferi/gocache/graph/badge.svg?token=98CX2MN5XF)](https://codecov.io/github/yuseferi/gocache)
[![CodeQL](https://github.com/yuseferi/gocache/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/yuseferi/gocache/actions/workflows/github-code-scanning/codeql)
[![Check & Build](https://github.com/yuseferi/gocache/actions/workflows/ci.yml/badge.svg)](https://github.com/yuseferi/gocache/actions/workflows/ci.yml)
[![License: AGPL v3](https://img.shields.io/badge/License-AGPL_v3-blue.svg)](https://www.gnu.org/licenses/agpl-3.0)
![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/yuseferi/gocache)gocache is a data race-free cache implementation in Go, providing efficient caching capabilities for your applications.
### Installation
```shell
go get -u github.com/yuseferi/gocache
```### Usage:
```Go
cache := gocache.NewCache(time.Minute * 2) // with 2 minutes interval cleaning expired items
cache.Set("key", "value", time.Minute) // set cache
value, found := cache.Get("key") // retrive cache data
cache.Delete("key") // delete specific key manually
cache.Clear() // clear all cache items ( purge)
size := cache.Size() // get cache size
```### Contributing
We strongly believe in open-source ❤️😊. Please feel free to contribute by raising issues and submitting pull requests to make gocache even better!Released under the [GNU GENERAL PUBLIC LICENSE](LICENSE).