🎇 support webdav driver
This commit is contained in:
23
drivers/webdav/webdav.go
Normal file
23
drivers/webdav/webdav.go
Normal 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{})
|
||||
}
|
Reference in New Issue
Block a user