From 335b11c698e11b4cd5066305be19a52787f522e5 Mon Sep 17 00:00:00 2001 From: Andy Hsu Date: Fri, 8 Sep 2023 15:25:49 +0800 Subject: [PATCH] chore: implement the driver interface with obj return [skip ci] --- drivers/template/driver.go | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/template/driver.go b/drivers/template/driver.go index bc22b928e64..439f57f35f9 100644 --- a/drivers/template/driver.go +++ b/drivers/template/driver.go @@ -41,24 +41,24 @@ func (d *Template) Link(ctx context.Context, file model.Obj, args model.LinkArgs return nil, errs.NotImplement } -func (d *Template) MakeDir(ctx context.Context, parentDir model.Obj, dirName string) error { +func (d *Template) MakeDir(ctx context.Context, parentDir model.Obj, dirName string) (model.Obj, error) { // TODO create folder, optional - return errs.NotImplement + return nil, errs.NotImplement } -func (d *Template) Move(ctx context.Context, srcObj, dstDir model.Obj) error { +func (d *Template) Move(ctx context.Context, srcObj, dstDir model.Obj) (model.Obj, error) { // TODO move obj, optional - return errs.NotImplement + return nil, errs.NotImplement } -func (d *Template) Rename(ctx context.Context, srcObj model.Obj, newName string) error { +func (d *Template) Rename(ctx context.Context, srcObj model.Obj, newName string) (model.Obj, error) { // TODO rename obj, optional - return errs.NotImplement + return nil, errs.NotImplement } -func (d *Template) Copy(ctx context.Context, srcObj, dstDir model.Obj) error { +func (d *Template) Copy(ctx context.Context, srcObj, dstDir model.Obj) (model.Obj, error) { // TODO copy obj, optional - return errs.NotImplement + return nil, errs.NotImplement } func (d *Template) Remove(ctx context.Context, obj model.Obj) error { @@ -66,9 +66,9 @@ func (d *Template) Remove(ctx context.Context, obj model.Obj) error { return errs.NotImplement } -func (d *Template) Put(ctx context.Context, dstDir model.Obj, stream model.FileStreamer, up driver.UpdateProgress) error { +func (d *Template) Put(ctx context.Context, dstDir model.Obj, stream model.FileStreamer, up driver.UpdateProgress) (model.Obj, error) { // TODO upload file, optional - return errs.NotImplement + return nil, errs.NotImplement } //func (d *Template) Other(ctx context.Context, args model.OtherArgs) (interface{}, error) {