vfs: store root dir

so we don't need to pass it over and over
This commit is contained in:
Nicola Murino
2020-01-19 13:58:55 +01:00
parent a4834f4a83
commit d75f56b914
12 changed files with 65 additions and 57 deletions

View File

@@ -1,3 +1,4 @@
// Package vfs provides local and remote filesystems support
package vfs
import (
@@ -29,11 +30,11 @@ type Fs interface {
ReadDir(dirname string) ([]os.FileInfo, error)
IsUploadResumeSupported() bool
IsAtomicUploadSupported() bool
CheckRootPath(rootPath, username string, uid int, gid int) bool
ResolvePath(sftpPath, rootPath string) (string, error)
CheckRootPath(username string, uid int, gid int) bool
ResolvePath(sftpPath string) (string, error)
IsNotExist(err error) bool
IsPermission(err error) bool
ScanDirContents(dirPath string) (int, int64, error)
ScanRootDirContents() (int, int64, error)
GetAtomicUploadPath(name string) string
GetRelativePath(name, rootPath string) string
Join(elem ...string) string