btrfs

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2015 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BasePath

func BasePath(name string) string

func Branch

func Branch(repo, commit, branch string) error

func Commit

func Commit(repo, commit, branch string) error

Commit creates a new commit for a branch.

func Commits

func Commits(repo, from string, cont func(CommitInfo) error) error

func Create

func Create(name string) (*os.File, error)

func CreateAll

func CreateAll(name string) (*os.File, error)

func CreateFromReader

func CreateFromReader(name string, r io.Reader) (int64, error)

func Ensure

func Ensure(repo string) error

Ensure is like Init but won't error if the repo is already present. It will error if the repo is not present and we fail to make it.

func FileExists

func FileExists(name string) (bool, error)

func FilePath

func FilePath(name string) string

func FindNew

func FindNew(repo, commit, transid string) ([]string, error)

FindNew returns an array of filenames that have been created since transid. transid should come from Transid.

func Hold

func Hold(repo, commit string) (string, error)

Hold creates a temporary snapshot of a commit that no one else knows about. It's your responsibility to release the snapshot with Release

func Init

func Init(repo string) error

Init initializes an empty repo.

func LazyWalk

func LazyWalk(name string, f func(string) error) error
func Link(oldname, newname string) error

func Log

func Log(repo, from string, cont func(io.ReadCloser) error) error

Log returns all of the commits the repo which have generation >= from.

func Mkdir

func Mkdir(name string) error

func MkdirAll

func MkdirAll(name string) error

func NewFiles

func NewFiles(repo, commit string) ([]string, error)

NewFiles returns the new files in

func Open

func Open(name string) (*os.File, error)

func OpenFile

func OpenFile(name string, flag int, perm os.FileMode) (*os.File, error)

func Pull

func Pull(repo, from string, cont func(io.ReadCloser) error) error

func RandSeq

func RandSeq(n int) string

Generates a random sequence of letters. Useful for making filesystems that won't interfere with each other. This should be factored out to another file.

func ReadDir

func ReadDir(name string) ([]os.FileInfo, error)
func Readlink(name string) (string, error)

func Recv

func Recv(volume string, data io.ReadCloser) error

func Release

func Release(name string)

Release releases commit snapshots held by Hold.

func Remove

func Remove(name string) error

func Rename

func Rename(oldname, newname string) error

func Send

func Send(from string, to string, cont func(io.ReadCloser) error) error

func SendBase

func SendBase(to string, cont func(io.ReadCloser) error) error

func SetReadOnly

func SetReadOnly(volume string) error

func Snapshot

func Snapshot(volume string, dest string, readonly bool) error

func SubvolumeCreate

func SubvolumeCreate(name string) error

func SubvolumeDelete

func SubvolumeDelete(name string) error
func Symlink(oldname, newname string) error

func Sync

func Sync() error

func Transid

func Transid(repo, commit string) (string, error)

Transid returns transid of a path in a repo. This value is useful for passing to FindNew.

func TrimFilePath

func TrimFilePath(name string) string

func UnsetReadOnly

func UnsetReadOnly(volume string) error

func WriteFile

func WriteFile(name string, r io.Reader) (int64, error)

Types

type CommitInfo

type CommitInfo struct {
	// contains filtered or unexported fields
}

type Diff

type Diff struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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