cmd

package
v0.0.0-...-e5fe14d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 25, 2018 License: BSD-2-Clause Imports: 4 Imported by: 0

Documentation

Overview

Package cmd provides a thin wrapper around zfs commands

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bookmark

func Bookmark(snapshot, bookmark string) error

Bookmark runs zfs bookmark

func Clone

func Clone(snapshot, name string, opts *CloneOpts) error

Clone runs zfs clone

func CreateFilesystem

func CreateFilesystem(name string, opts *CreateFilesystemOpts) error

CreateFilesystem runs zfs create

func CreateVolue

func CreateVolue(name, size string, opts *CreateVolumeOpts) error

CreateVolue runs zfs create -V

func Destroy

func Destroy(name string, opts *DestroyOpts) error

Destroy runs zfs destroy

func Get

func Get(name string, properties []string, opts *GetOpts) (map[string]map[string]*Property, error)

Get runs zfs get Returns a map indexed by dataset, each of which holds a map indexed by the requested property

func Inherit

func Inherit(name string, property string, opts *InheritOpts) error

Inherit runs zfs inherit

func List

func List(name string, opts *ListOpts) ([]string, error)

List runs zfs list Returns a map indexed by dataset name, which holds maps of the requested properties

func Mount

func Mount(name string, opts *MountOpts) error

Mount runs zfs mount

func Promote

func Promote(name string) error

Promote runs zfs promote

func Rename

func Rename(name, newName string, opts *RenameOpts) error

Rename runs zfs rename

func Rollback

func Rollback(name string, opts *RollbackOpts) error

Rollback runs zfs rollback

func Set

func Set(name string, properties map[string]string) error

Set runs zfs set

func Snapshot

func Snapshot(name string, opts *SnapshotOpts) error

Snapshot runs zfs snapshot

func UnMount

func UnMount(name string, opts *UnMountOpts) error

UnMount runs zfs unmount

Types

type CloneOpts

type CloneOpts struct {
	CreateParents bool
	SetProperties map[string]string
}

CloneOpts are options that can be passed to Clone

type CreateFilesystemOpts

type CreateFilesystemOpts struct {
	SetProperties map[string]string
	DontMount     bool
	CreateParents bool
}

CreateFilesystemOpts are options that can be passed to CreateFilesystem

type CreateVolumeOpts

type CreateVolumeOpts struct {
	SetProperties map[string]string
	CreateParents bool
	BlockSize     string
	Sparse        bool
}

CreateVolumeOpts are options that can be passed to CreateVolume

type DestroyOpts

type DestroyOpts struct {
	DestroyChildren bool
	DestroyClones   bool
	ForceUnmount    bool
	Defer           bool
}

DestroyOpts are options that can be passed to Destroy

type GetOpts

type GetOpts struct {
	Recurse bool
	Depth   int
	Types   []string
	Sources []string
}

GetOpts are options that can be passed to Get Depth defaults to 0, set to -1 to omit the depth argument

type InheritOpts

type InheritOpts struct {
	Recurse  bool
	Received bool
}

InheritOpts are options that can be passed to Inherit

type ListOpts

type ListOpts struct {
	Recurse bool
	Depth   int
	Types   []string
}

ListOpts are options that can be passed to List Depth defaults to zero, set to -1 to omit the depth argument

type MountEntry

type MountEntry struct {
	Name       string
	Mountpoint string
}

MountEntry is a mounted zfs filesystem

func GetMounts

func GetMounts() ([]*MountEntry, error)

GetMounts runs zfs mount with no arguments

type MountOpts

type MountOpts struct {
	Properties []string
	MountAll   bool
}

MountOpts are options that can be passed to Mount

type Property

type Property struct {
	Value  string
	Source string
}

Property is a zfs property recieved from Get

type RenameOpts

type RenameOpts struct {
	CreateParents bool
	DontReMount   bool
	ForceUnmount  bool
	Recurse       bool
}

RenameOpts are options that can be passed to Rename

type RollbackOpts

type RollbackOpts struct {
	DestroyLaterSnapshots bool
	DestroyClones         bool
	ForceUnmount          bool
}

RollbackOpts are options that can be passed to Rollback

type SnapshotOpts

type SnapshotOpts struct {
	Recurse       bool
	SetProperties map[string]string
}

SnapshotOpts are options that can be passed to Snapshot

type UnMountOpts

type UnMountOpts struct {
	UnMountAll   bool
	ForceUnmount bool
}

UnMountOpts are options that can be passed to UnMount

type ZFSError

type ZFSError struct {
	Cmd    string
	Stderr []byte
	// contains filtered or unexported fields
}

func (*ZFSError) Error

func (err *ZFSError) Error() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL