https://github.com/schollz/boltdb-server
Fancy server and Go package for connecting to BoltDB databases
https://github.com/schollz/boltdb-server
Last synced: 6 months ago
JSON representation
Fancy server and Go package for connecting to BoltDB databases
- Host: GitHub
- URL: https://github.com/schollz/boltdb-server
- Owner: schollz
- License: mit
- Created: 2017-03-14T01:49:46.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-06-10T13:51:26.000Z (over 8 years ago)
- Last Synced: 2025-04-19T23:53:56.366Z (6 months ago)
- Language: Go
- Homepage:
- Size: 49.8 KB
- Stars: 21
- Watchers: 7
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
A fancy server for Bolt databases
*boltdb-server* is a server and package (`connect`) for remotely interfacing
with [boltdb/bolt](https://github.com/boltdb/bolt), a pure-Go embedded key/value database.Features
========- Automatic compression of values
- Simple API for getting, setting, moving, popping and deleting BoltDB data
- Package for adding to your Go programsGetting Started
===============## Installing
To start using the server, install Go and run `go get`:
```sh
$ go get -u github.com/schollz/boltdb-server/...
```This will retrieve the library and the server.
## Run
Run the server using
```sh
$GOPATH/bin/boltdb-server
```Then you can use the server directly (see API below) or plug in a Go program using the connect package, [see tests for more info](https://github.com/schollz/boltdb-server/blob/master/connect/connect_test.go).
## API
```
// Get map of buckets and the number of keys in each
GET /v1/db//stats// Get list of all buckets
GET /v1/db//buckets// Get all keys and values from a bucket
GET /v1/db//bucket//numkeys// Get all keys and values from a bucket
GET /v1/db//bucket//all// Get all keys and values specified by ?keys=key1,key2 or by JSON
GET /v1/db//bucket//some// Delete and return first n keys
GET /v1/db//bucket//pop?n=X// Get all keys in a bucket
GET /v1/db//bucket//keys", handleGetKeys)// Return boolean of whether it has key
GET /v1/db//bucket//haskey/// Return boolean of whether any buckets contain any keys specified by JSON
GET /v1/db//haskeys// Delete database file
DELETE /v1/db/// Delete bucket
DELETE /v1/db//bucket/// Delete keys, where keys are specified by JSON []string
DELETE /v1/db//bucket//keys// Updates a database with keystore specified by JSON
POST /v1/db//bucket//update// Move keys, with buckets and keys specified by JSON
POST /v1/db//move// Create buckets specified by JSON
POST /v1/db//create
```