Documentation ¶
Index ¶
- Constants
- func Cancel2FAById(id uint) error
- func Cancel2FAByUser(u *model.User) error
- func ClearCache(storage driver.Driver, path string)
- func Copy(ctx context.Context, storage driver.Driver, srcPath, dstDirPath string, ...) error
- func CreateMeta(u *model.Meta) error
- func CreateStorage(ctx context.Context, storage model.Storage) (uint, error)
- func CreateUser(u *model.User) error
- func DelUserCache(username string) error
- func DeleteMetaById(id uint) error
- func DeleteSettingItemByKey(key string) error
- func DeleteStorageById(ctx context.Context, id uint) error
- func DeleteUserById(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 GetAdmin() (*model.User, error)
- func GetAllStorages() []driver.Driver
- func GetBalancedStorage(path string) driver.Driver
- func GetDriverInfoMap() map[string]driver.Info
- func GetDriverNames() []string
- func GetGuest() (*model.User, error)
- func GetMetaById(id uint) (*model.Meta, error)
- func GetMetaByPath(path string) (*model.Meta, error)
- func GetMetas(pageIndex, pageSize int) (metas []model.Meta, count int64, err error)
- func GetNearestMeta(path string) (*model.Meta, error)
- func GetPublicSettingItems() ([]model.SettingItem, error)
- func GetPublicSettingsMap() map[string]string
- func GetSettingItemByKey(key string) (*model.SettingItem, error)
- func GetSettingItemInKeys(keys []string) ([]model.SettingItem, error)
- func GetSettingItems() ([]model.SettingItem, error)
- func GetSettingItemsByGroup(group int) ([]model.SettingItem, error)
- func GetSettingItemsInGroups(groups []int) ([]model.SettingItem, error)
- func GetSettingsMap() map[string]string
- func GetStorageAndActualPath(rawPath string) (storage driver.Driver, actualPath string, err error)
- func GetStorageByMountPath(mountPath string) (driver.Driver, error)
- func GetStorageVirtualFilesByPath(prefix string) []model.Obj
- func GetUnwrap(ctx context.Context, storage driver.Driver, path string) (model.Obj, error)
- func GetUserById(id uint) (*model.User, error)
- func GetUserByName(username string) (*model.User, error)
- func GetUserByRole(role int) (*model.User, error)
- func GetUsers(pageIndex, pageSize int) (users []model.User, count int64, err error)
- func HandleObjsUpdateHook(parent string, objs []model.Obj)
- func HandleSettingItemHook(item *model.SettingItem) (hasHook bool, err error)
- func HasStorage(mountPath string) bool
- 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)
- 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, lazyCache ...bool) 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(driver DriverConstructor)
- func RegisterObjsUpdateHook(hook ObjsUpdateHook)
- func RegisterSettingItemHook(key string, hook SettingItemHook)
- func RegisterStorageHook(hook StorageHook)
- func Remove(ctx context.Context, storage driver.Driver, path string) error
- func Rename(ctx context.Context, storage driver.Driver, srcPath, dstName string, ...) error
- func SaveSettingItem(item *model.SettingItem) (err error)
- func SaveSettingItems(items []model.SettingItem) error
- func UpdateMeta(u *model.Meta) error
- func UpdateStorage(ctx context.Context, storage model.Storage) error
- func UpdateUser(u *model.User) error
- type DriverConstructor
- type ObjsUpdateHook
- type SettingItemHook
- type StorageHook
Constants ¶
const ( WORK = "work" DISABLED = "disabled" RootName = "root" )
Variables ¶
This section is empty.
Functions ¶
func Cancel2FAById ¶
func Cancel2FAByUser ¶
func ClearCache ¶
func Copy ¶
func Copy(ctx context.Context, storage driver.Driver, srcPath, dstDirPath string, lazyCache ...bool) error
Copy Just copy file[s] in a storage
func CreateMeta ¶
func CreateStorage ¶
CreateStorage Save the storage to database so storage can get an id then instantiate corresponding driver and save it in memory
func CreateUser ¶
func DelUserCache ¶
func DeleteMetaById ¶
func DeleteSettingItemByKey ¶
func DeleteUserById ¶
func GetAllStorages ¶
func GetBalancedStorage ¶
GetBalancedStorage get storage by path
func GetDriverInfoMap ¶
func GetDriverNames ¶
func GetDriverNames() []string
func GetPublicSettingItems ¶
func GetPublicSettingItems() ([]model.SettingItem, error)
func GetPublicSettingsMap ¶
func GetSettingItemByKey ¶
func GetSettingItemByKey(key string) (*model.SettingItem, error)
func GetSettingItemInKeys ¶
func GetSettingItemInKeys(keys []string) ([]model.SettingItem, error)
func GetSettingItems ¶
func GetSettingItems() ([]model.SettingItem, error)
func GetSettingItemsByGroup ¶
func GetSettingItemsByGroup(group int) ([]model.SettingItem, error)
func GetSettingItemsInGroups ¶
func GetSettingItemsInGroups(groups []int) ([]model.SettingItem, error)
func GetSettingsMap ¶
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 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 HandleObjsUpdateHook ¶
func HandleSettingItemHook ¶
func HandleSettingItemHook(item *model.SettingItem) (hasHook bool, err error)
func HasStorage ¶
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) ([]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 RegisterDriver ¶
func RegisterDriver(driver DriverConstructor)
func RegisterObjsUpdateHook ¶
func RegisterObjsUpdateHook(hook ObjsUpdateHook)
func RegisterSettingItemHook ¶
func RegisterSettingItemHook(key string, hook SettingItemHook)
func RegisterStorageHook ¶
func RegisterStorageHook(hook StorageHook)
func SaveSettingItem ¶
func SaveSettingItem(item *model.SettingItem) (err error)
func SaveSettingItems ¶
func SaveSettingItems(items []model.SettingItem) error
func UpdateMeta ¶
func UpdateStorage ¶
UpdateStorage update storage get old storage first drop the storage then reinitialize
func UpdateUser ¶
Types ¶
type DriverConstructor ¶
func GetDriver ¶
func GetDriver(name string) (DriverConstructor, error)