Overview
KVS is a key-value store written in Go. It provides an in-memory store that can be used as a library, via its CLI, or as a server with HTTP and gRPC interfaces.
Features
- In-memory key-value store — thread-safe
StorewithGet,Put,Delete - HTTP server — JSON REST API at
/v1/keys/{key}with health check at/healthz - gRPC server — protobuf-based KV service with gRPC health checking
- Cobra/Viper CLI —
servecommand with configurable listen addresses - Library — import
github.com/skyoo2003/kvsdirectly in Go programs - Docker — container images published to
ghcr.io/skyoo2003/kvs
Installation
From source
go install github.com/skyoo2003/kvs/cmd/kvs@latest
Docker
docker run ghcr.io/skyoo2003/kvs:latest-alpine
Homebrew
brew install skyoo2003/tap/kvs
Quick Start
CLI
kvs serve # start HTTP (:3456) and gRPC (:3457) servers
kvs serve --http-addr :8080 # custom HTTP address
kvs version # print version
Library
Import github.com/skyoo2003/kvs to use KVS as a library:
package main
import (
"fmt"
"github.com/skyoo2003/kvs"
)
func main() {
store := kvs.NewStore()
_ = store.Put("language", "go")
value, _ := store.Get("language")
fmt.Println(value)
}
License
MIT License. See LICENSE for details.