chore: optional other interface

This commit is contained in:
Noah Hsu
2022-09-11 18:40:19 +08:00
parent 107462e42e
commit cd73e34ccc
23 changed files with 17 additions and 104 deletions

View File

@ -166,11 +166,15 @@ func Other(ctx context.Context, storage driver.Driver, args model.FsOtherArgs) (
if err != nil {
return nil, errors.WithMessagef(err, "failed to get obj")
}
return storage.Other(ctx, model.OtherArgs{
Obj: obj,
Method: args.Method,
Data: args.Data,
})
if o, ok := storage.(driver.Other); ok {
return o.Other(ctx, model.OtherArgs{
Obj: obj,
Method: args.Method,
Data: args.Data,
})
} else {
return nil, errs.NotImplement
}
}
func MakeDir(ctx context.Context, storage driver.Driver, path string) error {