fs

package
v3.35.3-8Mi Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2024 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CopyTaskManager *tache.Manager[*CopyTask]
View Source
var UploadTaskManager *tache.Manager[*UploadTask]

Functions

func Copy

func Copy(ctx context.Context, srcObjPath, dstDirPath string, lazyCache ...bool) (tache.TaskWithInfo, error)

func Get

func Get(ctx context.Context, path string, args *GetArgs) (model.Obj, error)

func GetStorage

func GetStorage(path string, args *GetStoragesArgs) (driver.Driver, error)
func Link(ctx context.Context, path string, args model.LinkArgs) (*model.Link, model.Obj, error)

func List

func List(ctx context.Context, path string, args *ListArgs) ([]model.Obj, error)

func MakeDir

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

func Move

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

func Other

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

func PutAsTask

func PutAsTask(dstDirPath string, file model.FileStreamer) (tache.TaskWithInfo, error)

func PutDirectly

func PutDirectly(ctx context.Context, dstDirPath string, file model.FileStreamer, lazyCache ...bool) error

func Remove

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

func Rename

func Rename(ctx context.Context, srcPath, dstName string, lazyCache ...bool) error

func WalkFS

func WalkFS(ctx context.Context, depth int, name string, info model.Obj, walkFn func(reqPath string, info model.Obj) error) error

WalkFS traverses filesystem fs starting at name up to depth levels.

WalkFS will stop when current depth > `depth`. For each visited node, WalkFS calls walkFn. If a visited file system node is a directory and walkFn returns path.SkipDir, walkFS will skip traversal of this node.

Types

type CopyTask

type CopyTask struct {
	tache.Base
	Status string `json:"status"`
	// contains filtered or unexported fields
}

func (*CopyTask) GetName

func (t *CopyTask) GetName() string

func (*CopyTask) GetStatus

func (t *CopyTask) GetStatus() string

func (*CopyTask) Run

func (t *CopyTask) Run() error

type GetArgs

type GetArgs struct {
	NoLog bool
}

type GetStoragesArgs

type GetStoragesArgs struct {
}

type ListArgs

type ListArgs struct {
	Refresh bool
	NoLog   bool
}

type UploadTask

type UploadTask struct {
	tache.Base
	// contains filtered or unexported fields
}

func (*UploadTask) GetName

func (t *UploadTask) GetName() string

func (*UploadTask) GetStatus

func (t *UploadTask) GetStatus() string

func (*UploadTask) Run

func (t *UploadTask) Run() error

Jump to

Keyboard shortcuts

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