cri-o/vendor/github.com/mistifyio/go-zfs
Mrunal Patel 8e5b17cf13 Switch to github.com/golang/dep for vendoring
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
2017-01-31 16:45:59 -08:00
..
.gitignore Build and install from GOPATH 2017-01-17 12:09:09 -08:00
CONTRIBUTING.md Build and install from GOPATH 2017-01-17 12:09:09 -08:00
error.go Build and install from GOPATH 2017-01-17 12:09:09 -08:00
error_test.go Switch to github.com/golang/dep for vendoring 2017-01-31 16:45:59 -08:00
LICENSE Build and install from GOPATH 2017-01-17 12:09:09 -08:00
README.md Build and install from GOPATH 2017-01-17 12:09:09 -08:00
utils.go Switch to github.com/golang/dep for vendoring 2017-01-31 16:45:59 -08:00
Vagrantfile Build and install from GOPATH 2017-01-17 12:09:09 -08:00
zfs.go Switch to github.com/golang/dep for vendoring 2017-01-31 16:45:59 -08:00
zfs_test.go Switch to github.com/golang/dep for vendoring 2017-01-31 16:45:59 -08:00
zpool.go Switch to github.com/golang/dep for vendoring 2017-01-31 16:45:59 -08:00

Go Wrapper for ZFS

Simple wrappers for ZFS command line tools.

GoDoc

Requirements

You need a working ZFS setup. To use on Ubuntu 14.04, setup ZFS:

sudo apt-get install python-software-properties
sudo apt-add-repository ppa:zfs-native/stable
sudo apt-get update
sudo apt-get install ubuntu-zfs libzfs-dev

Developed using Go 1.3, but currently there isn't anything 1.3 specific. Don't use Ubuntu packages for Go, use http://golang.org/doc/install

Generally you need root privileges to use anything zfs related.

Status

This has been only been tested on Ubuntu 14.04

In the future, we hope to work directly with libzfs.

Hacking

The tests have decent examples for most functions.

//assuming a zpool named test
//error handling ommitted


f, err := zfs.CreateFilesystem("test/snapshot-test", nil)
ok(t, err)

s, err := f.Snapshot("test", nil)
ok(t, err)

// snapshot is named "test/snapshot-test@test"

c, err := s.Clone("test/clone-test", nil)

err := c.Destroy()
err := s.Destroy()
err := f.Destroy()

Contributing

See the contributing guidelines