Files
alist/drivers/gitee/meta.go
千石 0cbc7ebc92 feat(driver): Added support for Gitee driver (#9368)
* feat(driver): Added support for Gitee driver

- Implemented core driver functions including initialization, file listing, and file linking
- Added Gitee-specific API interaction and object mapping
- Registered Gitee driver in the driver registry

* feat(driver): Added cookie-based authentication support for Gitee driver

- Extended request handling to include `Cookie` header if provided
- Updated metadata to include `cookie` field with appropriate documentation
- Adjusted file link generation to propagate `Cookie` headers in requests
2025-11-11 20:25:26 +08:00

30 lines
989 B
Go

package gitee
import (
"github.com/alist-org/alist/v3/internal/driver"
"github.com/alist-org/alist/v3/internal/op"
)
type Addition struct {
driver.RootPath
Endpoint string `json:"endpoint" type:"string" help:"Gitee API endpoint, default https://gitee.com/api/v5"`
Token string `json:"token" type:"string"`
Owner string `json:"owner" type:"string" required:"true"`
Repo string `json:"repo" type:"string" required:"true"`
Ref string `json:"ref" type:"string" help:"Branch, tag or commit SHA, defaults to repository default branch"`
DownloadProxy string `json:"download_proxy" type:"string" help:"Prefix added before download URLs, e.g. https://mirror.example.com/"`
Cookie string `json:"cookie" type:"string" help:"Cookie returned from user info request"`
}
var config = driver.Config{
Name: "Gitee",
LocalSort: true,
DefaultRoot: "/",
}
func init() {
op.RegisterDriver(func() driver.Driver {
return &Gitee{}
})
}