btrfs

package module
v0.0.0-...-784b0aa Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2015 License: Apache-2.0 Imports: 2 Imported by: 0

README

btrfs

Btrfs Library for Go

Documentation

Index

Constants

View Source
const (
	BtrfsVolNameMax = 255
)

Variables

This section is empty.

Functions

func RegisterAPI

func RegisterAPI(apiType ApiType, cmd Command, factory CommandFactory)

Types

type API

type API interface {
	Subvolume() Subvolume
}

func NewCli

func NewCli() API

func NewIoctl

func NewIoctl() API

type ApiType

type ApiType int
const (
	IOCTL ApiType = iota
	CLI
)

func (ApiType) String

func (at ApiType) String() string

type BtrfsError

type BtrfsError struct {
	Func    string
	Err     error
	Context string
}

All Public API Methods should return BtrfsError

func (*BtrfsError) Error

func (e *BtrfsError) Error() string

type Command

type Command string
const (
	CmdSubvolCreate   Command = "subvolume create"
	CmdSubvolSnapshot Command = "subvolume snapshot"
	CmdSubvolFindNew  Command = "subvolume find-new"
	CmdSubvolDelete   Command = "subvolume delete"
	CmdSubvolList     Command = "subvolume list"
)

type CommandFactory

type CommandFactory func() interface{}

type Executor

type Executor interface {
	Execute() error
}

type SubvolCreate

type SubvolCreate interface {
	Executor

	QuotaGroups(qgroups ...string) SubvolCreate
	Destination(dest string) SubvolCreate
}

type SubvolDelete

type SubvolDelete interface {
	Executor

	Destination(dest string) SubvolDelete
}

type SubvolFindNew

type SubvolFindNew interface {
	Executor

	Destination(dest string) SubvolFindNew
	LastGen(uint64) SubvolFindNew
}

type SubvolInfo

type SubvolInfo struct {
	Path             string
	ParentID         uint64
	ID               uint64
	OriginGeneration uint64
	Generation       uint64
	ParentUUID       uuid.UUID
	UUID             uuid.UUID
	IsSnapshot       bool
	IsReadOnly       bool

	Childred []SubvolInfo
}

type SubvolList

type SubvolList interface {
	Path(path string) SubvolList

	FilterGeneration(filter string) SubvolList
	FilterOriginGeneration(filter string) SubvolList
	Sort(order string) SubvolList

	Execute() ([]SubvolInfo, error)
}

type SubvolSnapshot

type SubvolSnapshot interface {
	Executor

	QuotaGroups(qgroups ...string) SubvolSnapshot
	ReadOnly() SubvolSnapshot
	Source(src string) SubvolSnapshot
	Destination(dest string) SubvolSnapshot
}

type Subvolume

type Subvolume interface {
	Create() SubvolCreate
	Snapshot() SubvolSnapshot
	Delete() SubvolDelete
	List() SubvolList
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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