Skip to content
Go bindings for ForestDB
Go C
Branch: master
Clone or download
Pull request Compare This branch is 66 commits ahead of deepkaran:master.
mikewied and Michael Wiederhold MB-21962: Add ability to define compaction callbacks in the config
Change-Id: I58abf7c4bc3f1014ec689e86b7f51cab62ad475f
Reviewed-on: http://review.couchbase.org/70967
Reviewed-by: Marty Schoch <marty.schoch@gmail.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>
Latest commit 0b50122 Dec 15, 2016
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples/custom_comparator CBD-1513: Rename all couchbaselabs Go projects to github.com/couchbase. Mar 11, 2015
.gitignore add exclusion for sublime project files to gitignore Oct 29, 2014
LICENSE cleanup May 14, 2014
README.md CBD-1513: Rename all couchbaselabs Go projects to github.com/couchbase. Mar 11, 2015
cgo.go enable using new c-forestdb static linking with build tag 'static' Feb 12, 2016
cgo_static.go enable using new c-forestdb static linking with build tag 'static' Feb 12, 2016
commit.go improve logging Feb 1, 2016
commit_test.go major API changes to be compatible with ForestDB changes Nov 7, 2014
config.go MB-21962: Add ability to define compaction callbacks in the config Dec 15, 2016
doc.go Properly set custom sequence numbers when calling the SetSeqNum API Sep 2, 2015
docs.go cleanup May 14, 2014
error.go add several missing forestdb error codes Oct 2, 2015
file.go MB-18594 - OpenFileKVStore()/CloseFileKVStore() helper funcs Mar 29, 2016
file_test.go MB-17072 - Init() API for forestdb library configuration Jan 19, 2016
forestdb.go MB-21962: Add ability to define compaction callbacks in the config Dec 15, 2016
forestdb_test.go Add API's for getting the list of kvstore names Jan 6, 2016
info.go add support for fdb_kvs_ops_info Feb 2, 2016
info_test.go add support for fdb_kvs_ops_info Feb 2, 2016
iterator.go improve logging Feb 1, 2016
iterator_test.go fix test base broken by forestdb default config change Mar 18, 2016
kv.go improve logging Feb 1, 2016
kv_test.go fix formatting issue identified by go vet Dec 16, 2015
kvbatch.go
kvbatch_test.go fix kvbatch to support setting values of length 0 Feb 25, 2016
log.go change implementation of log callbacks to work in go 1.6 Mar 6, 2016
log.h change implementation of log callbacks to work in go 1.6 Mar 6, 2016
log_test.go change implementation of log callbacks to work in go 1.6 Mar 6, 2016
pool.go introduce new KVPool to aid in concurrent usage Oct 2, 2015
pool_test.go introduce new KVPool to aid in concurrent usage Oct 2, 2015
snapshot_marker.go
snapshot_marker_test.go Add support for snapshot marker apis Feb 12, 2015
tx.go improve logging Feb 1, 2016
tx_test.go add support for forestdb transactions Oct 20, 2015

README.md

goforestdb

Go bindings for ForestDB

Building

  1. Obtain and build forestdb: https://github.com/couchbaselabs/forestdb (run make install to install the library)
  2. Install header files to system location
  3. On Ubuntu 14.04: cd <forestdb_project_dir> && mkdir /usr/local/include/libforestdb && cp include/libforestdb/* /usr/local/include/libforestdb
  4. go get -u -v -t github.com/couchbase/goforestdb

Documentation

See godocs

Sample usage (without proper error handling):

// Open a database
db, _ := Open("test", nil)

// Close it properly when we're done
defer db.Close()

// Store the document
doc, _ := NewDoc([]byte("key"), nil, []byte("value"))
defer doc.Close()
db.Set(doc)

// Lookup the document
doc2, _ := NewDoc([]byte("key"), nil, nil)
defer doc2.Close()
db.Get(doc2)

// Delete the document
doc3, _ := NewDoc([]byte("key"), nil, nil)
defer doc3.Close()
db.Delete(doc3)
You can’t perform that action at this time.