op

package
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WORK     = "work"
	RootName = "root"
)

Variables

View Source
var (
	ObjsUpdateHooks = make([]ObjsUpdateHook, 0)
)

Functions

func CallStorageHooks

func CallStorageHooks(typ string, storage driver.Driver)

func ClearCache

func ClearCache(storage driver.Driver, path string)

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 Get

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

Get object from list of files

func GetDriverInfoMap

func GetDriverInfoMap() map[string][]driver.Item
func GetDriverInfoMap() map[string]driver.Info {
	return driverInfoMap
}

func GetDriverNames

func GetDriverNames() []string

func GetUnwrap

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

func HandleObjsUpdateHook

func HandleObjsUpdateHook(parent string, objs []model.Obj)

func HandleSettingItemHook

func HandleSettingItemHook(item *model.SettingItem) (hasHook bool, err error)

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 MakeDir

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

func Move

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

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.FileStream, up driver.UpdateProgress, lazyCache ...bool) error

func RegisterDriver

func RegisterDriver(driver New)

func RegisterObjsUpdateHook

func RegisterObjsUpdateHook(hook ObjsUpdateHook)

func RegisterSettingItemHook

func RegisterSettingItemHook(key string, hook SettingItemHook)

func RegisterStorageHook

func RegisterStorageHook(hook StorageHook)

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, lazyCache ...bool) error

Types

type New

type New func() driver.Driver

func GetDriverNew

func GetDriverNew(name string) (New, error)

type ObjsUpdateHook

type ObjsUpdateHook = func(parent string, objs []model.Obj)

Obj

type SettingItemHook

type SettingItemHook func(item *model.SettingItem) error

Setting

type StorageHook

type StorageHook func(typ string, storage driver.Driver)

Storage

Jump to

Keyboard shortcuts

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