feat: extract get function

This commit is contained in:
Noah Hsu
2022-06-11 14:43:03 +08:00
parent ec89bb70c7
commit 77b0c69112
8 changed files with 66 additions and 24 deletions

View File

@ -27,13 +27,25 @@ type Items struct {
}
type IRootFolderPath interface {
GetRootFolder() string
GetRootFolderPath() string
}
type IRootFolderId interface {
GetRootFolderId() string
}
type RootFolderPath struct {
RootFolder string `json:"root_folder" help:"root folder path" default:"/"`
}
func (r RootFolderPath) GetRootFolder() string {
type RootFolderId struct {
RootFolder string `json:"root_folder" help:"root folder id"`
}
func (r RootFolderPath) GetRootFolderPath() string {
return r.RootFolder
}
func (r RootFolderId) GetRootFolderId() string {
return r.RootFolder
}

View File

@ -28,9 +28,9 @@ type Other interface {
}
type Reader interface {
Get(ctx context.Context, path string) (FileInfo, error)
List(ctx context.Context, path string) ([]FileInfo, error)
Link(ctx context.Context, path string, args LinkArgs) (*Link, error)
//Get(ctx context.Context, path string) (FileInfo, error) // maybe not need
}
type Writer interface {