https://github.com/alperencantez/chiavalore
🔑 Memory cache server for storing data in key-value pairs.
https://github.com/alperencantez/chiavalore
cache go memcache
Last synced: 12 months ago
JSON representation
🔑 Memory cache server for storing data in key-value pairs.
- Host: GitHub
- URL: https://github.com/alperencantez/chiavalore
- Owner: alperencantez
- License: mit
- Created: 2024-02-29T21:10:33.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-03-17T20:48:23.000Z (almost 2 years ago)
- Last Synced: 2025-01-14T00:35:09.089Z (about 1 year ago)
- Topics: cache, go, memcache
- Language: Go
- Homepage:
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Chiavalore - A Simple Key-Value Memory Cache Library in Go
Chiavalore is a lightweight Go library that provides a simple key-value memory cache implementation. It offers basic functionalities for storing, retrieving, and deleting key-value pairs in memory. The library also includes an HTTP server component for interacting with the cache over HTTP.
## Features
- Easy-to-use API for setting, getting, and deleting key-value pairs.
- Support for concurrent access with built-in synchronization using mutex.
- Simple HTTP server for interacting with the cache over HTTP.
## Installation
To use Chiavalore in your Go project, you can install it via `go get`:
```bash
go get github.com/alperencantez/chiavalore
```
## Usage
```go
package main
import (
"fmt"
"net/http"
"github.com/alperencantez/chiavalore/cache"
"github.com/alperencantez/chiavalore/server"
)
func main() {
const PORT = 8080
var cv_cache *cache.CV_Cache = cache.InitCV_Cache() // initialize Chiavalore
// Route definition for handler server
http.HandleFunc("/cache/", server.CacheHandler(cv_cache))
fmt.Printf("Chiavalore mem-cache server is up and running on %d", PORT)
if err := http.ListenAndServe(":8080", nil); err != nil {
fmt.Println("Server error:", err)
}
}
```
## Contribution
Contributions to Chiavalore are welcome! If you find any bugs, have feature requests, or want to contribute improvements, feel free to open an issue or submit a pull request on GitHub.