mirror of https://github.com/Xhofe/alist
🎨 add types
parent
fa6c0f78bc
commit
9dcaa9b07a
|
@ -186,7 +186,7 @@ func (driver Pan123) Proxy(c *gin.Context, account *model.Account) {
|
|||
}
|
||||
|
||||
func (driver Pan123) Preview(path string, account *model.Account) (interface{}, error) {
|
||||
return nil, nil
|
||||
return nil, NotSupport
|
||||
}
|
||||
|
||||
var _ Driver = (*Pan123)(nil)
|
|
@ -194,7 +194,7 @@ func (driver Cloud189) Proxy(ctx *gin.Context, account *model.Account) {
|
|||
}
|
||||
|
||||
func (driver Cloud189) Preview(path string, account *model.Account) (interface{}, error) {
|
||||
return nil, nil
|
||||
return nil, NotSupport
|
||||
}
|
||||
|
||||
var _ Driver = (*Cloud189)(nil)
|
|
@ -233,7 +233,7 @@ func (driver AliDrive) Preview(path string, account *model.Account) (interface{}
|
|||
req["category"] = "live_transcoding"
|
||||
}
|
||||
default:
|
||||
return nil, fmt.Errorf("don't support")
|
||||
return nil, NotSupport
|
||||
}
|
||||
_, err = aliClient.R().SetResult(&resp).SetError(&e).
|
||||
SetHeader("authorization", "Bearer\t"+account.AccessToken).
|
||||
|
|
|
@ -162,7 +162,7 @@ func (driver GoogleDrive) Proxy(c *gin.Context, account *model.Account) {
|
|||
}
|
||||
|
||||
func (driver GoogleDrive) Preview(path string, account *model.Account) (interface{}, error) {
|
||||
return nil, nil
|
||||
return nil, NotSupport
|
||||
}
|
||||
|
||||
var _ Driver = (*GoogleDrive)(nil)
|
|
@ -155,7 +155,7 @@ func (driver Native) Proxy(c *gin.Context, account *model.Account) {
|
|||
}
|
||||
|
||||
func (driver Native) Preview(path string, account *model.Account) (interface{}, error) {
|
||||
return nil, fmt.Errorf("no need")
|
||||
return nil, NotSupport
|
||||
}
|
||||
|
||||
var _ Driver = (*Native)(nil)
|
||||
|
|
|
@ -202,7 +202,7 @@ func (driver Onedrive) Proxy(c *gin.Context, account *model.Account) {
|
|||
}
|
||||
|
||||
func (driver Onedrive) Preview(path string, account *model.Account) (interface{}, error) {
|
||||
return nil, nil
|
||||
return nil, NotSupport
|
||||
}
|
||||
|
||||
var _ Driver = (*Onedrive)(nil)
|
|
@ -6,4 +6,11 @@ var (
|
|||
PathNotFound = fmt.Errorf("path not found")
|
||||
NotFile = fmt.Errorf("not file")
|
||||
NotImplement = fmt.Errorf("not implement")
|
||||
NotSupport = fmt.Errorf("not support")
|
||||
)
|
||||
|
||||
const (
|
||||
STRING = "string"
|
||||
SELECT = "select"
|
||||
BOOL = "bool"
|
||||
)
|
Loading…
Reference in New Issue