Documentation ¶
Index ¶
- Constants
- Variables
- func Append(name string, r io.Reader) (int64, error)
- func Before(name1, name2 string) (bool, error)
- func Branch(repo, commit, branch string) error
- func Changed(name string, mtime time.Time) (bool, error)
- func CheckVersion() error
- func Chtimes(name string, atime, mtime time.Time) error
- func Commit(repo, commit, branch string) error
- func Commits(repo, from string, order int, cont func(string) error) error
- func CopyFile(name string, r io.Reader) (int64, error)
- func Create(name string) (*os.File, error)
- func CreateAll(name string) (*os.File, error)
- func CreateFromReader(name string, r io.Reader) (int64, error)
- func DanglingCommit(repo, commit, branch string) error
- func DeleteCommit(commit string) error
- func Ensure(repo string) error
- func FileExists(name string) (bool, error)
- func FilePath(name string) string
- func FindNew(repo, from, to string) ([]string, error)
- func GetMeta(name, key string) string
- func Glob(pattern string) ([]string, error)
- func HostPath(name string) string
- func Init(repo string) error
- func IsCommit(name string) (bool, error)
- func Lstat(name string) (os.FileInfo, error)
- func Mkdir(name string) error
- func MkdirAll(name string) error
- func NewIn(repo, commit string) ([]string, error)
- func Open(name string) (*os.File, error)
- func OpenFd(name string, mode int, perm uint32) (int, error)
- func OpenFile(name string, flag int, perm os.FileMode) (*os.File, error)
- func Pull(repo, from string, cb Pusher) error
- func ReadDir(name string) ([]os.FileInfo, error)
- func ReadFile(name string) ([]byte, error)
- func Remove(name string) error
- func RemoveAll(name string) error
- func Rename(oldname, newname string) error
- func SetMeta(branch, key, value string) error
- func Show(repo string, commit string, out string) error
- func Stat(name string) (os.FileInfo, error)
- func WaitAnyFile(files ...string) (string, error)
- func WaitFile(name string, cancel chan struct{}) error
- func WriteFile(name string, data []byte) error
- type Puller
- type Pusher
- type Replica
Constants ¶
const ( Desc = iota Asc )
Constants used for passing to log
Variables ¶
var ( ErrComplete = errors.New("pfs: complete") ErrCancelled = errors.New("pfs: cancelled") )
Functions ¶
func Append ¶
Append reads data out of reader and appends it to the file. If the file doesn't exist it creates it.
func CheckVersion ¶ added in v0.9.0
func CheckVersion() error
func Commit ¶
Commit creates a new commit on a branch. The contents of the commit will be the same as the current contents of the branch.
func CreateAll ¶
CreateAll is like create but it will create the directory for the file if it doesn't already exist.
func CreateFromReader ¶
CreateFromReader is like Create but automatically sets the content of the file to the data found in `r`
func DanglingCommit ¶
DanglingCommit creates a commit but resets the branch to point to its current parent
func DeleteCommit ¶ added in v0.9.0
func Ensure ¶
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 ¶
FileExists returns true if a file exists in the filesystem
func FilePath ¶
FilePath returns an absolute path for a file in the btrfs volume *inside* the container.
func FindNew ¶
FindNew returns an array of filenames that were created or modified between `from` and `to`
func Glob ¶
Glob returns the names of all files matching pattern or nil if there's no match. Glob uses syntax that should be familiar from shell like /foo/bar/*
func IsCommit ¶ added in v0.9.0
IsCommit returns true if the volume is a commit and false if it's a branch.
func Lstat ¶
Lstat returns FileInfo describing a file, if the file is a symbolic link it still works.
func WaitAnyFile ¶
WaitAnyFile returns as soon as ANY of the files exists. It returns an error if waiting for ANY of the files errors.
Types ¶
type Puller ¶
type Puller interface { // Pull produces binary diffs and passes them to p's Push method. Pull(from string, p Pusher) error }
Puller is an interface that wraps the Pull method.