• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..09-Aug-2022-

examples/custom_comparator/09-Aug-2022-11184

.gitignoreD09-Aug-2022274 2519

LICENSED09-Aug-202211.1 KiB202169

README.mdD09-Aug-2022975 3826

advlock.goD09-Aug-2022637 4840

commit.goD09-Aug-20222.1 KiB6337

commit_test.goD09-Aug-20222.1 KiB11186

config.goD09-Aug-20226 KiB248176

doc.goD09-Aug-20224.1 KiB178123

docs.goD09-Aug-2022521 281

error.goD09-Aug-202210.6 KiB173163

error.shD09-Aug-20221.2 KiB4134

file.goD09-Aug-20228.4 KiB303209

forestdb.goD09-Aug-20225.2 KiB201143

forestdb_test.goD09-Aug-20225.2 KiB265210

info.goD09-Aug-20221.8 KiB6941

iterator.goD09-Aug-20227.1 KiB256179

iterator_test.goD09-Aug-20229.6 KiB415344

kv.goD09-Aug-20222.4 KiB9357

kv_test.goD09-Aug-20222.2 KiB9867

log.goD09-Aug-2022909 4224

snapshot_marker.goD09-Aug-20222.7 KiB10669

snapshot_marker_test.goD09-Aug-20223.6 KiB179145

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