• Home
  • History
  • Annotate
  • only in this directory
Name Date Size

..11-Jan-20224 KiB

.gitignoreH A D11-Jan-2022274

advlock.goH A D11-Jan-2022637

commit.goH A D11-Jan-20222.1 KiB

commit_test.goH A D11-Jan-20222.1 KiB

config.goH A D11-Jan-20226 KiB

doc.goH A D11-Jan-20224.1 KiB

docs.goH A D11-Jan-2022521

error.goH A D11-Jan-202210.6 KiB

error.shH A D11-Jan-20221.2 KiB

examples/custom_comparator/H11-Jan-20224 KiB

file.goH A D11-Jan-20228.4 KiB

forestdb.goH A D11-Jan-20225.2 KiB

forestdb_test.goH A D11-Jan-20225.2 KiB

info.goH A D11-Jan-20221.8 KiB

iterator.goH A D11-Jan-20227.1 KiB

iterator_test.goH A D11-Jan-20229.6 KiB

kv.goH A D11-Jan-20222.4 KiB

kv_test.goH A D11-Jan-20222.2 KiB

LICENSEH A D11-Jan-202211.1 KiB

log.goH A D11-Jan-2022909

README.mdH A D11-Jan-2022975

snapshot_marker.goH A D11-Jan-20222.7 KiB

snapshot_marker_test.goH A D11-Jan-20223.6 KiB

README.md

1# goforestdb
2
3Go bindings for ForestDB
4
5## Building
6
71.  Obtain and build forestdb: https://github.com/couchbaselabs/forestdb (run `make install` to install the library)
81.  Install header files to system location
9  1. On Ubuntu 14.04: `cd <forestdb_project_dir> && mkdir /usr/local/include/libforestdb && cp include/libforestdb/* /usr/local/include/libforestdb`
101.  `go get -u -v -t github.com/couchbase/goforestdb`
11
12## Documentation
13
14See [godocs](http://godoc.org/github.com/couchbase/goforestdb)
15
16## Sample usage (without proper error handling):
17
18	// Open a database
19	db, _ := Open("test", nil)
20
21	// Close it properly when we're done
22	defer db.Close()
23
24	// Store the document
25	doc, _ := NewDoc([]byte("key"), nil, []byte("value"))
26	defer doc.Close()
27	db.Set(doc)
28
29	// Lookup the document
30	doc2, _ := NewDoc([]byte("key"), nil, nil)
31	defer doc2.Close()
32	db.Get(doc2)
33
34	// Delete the document
35	doc3, _ := NewDoc([]byte("key"), nil, nil)
36	defer doc3.Close()
37	db.Delete(doc3)
38