refactor: change driver interface

This commit is contained in:
Noah Hsu
2022-06-15 20:31:23 +08:00
parent d9eb188b7a
commit 09ef7c7106
12 changed files with 181 additions and 136 deletions

View File

@ -15,7 +15,7 @@ import (
// List files
// TODO: hide
// TODO: sort
func List(ctx context.Context, path string) ([]model.FileInfo, error) {
func List(ctx context.Context, path string) ([]model.Object, error) {
account, actualPath, err := operations.GetAccountAndActualPath(path)
virtualFiles := operations.GetAccountVirtualFilesByPath(path)
if err != nil {
@ -40,7 +40,7 @@ func List(ctx context.Context, path string) ([]model.FileInfo, error) {
return files, nil
}
func Get(ctx context.Context, path string) (model.FileInfo, error) {
func Get(ctx context.Context, path string) (model.Object, error) {
path = utils.StandardizationPath(path)
// maybe a virtual file
if path != "/" {