# README
Go Wrapper for ZFS
Simple wrappers for ZFS command line tools.
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 omitted
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
# Functions
CreateFilesystem creates a new ZFS filesystem with the specified name and properties.
CreateVolume creates a new ZFS volume with the specified name, size, and properties.
CreateZpool creates a new ZFS zpool with the specified name, properties, and optional arguments.
Datasets returns a slice of ZFS datasets, regardless of type.
Filesystems returns a slice of ZFS filesystems.
GetDataset retrieves a single ZFS dataset by name.
GetZpool retrieves a single ZFS zpool by name.
ListZpools list all ZFS zpools accessible on the current system.
ReceiveSnapshot receives a ZFS stream from the input io.Reader.
SetLogger set a log handler to log all commands including arguments before they are executed.
Snapshots returns a slice of ZFS snapshots.
Volumes returns a slice of ZFS volumes.
# Constants
Types of Inodes.
Types of Inodes.
Types of Changes.
ZFS dataset types, which can indicate if a dataset is a filesystem, snapshot, or volume.
ZFS dataset types, which can indicate if a dataset is a filesystem, snapshot, or volume.
ZFS dataset types, which can indicate if a dataset is a filesystem, snapshot, or volume.
Valid destroy options.
Valid destroy options.
Valid destroy options.
Valid destroy options.
Valid destroy options.
Types of Inodes.
Types of Inodes.
Types of Inodes.
Types of Inodes.
Types of Changes.
Types of Inodes.
Types of Changes.
Types of Changes.
Types of Inodes.
Types of Inodes.
ZFS zpool states, which can indicate if a pool is online, offline, degraded, etc.
ZFS zpool states, which can indicate if a pool is online, offline, degraded, etc.
ZFS zpool states, which can indicate if a pool is online, offline, degraded, etc.
ZFS zpool states, which can indicate if a pool is online, offline, degraded, etc.
ZFS zpool states, which can indicate if a pool is online, offline, degraded, etc.
ZFS zpool states, which can indicate if a pool is online, offline, degraded, etc.
# Structs
Dataset is a ZFS dataset.
Error is an error which is returned when the `zfs` or `zpool` shell commands return with a non-zero exit code.
InodeChange represents a change as reported by Diff.
Zpool is a ZFS zpool.
# Interfaces
Logger can be used to log commands/actions.
# Type aliases
ChangeType is the type of inode change as reported by Diff.
DestroyFlag is the options flag passed to Destroy.
InodeType is the type of inode as reported by Diff.