🎇 support webdav driver

This commit is contained in:
微凉
2021-12-30 21:39:17 +08:00
parent 0af3e95f1f
commit d71ed4d775
13 changed files with 255 additions and 20 deletions

23
drivers/webdav/webdav.go Normal file
View File

@ -0,0 +1,23 @@
package webdav
import (
"github.com/Xhofe/alist/drivers/base"
"github.com/Xhofe/alist/model"
"github.com/Xhofe/alist/utils"
"github.com/studio-b12/gowebdav"
"strings"
)
func (driver WebDav) NewClient(account *model.Account) *gowebdav.Client {
return gowebdav.NewClient(account.SiteUrl, account.Username, account.Password)
}
func (driver WebDav) WebDavPath(path string) string {
path = utils.ParsePath(path)
path = strings.TrimPrefix(path, "/")
return path
}
func init() {
base.RegisterDriver(&WebDav{})
}