chore: rename some symbols
This commit is contained in:
@ -29,22 +29,26 @@ type Other interface {
|
||||
}
|
||||
|
||||
type Reader interface {
|
||||
List(ctx context.Context, dir model.Object) ([]model.Object, error)
|
||||
Link(ctx context.Context, file model.Object, args model.LinkArgs) (*model.Link, error)
|
||||
// List list files in the path
|
||||
// if identify files by path, need to set ID with path,like stdpath.Join(dir.GetID(), obj.GetName())
|
||||
// if identify files by id, need to set ID with corresponding id
|
||||
List(ctx context.Context, dir model.Obj) ([]model.Obj, error)
|
||||
// Link get url/filepath/reader of file
|
||||
Link(ctx context.Context, file model.Obj, args model.LinkArgs) (*model.Link, error)
|
||||
//Get(ctx context.Context, path string) (FileInfo, error) // maybe not need
|
||||
}
|
||||
|
||||
type Writer interface {
|
||||
// MakeDir make a folder named `dirName` in `parentDir`
|
||||
MakeDir(ctx context.Context, parentDir model.Object, dirName string) error
|
||||
MakeDir(ctx context.Context, parentDir model.Obj, dirName string) error
|
||||
// Move move `srcObject` to `dstDir`
|
||||
Move(ctx context.Context, srcObject, dstDir model.Object) error
|
||||
Move(ctx context.Context, srcObj, dstDir model.Obj) error
|
||||
// Rename rename `srcObject` to `newName`
|
||||
Rename(ctx context.Context, srcObject model.Object, newName string) error
|
||||
Rename(ctx context.Context, srcObj model.Obj, newName string) error
|
||||
// Copy copy `srcObject` to `dstDir`
|
||||
Copy(ctx context.Context, srcObject, dstDir model.Object) error
|
||||
Copy(ctx context.Context, srcObj, dstDir model.Obj) error
|
||||
// Remove remove `object`
|
||||
Remove(ctx context.Context, object model.Object) error
|
||||
Remove(ctx context.Context, obj model.Obj) error
|
||||
// Put put `stream` to `parentDir`
|
||||
Put(ctx context.Context, parentDir model.Object, stream model.FileStreamer) error
|
||||
Put(ctx context.Context, parentDir model.Obj, stream model.FileStreamer) error
|
||||
}
|
||||
|
Reference in New Issue
Block a user