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 CheckExists(name string, t *testing.T)
- func CheckFile(name, content string, t *testing.T)
- func CheckNoExists(name string, t *testing.T)
- func Commit(repo, commit, branch string) error
- func Commits(repo, from string, order int, cont func(CommitInfo) 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 Ensure(repo string) error
- func FileExists(name string) (bool, error)
- func FilePath(name string) string
- func FindNew(repo, from, to string) ([]string, error)
- func GetFrom(repo string) (string, error)
- func GetMeta(name, key string) string
- func Glob(pattern string) ([]string, error)
- func Hold(repo, commit string) (string, error)
- func HostPath(name string) string
- func Init(repo string) error
- func IsReadOnly(volume string) (bool, error)
- func LazyWalk(name string, f func(string) error) error
- func Link(oldname, newname string) error
- func Log(repo, from string, order int, cont func(io.Reader) error) 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 PathCommit(name string) string
- func PathFile(name string) string
- func PathRepo(name string) string
- func Pull(repo, from string, cb Pusher) error
- func RandSeq(n int) string
- func ReadDir(name string) ([]os.FileInfo, error)
- func ReadFile(name string) ([]byte, error)
- func Readlink(name string) (string, error)
- func Recv(repo string, data io.Reader) error
- func Release(name string)
- func Remove(name string) error
- func RemoveAll(name string) error
- func Rename(oldname, newname string) error
- func Send(repo, commit string, cont func(io.Reader) error) error
- func SetMeta(branch, key, value string) error
- func SetReadOnly(volume string) error
- func Snapshot(volume string, dest string, readonly bool) error
- func Stat(name string) (os.FileInfo, error)
- func SubvolumeCreate(name string) error
- func SubvolumeDelete(name string) error
- func SubvolumeDeleteAll(name string) error
- func Symlink(oldname, newname string) error
- func Sync() error
- func TrimFilePath(name string) string
- func UnsetReadOnly(volume string) error
- func WaitAnyFile(files ...string) (string, error)
- func WaitFile(name string, cancel chan struct{}) error
- func WriteFile(name string, data []byte) error
- type CommitInfo
- type LocalReplica
- type Puller
- type Pusher
- type Replica
- type S3Replica
Constants ¶
const ( Desc = iota Asc = iota )
Constants used for passing to log
Variables ¶
var ( ErrComplete = errors.New("pfs: complete") ErrCancelled = errors.New("pfs: cancelled") )
Functions ¶
func Append ¶ added in v0.8.1
Append reads data out of reader and appends it to the file. If the file doesn't exist it creates it.
func CheckExists ¶ added in v0.8.1
CheckExists checks that a file is present
func CheckNoExists ¶ added in v0.8.1
CheckNoExists checks that no file is present.
func Commits ¶
func Commits(repo, from string, order int, cont func(CommitInfo) error) error
Commits is a wrapper around `Log` which parses the output in to a convenient struct
func DanglingCommit ¶ added in v0.8.1
DanglingCommit creates a commit but resets the branch to point to its current parent
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 ¶
func FindNew ¶
FindNew returns an array of filenames that were created or modified between `from` and `to`
func GetFrom ¶ added in v0.7.1
GetFrom returns the commit that this repo should pass to Pull to get itself up to date.
func Hold ¶
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 IsReadOnly ¶ added in v0.7.1
func PathCommit ¶ added in v0.8.1
PathCommit extracts the commit from a path
func RandSeq ¶
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 SetReadOnly ¶
func SubvolumeCreate ¶
func SubvolumeDelete ¶
func SubvolumeDeleteAll ¶ added in v0.7.1
func TrimFilePath ¶
func UnsetReadOnly ¶
func WaitAnyFile ¶ added in v0.8.3
WaitAnyFile returns as soon as ANY of the files exists. It returns an error if waiting for ANY of the files errors.
Types ¶
type CommitInfo ¶
type CommitInfo struct { Path string // contains filtered or unexported fields }
type LocalReplica ¶ added in v0.7.1
type LocalReplica struct {
// contains filtered or unexported fields
}
A LocalReplica implements the Replica interface and replicates the commits to a local repo. It expects `repo` to already exist
func NewLocalReplica ¶ added in v0.7.1
func NewLocalReplica(repo string) *LocalReplica
type S3Replica ¶ added in v0.7.1
type S3Replica struct {
// contains filtered or unexported fields
}