Documentation ¶
Overview ¶
Package zfs provides wrappers around the ZFS command line tools
Index ¶
- Constants
- type Dataset
- func CreateFilesystem(name string, properties map[string]string) (*Dataset, error)
- func CreateVolume(name string, size uint64, properties map[string]string) (*Dataset, error)
- func Datasets(filter string) ([]*Dataset, error)
- func Filesystems(filter string) ([]*Dataset, error)
- func GetDataset(name string) (*Dataset, error)
- func ReceiveSnapshot(input io.Reader, name string) (*Dataset, error)
- func Snapshots(filter string) ([]*Dataset, error)
- func Volumes(filter string) ([]*Dataset, error)
- func (d *Dataset) Children(depth uint64) ([]*Dataset, error)
- func (d *Dataset) Clone(dest string, properties map[string]string) (*Dataset, error)
- func (d *Dataset) Destroy(recursive bool) error
- func (d *Dataset) GetProperty(key string) (string, error)
- func (d *Dataset) Rollback(destroyMoreRecent bool) error
- func (d *Dataset) SendSnapshot(output io.Writer) error
- func (d *Dataset) SetProperty(key, val string) error
- func (d *Dataset) Snapshot(name string, recursive bool) (*Dataset, error)
- func (d *Dataset) Snapshots() ([]*Dataset, error)
- type Error
- type Zpool
Constants ¶
const ( Byte = 1 KByte = Byte * 1024 MByte = KByte * 1024 GByte = MByte * 1024 TByte = GByte * 1024 PByte = TByte * 1024 EByte = PByte * 1024 )
based on https://github.com/dustin/go-humanize/blob/master/bytes.go
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dataset ¶
type Dataset struct { Name string Used uint64 Avail uint64 Mountpoint string Compression string Type string Written uint64 Volsize uint64 Usedbydataset uint64 Quota uint64 }
Dataset is a zfs dataset. This could be a volume, filesystem, snapshot. Check the type field The field definitions can be found in the zfs manual: http://www.freebsd.org/cgi/man.cgi?zfs(8)
func CreateFilesystem ¶
CreateFilesystem creates a new filesystem
func CreateVolume ¶
CreateVolume creates a new volume
func Filesystems ¶
Filesystems returns a slice of all filesystems
func GetDataset ¶
GetDataset retrieves a single dataset
func ReceiveSnapshot ¶
ReceiveSnapshot receives a zfs stream into a new snapshot
func (*Dataset) Children ¶
Children returns the children of the dataset. Depth of 0 does not limit recursion.
func (*Dataset) Clone ¶
Clone clones a snapshot. An error will be returned if a non-snapshot is used
func (*Dataset) GetProperty ¶
GetProperty Gets a property
func (*Dataset) SendSnapshot ¶
SendSnapshot sends a snapshot as a zfs stream
func (*Dataset) SetProperty ¶
SetProperty sets a property
type Error ¶
Error is an error which is returned when the `zfs` or `zpool` shell commands return with a non-zero exit code.