Versions in this module Expand all Collapse all v1 v1.1.1 Dec 26, 2019 v1.1.0 Sep 8, 2019 Changes in this version + const ItemOpActDelete + const ItemOpActMkDir + const ItemOpActRename + const ItemOpAction + const ItemOpName + const ItemOpNewName + const OpDir + const OpItemOp + const OpRead + const OpWrite + const ParamAction + const ParamChecksums + const ParamOffset + const ParamPath + const ParamPattern + const ParamRecursive + const ParamSize + const SyncCopyFile + const SyncCreateDirectory + const SyncRemoveDirectory + const SyncRemoveFile + var DefaultReadBufferSize = 1024 * 16 + func DirResultToString(paths []string, infos [][]os.FileInfo) string + func IsEOF(err error) bool + func WrapFileInfo(path string, i os.FileInfo) os.FileInfo + func WrapFileInfos(path string, is []os.FileInfo) []os.FileInfo + type Branch struct + func NewBranch(cfg map[string]interface{}, cert *tls.Certificate) (*Branch, error) + func (b *Branch) Dir(spath string, pattern string, recursive bool, checksums bool) ([]string, [][]os.FileInfo, error) + func (b *Branch) IsReadOnly() bool + func (b *Branch) ItemOp(spath string, opdata map[string]string) (bool, error) + func (b *Branch) Name() string + func (b *Branch) ReadFile(spath string, p []byte, offset int64) (int, error) + func (b *Branch) ReadFileToBuffer(spath string, buf io.Writer) error + func (b *Branch) SSLFingerprint() string + func (b *Branch) Shutdown() error + func (b *Branch) WriteFile(spath string, p []byte, offset int64) (int, error) + func (b *Branch) WriteFileFromBuffer(spath string, buf io.Reader) error + type FileInfo struct + FiChecksum string + FiModTime time.Time + FiMode os.FileMode + FiName string + FiSize int64 + func (rfi *FileInfo) Checksum() string + func (rfi *FileInfo) IsDir() bool + func (rfi *FileInfo) ModTime() time.Time + func (rfi *FileInfo) Mode() os.FileMode + func (rfi *FileInfo) Name() string + func (rfi *FileInfo) Size() int64 + func (rfi *FileInfo) String() string + func (rfi *FileInfo) Sys() interface{} + type Tree struct + func NewTree(cfg map[string]interface{}, cert *tls.Certificate) (*Tree, error) + func (t *Tree) ActiveBranches() ([]string, []string) + func (t *Tree) AddBranch(branchName string, branchRPC string, branchFingerprint string) error + func (t *Tree) AddMapping(dir, branchName string, writable bool) error + func (t *Tree) Config() string + func (t *Tree) Copy(src []string, dst string, ...) error + func (t *Tree) CopyFile(srcPath, dstPath string, updFunc func(writtenBytes int)) error + func (t *Tree) Dir(dir string, pattern string, recursive bool, checksums bool) ([]string, [][]os.FileInfo, error) + func (t *Tree) ItemOp(dir string, opdata map[string]string) (bool, error) + func (t *Tree) KnownBranches() map[string]map[string]string + func (t *Tree) NotReachableBranches() map[string]map[string]string + func (t *Tree) PingBranch(node string, rpc string) (string, error) + func (t *Tree) ReadFile(spath string, p []byte, offset int64) (int, error) + func (t *Tree) ReadFileToBuffer(spath string, buf io.Writer) error + func (t *Tree) Refresh() + func (t *Tree) Reset(branches bool) + func (t *Tree) SetMapping(config string) error + func (t *Tree) Stat(item string) (os.FileInfo, error) + func (t *Tree) String() string + func (t *Tree) Sync(srcDir string, dstDir string, recursive bool, ...) error + func (t *Tree) WriteFile(spath string, p []byte, offset int64) (int, error) + func (t *Tree) WriteFileFromBuffer(spath string, buf io.Reader) error