2022-09-03 20:34:06 +08:00
|
|
|
package google_drive
|
|
|
|
|
|
|
|
import (
|
2025-07-01 09:54:50 +08:00
|
|
|
"github.com/OpenListTeam/OpenList/v4/internal/driver"
|
|
|
|
"github.com/OpenListTeam/OpenList/v4/internal/op"
|
2022-09-03 20:34:06 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
type Addition struct {
|
2022-09-04 13:07:53 +08:00
|
|
|
driver.RootID
|
2022-09-03 20:34:06 +08:00
|
|
|
RefreshToken string `json:"refresh_token" required:"true"`
|
|
|
|
OrderBy string `json:"order_by" type:"string" help:"such as: folder,name,modifiedTime"`
|
|
|
|
OrderDirection string `json:"order_direction" type:"select" options:"asc,desc"`
|
2025-06-17 22:13:28 +08:00
|
|
|
UseOnlineAPI bool `json:"use_online_api" default:"true"`
|
|
|
|
APIAddress string `json:"api_url_address" default:"https://api.oplist.org/googleui/renewapi"`
|
|
|
|
ClientID string `json:"client_id"`
|
|
|
|
ClientSecret string `json:"client_secret"`
|
2022-11-12 18:45:50 +08:00
|
|
|
ChunkSize int64 `json:"chunk_size" type:"number" default:"5" help:"chunk size while uploading (unit: MB)"`
|
2022-09-03 20:34:06 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
var config = driver.Config{
|
|
|
|
Name: "GoogleDrive",
|
|
|
|
OnlyProxy: true,
|
|
|
|
DefaultRoot: "root",
|
|
|
|
}
|
|
|
|
|
|
|
|
func init() {
|
2022-12-13 18:03:30 +08:00
|
|
|
op.RegisterDriver(func() driver.Driver {
|
|
|
|
return &GoogleDrive{}
|
|
|
|
})
|
2022-09-03 20:34:06 +08:00
|
|
|
}
|