go get

Go language bindings for daos

by daos-stack

v0.0.0-20170519174826-4e65fcf9e69b (see all)License:Apache-2.0
go get


Go language bindings for the DAOS API

This is a Go interface for DAOS which is also a work in progress. Building this requires a local DAOS build and DAOS server running, so start there first.

Current Status

  • Covers most of the DAOS API, even the unimplemented bits (e.g. punch, etc.)
  • daosfs implements basic POSIX filesystem semantics
  • The daos-fuse utility exposes a daosfs container via FUSE mount
  • libdaosfs exports a C-compatible API for use by things like nfs-ganesha

How to Build

This is a Go project, so a Go development tools are naturally required. We recommend the most current Go release available. As of April 2017, the project has been built and tested with Go 1.8.

Setup environment and build. This assumes $daospath is set as it was in the DAOS README

export GOPATH=$HOME/go  
export LD_LIBRARY_PATH=${daospath}/install/lib
export PATH=${daospath}/install/bin:$PATH
export CGO_CPPFLAGS="-I${daospath}/install/include -I${daospath}/src/include"
export CGO_LDFLAGS=-L${daospath}/install/lib 
go get -u

The last command will clone this repo and and its dependencies, build, and install in the Go workspace. The dcmd binary will be in $GOPATH/bin/dcmd and the source for the package will be $GOPATH/src/ You can build again using:

go install

dcmd utility

Also includes a simple CLI tool for interacting with DAOS. This tool requires the orterun command that was built for DAOS to be on the command line, and will handle running itself with orterun if is run directly. When dcmd calls orterun itself, the default uri file is /tmp/daos-uri or it can be customized with --uri option. See command help for more options and command details.

Example comands to create an container and manipulate objects:

export DAOS_GROUP="" # if needed
export DAOS_POOL=$(dcmd pool create)
dcmd cont create --name mydb
dcmd object update --cont mydb --dkey "a" --akey "1" --value "foo"
dcmd object update --cont mydb --dkey "a" --akey "2" --file /path/to/file
dcmd object fetch --cont mydb --dkey "a" --akey "1"
dcmd object fetch --cont mydb --dkey "a" --akey "2" --binary | sha1sum

By default, fetch will display binary data in "hexdump -C" format. Use the --binary option to read the raw data.

N.B. dcmd does not include a trailing NUL in the string keys, and assumes existing keys do not have them, either.

GitHub Stars



5yrs ago








1yr ago
No alternatives found
No tutorials found
Add a tutorial