op

package
v3.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 11, 2022 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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 ClearCache(storage driver.Driver, path string)

func Copy

func Copy(ctx context.Context, storage driver.Driver, srcPath, dstDirPath string) error

Copy Just copy file[s] in a storage

func CreateStorage

func CreateStorage(ctx context.Context, storage model.Storage) error

CreateStorage Save the storage to database so storage can get an id then instantiate corresponding driver and save it in memory

func DeleteStorageById

func DeleteStorageById(ctx context.Context, id uint) error

func DisableStorage

func DisableStorage(ctx context.Context, id uint) error

func EnableStorage

func EnableStorage(ctx context.Context, id uint) error

func Get

func Get(ctx context.Context, storage driver.Driver, path string) (model.Obj, error)

Get object from list of files

func GetBalancedStorage

func GetBalancedStorage(path string) driver.Driver

GetBalancedStorage get storage by path

func GetDriverInfoMap

func GetDriverInfoMap() map[string]driver.Info

func GetDriverNames

func GetDriverNames() []string

func GetStorageAndActualPath

func GetStorageAndActualPath(rawPath string) (driver.Driver, string, error)

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 GetStorageByVirtualPath(virtualPath string) (driver.Driver, error)

func GetStorageVirtualFilesByPath

func GetStorageVirtualFilesByPath(prefix string) []model.Obj

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 Key

func Key(storage driver.Driver, path string) string
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

func LoadStorage(ctx context.Context, storage model.Storage) error

LoadStorage load exist storage in db to memory

func MakeDir

func MakeDir(ctx context.Context, storage driver.Driver, path string) error

func Move

func Move(ctx context.Context, storage driver.Driver, srcPath, dstDirPath string) error

func MustSaveDriverStorage

func MustSaveDriverStorage(driver driver.Driver)

MustSaveDriverStorage call from specific driver

func Other

func Other(ctx context.Context, storage driver.Driver, args model.FsOtherArgs) (interface{}, error)

Other api

func Put

func Put(ctx context.Context, storage driver.Driver, dstDirPath string, file model.FileStreamer, up driver.UpdateProgress) error

func RegisterDriver

func RegisterDriver(config driver.Config, driver New)

func Remove

func Remove(ctx context.Context, storage driver.Driver, path string) error

func Rename

func Rename(ctx context.Context, storage driver.Driver, srcPath, dstName string) error

func UpdateStorage

func UpdateStorage(ctx context.Context, storage model.Storage) error

UpdateStorage update storage get old storage first drop the storage then reinitialize

Types

type New

type New func() driver.Driver

func GetDriverNew

func GetDriverNew(name string) (New, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL