Giter Club home page Giter Club logo

boltdb-server's Introduction

BoltDB Server
Build Status Code Coverage GoDoc

A fancy server for Bolt databases

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.