Help us shape the future of Go! Take the 2026 Go Developer Survey

baradb-http

command module
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 7, 2026 License: MIT Imports: 4 Imported by: 0

README

baradb-http

baradb-http is a simple HTTP service that is built on the top of baradb, a key/value storage engine.

It uses web framework gin.

Install

$ go install github.com/saint-yellow/baradb-http@latest

Executing this command will add a binary file callled baradb-http to your ${GOPATH}/bin.

APIs

Use the exposed web APIs shown below to access the storage engine.

HTTP Method Route Description
GET /baradb/keys Get all keys
POST /baradb Append a key/value pair
DELETE /baradb/:key Delete a key/value pair by the given key
GET /baradb/:key Get the value of the given key
GET /baradb/stat Get the statistical information

Usage

Suppose the ${GOPATH}/bin/baradb-http is in your ${PATH}, you can use it like this:

$ baradb-http &

$ curl http://localhost:8080/baradb/stat
{"success":true,"message":"ok","data":"keyNumber":0,"dataFileNumber":0,"reclaimableSize":0,"diskSize":0}%

$ curl -X POST -d '{"key":"key001","value":"value001"}' http://localhost:8080/baradb/
{"success":true,"message":"ok"}%

$ curl http://localhost:8080/baradb/keys
{"success":true,"message":"ok","data":["key001"]}%

$ curl http://localhost:8080/baradb/key001
{"success":true,"message":"ok","data":"value001"}%

$ curl -X DELETE http://localhost:8080/baradb/key001
{"success":true,"message":"ok"}%

Contributing

PRs accepted.

License

MIT © Saint-Yellow

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL