twowaykv

command module
v0.0.0-...-6cff232 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2020 License: MIT Imports: 10 Imported by: 0

README

twowaykv

Web server for easy look up of value -> key and key -> value, for integration with big-data graph DB. Uses BadgerDB as underlying store.

CircleCI Maintainability Test Coverage

Install

go install github.com/dgoldstein1/twowaykv

or

docker pull dgoldstein1/twowaykv:latest

Run it

export GRAPH_DB_STORE_DIR="/tmp/twowaykv" # storage directory
export GRAPH_DB_STORE_PORT="5001" # port served on. Will also use PORT
export GRAPH_DOCS_DIR="./api/*" # location of docs (warning: this entire dir is served up to the browser)
./twowaykv serve
# make example request
curl -X POST -H "Content-Type: application/json"  -d '["test1", "test3", "test5", "test6", "test6"]' http://localhost:5001/entries | jq
# retrieve the entries we just created
curl -X POST -H "Content-Type: application/json"  -d '["test1", "test3", "test5", "test6", "test6"]' http://localhost:5001/entriesFromKeys | jq
...
# get two random entries
curl localhost:5001/random?n= | jq
[{"key":"test3","value":653544572}]

Development

Local Development
./watch_dev_changes.sh
Testing
go test $(go list ./... | grep -v /vendor/)

Generating New Documentation

pip install PyYAML
python api/swagger-yaml-to-html.py < api/swagger.yml > api/index.html

Authors

License

This project is licensed under the MIT License - see the LICENSE file for details

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