refactor: change driver interface
This commit is contained in:
@ -3,6 +3,7 @@ package model
|
||||
import "time"
|
||||
|
||||
type File struct {
|
||||
ID string
|
||||
Name string
|
||||
Size uint64
|
||||
Modified time.Time
|
||||
@ -25,7 +26,6 @@ func (f File) IsDir() bool {
|
||||
return f.IsFolder
|
||||
}
|
||||
|
||||
type FileWithId struct {
|
||||
Id string
|
||||
File
|
||||
func (f File) GetID() string {
|
||||
return f.ID
|
||||
}
|
||||
|
@ -5,16 +5,17 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
type FileInfo interface {
|
||||
type Object interface {
|
||||
GetSize() uint64
|
||||
GetName() string
|
||||
ModTime() time.Time
|
||||
IsDir() bool
|
||||
GetID() string
|
||||
}
|
||||
|
||||
type FileStreamer interface {
|
||||
io.ReadCloser
|
||||
FileInfo
|
||||
Object
|
||||
GetMimetype() string
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ import (
|
||||
)
|
||||
|
||||
type FileStream struct {
|
||||
FileInfo
|
||||
Object
|
||||
io.ReadCloser
|
||||
Mimetype string
|
||||
}
|
||||
|
Reference in New Issue
Block a user