boltdb-server

command module
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2017 License: MIT Imports: 18 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

BoltDB Server
Build Status Code Coverage GoDoc

A fancy server for Bolt databases

boltdb-server is a server and package (connect) for interfacing with 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 programs

Getting Started

Installing

To start using the server, install Go and run go get:

$ go get -u github.com/schollz/boltdb-server/...

This will retrieve the library and the server.

Run

Run the server using

$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.

API

// Get map of buckets and the number of keys in each
GET /v1/db/<db>/stats

// Get list of all buckets 
GET /v1/db/<db>/buckets

// Get all keys and values from a bucket
GET /v1/db/<db>/bucket/<bucket>/numkeys

// Get all keys and values from a bucket
GET /v1/db/<db>/bucket/<bucket>/all

// Get all keys and values specified by ?keys=key1,key2 or by JSON
GET /v1/db/<db>/bucket/<bucket>/some

// Delete and return first n keys
GET /v1/db/<db>/bucket/<bucket>/pop?n=X

// Get all keys in a bucket
GET /v1/db/<db>/bucket/<bucket>/keys", handleGetKeys) 

// Return boolean of whether it has key
GET /v1/db/<db>/bucket/<bucket>/haskey/<key>

// Return boolean of whether any buckets contain any keys specified by JSON
GET /v1/db/<db>/haskeys

// Delete database file
DELETE /v1/db/<db>

// Delete bucket
DELETE /v1/db/<db>/bucket/<bucket>

// Delete keys, where keys are specified by JSON []string
DELETE /v1/db/<db>/bucket/<bucket>/keys

// Updates a database with keystore specified by JSON
POST /v1/db/<db>/bucket/<bucket>/update

// Move keys, with buckets and keys specified by JSON
POST /v1/db/<db>/move

// Create buckets specified by JSON
POST /v1/db/<db>/create

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package connect provides functionality for directly accessing a BoltDB server instance with simple functions for posting data, getting data (such as keys and buckets), moving data, deleting data, and popping data.
Package connect provides functionality for directly accessing a BoltDB server instance with simple functions for posting data, getting data (such as keys and buckets), moving data, deleting data, and popping data.

Jump to

Keyboard shortcuts

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