Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/couchbase/Goforestdb
Go bindings for ForestDB
https://github.com/couchbase/Goforestdb
Last synced: 20 days ago
JSON representation
Go bindings for ForestDB
- Host: GitHub
- URL: https://github.com/couchbase/Goforestdb
- Owner: couchbase
- License: apache-2.0
- Fork: true (deepkaran/goforestdb)
- Created: 2014-05-14T15:36:12.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-12-15T22:01:01.000Z (almost 8 years ago)
- Last Synced: 2024-07-31T01:23:23.905Z (4 months ago)
- Language: Go
- Size: 90.8 KB
- Stars: 37
- Watchers: 38
- Forks: 6
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# goforestdb
Go bindings for ForestDB
## Building
1. Obtain and build forestdb: https://github.com/couchbaselabs/forestdb (run `make install` to install the library)
1. Install header files to system location
1. On Ubuntu 14.04: `cd && mkdir /usr/local/include/libforestdb && cp include/libforestdb/* /usr/local/include/libforestdb`
1. `go get -u -v -t github.com/couchbase/goforestdb`## Documentation
See [godocs](http://godoc.org/github.com/couchbase/goforestdb)
## 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)