Pure Go implementation of D. J. Bernstein's cdb constant database library.
Go
Latest commit 206e6df Jun 11, 2013 @jbarham Add BSD license
Failed to load latest commit information.
cdbdump Use the correct import path for go-cdb in cdbdump and cdbmake May 29, 2012
cdbmake Use the correct import path for go-cdb in cdbdump and cdbmake May 29, 2012
.gitignore Do not gitignore cbddump/ and cdbmake/ May 29, 2012
LICENSE Add BSD license Jun 11, 2013
README.md Update package URLs and add comments re: cdb format features Apr 3, 2012
cdb.go return io.EOF when hash table is empty Feb 7, 2013
cdb_test.go Spelling Feb 8, 2013
dump.go
hash.go Add BlockSize Feb 17, 2012
make.go

README.md

go-cdb

go-cdb is a pure Go package to read and write cdb ("constant database") files.

The cdb file format is a machine-independent format with the following features:

  • Fast lookups: A successful lookup in a large database normally takes just two disk accesses. An unsuccessful lookup takes only one.
  • Low overhead: A database uses 2048 bytes, plus 24 bytes per record, plus the space for keys and data.
  • No random limits: cdb can handle any database up to 4 gigabytes. There are no other restrictions; records don't even have to fit into memory.

See the original cdb specification and C implementation by D. J. Bernstein at http://cr.yp.to/cdb.html.

Installation

Assuming you have a working Go environment, installation is simply:

go get github.com/jbarham/go-cdb

The package documentation can be viewed online at http://gopkgdoc.appspot.com/pkg/github.com/jbarham/go-cdb or on the command line by running go doc github.com/jbarham/go-cdb.

The included self-test program cdb_test.go illustrates usage of the package.

Utilities

The go-cdb package includes ports of the programs cdbdump and cdbmake from the original implementation.