Documentation ¶
Index ¶
- Variables
- func ActualPath(storage driver.Additional, rawPath string) string
- func ClearCache(storage driver.Driver, path string)
- func Copy(ctx context.Context, storage driver.Driver, srcPath, dstDirPath string) error
- func CreateStorage(ctx context.Context, storage model.Storage) error
- func DeleteStorageById(ctx context.Context, id uint) error
- func DisableStorage(ctx context.Context, id uint) error
- func EnableStorage(ctx context.Context, id uint) error
- func Get(ctx context.Context, storage driver.Driver, path string) (model.Obj, error)
- func GetBalancedStorage(path string) driver.Driver
- func GetDriverInfoMap() map[string]driver.Info
- func GetDriverNames() []string
- func GetStorageAndActualPath(rawPath string) (driver.Driver, string, error)
- func GetStorageByVirtualPath(virtualPath string) (driver.Driver, error)
- func GetStorageVirtualFilesByPath(prefix string) []model.Obj
- func Link(ctx context.Context, storage driver.Driver, path string, args model.LinkArgs) (*model.Link, model.Obj, error)
- func List(ctx context.Context, storage driver.Driver, path string, args model.ListArgs, ...) ([]model.Obj, error)
- func LoadStorage(ctx context.Context, storage model.Storage) error
- func MakeDir(ctx context.Context, storage driver.Driver, path string) error
- func Move(ctx context.Context, storage driver.Driver, srcPath, dstDirPath string) error
- func MustSaveDriverStorage(driver driver.Driver)
- func Other(ctx context.Context, storage driver.Driver, args model.FsOtherArgs) (interface{}, error)
- func Put(ctx context.Context, storage driver.Driver, dstDirPath string, ...) error
- func RegisterDriver(config driver.Config, driver New)
- func Remove(ctx context.Context, storage driver.Driver, path string) error
- func Rename(ctx context.Context, storage driver.Driver, srcPath, dstName string) error
- func UpdateStorage(ctx context.Context, storage model.Storage) error
- type New
Constants ¶
This section is empty.
Variables ¶
var WORK = "work"
Functions ¶
func ActualPath ¶
func ActualPath(storage driver.Additional, rawPath string) string
ActualPath Get the actual path !!! maybe and \ in the path when use windows local
func ClearCache ¶
func CreateStorage ¶
CreateStorage Save the storage to database so storage can get an id then instantiate corresponding driver and save it in memory
func GetBalancedStorage ¶
GetBalancedStorage get storage by path
func GetDriverInfoMap ¶
func GetDriverNames ¶
func GetDriverNames() []string
func GetStorageAndActualPath ¶
GetStorageAndActualPath Get the corresponding storage and actual path for path: remove the mount path prefix and join the actual root folder if exists
func GetStorageByVirtualPath ¶
func GetStorageVirtualFilesByPath ¶
GetStorageVirtualFilesByPath Obtain the virtual file generated by the storage according to the path for example, there are: /a/b,/a/c,/a/d/e,/a/b.balance1,/av GetStorageVirtualFilesByPath(/a) => b,c,d
func Link ¶
func Link(ctx context.Context, storage driver.Driver, path string, args model.LinkArgs) (*model.Link, model.Obj, error)
Link get link, if is an url. should have an expiry time
func List ¶
func List(ctx context.Context, storage driver.Driver, path string, args model.ListArgs, refresh ...bool) ([]model.Obj, error)
List files in storage, not contains virtual file
func LoadStorage ¶
LoadStorage load exist storage in db to memory
func MustSaveDriverStorage ¶
MustSaveDriverStorage call from specific driver
func Put ¶
func Put(ctx context.Context, storage driver.Driver, dstDirPath string, file model.FileStreamer, up driver.UpdateProgress) error