chore: rename account to storage

This commit is contained in:
Noah Hsu
2022-07-10 14:45:39 +08:00
parent efa20cc7bd
commit fc1204c914
31 changed files with 548 additions and 548 deletions

View File

@ -14,16 +14,16 @@ func get(ctx context.Context, path string) (model.Obj, error) {
path = utils.StandardizePath(path)
// maybe a virtual file
if path != "/" {
virtualFiles := operations.GetAccountVirtualFilesByPath(stdpath.Dir(path))
virtualFiles := operations.GetStorageVirtualFilesByPath(stdpath.Dir(path))
for _, f := range virtualFiles {
if f.GetName() == stdpath.Base(path) {
return f, nil
}
}
}
account, actualPath, err := operations.GetAccountAndActualPath(path)
storage, actualPath, err := operations.GetStorageAndActualPath(path)
if err != nil {
// if there are no account prefix with path, maybe root folder
// if there are no storage prefix with path, maybe root folder
if path == "/" {
return model.Object{
Name: "root",
@ -32,7 +32,7 @@ func get(ctx context.Context, path string) (model.Obj, error) {
IsFolder: true,
}, nil
}
return nil, errors.WithMessage(err, "failed get account")
return nil, errors.WithMessage(err, "failed get storage")
}
return operations.Get(ctx, account, actualPath)
return operations.Get(ctx, storage, actualPath)
}