feat: add sftp driver (close #1466)

This commit is contained in:
Noah Hsu
2022-09-04 12:43:52 +08:00
parent 8fd56ef9dd
commit ffba5e0aec
9 changed files with 248 additions and 17 deletions

30
drivers/sftp/meta.go Normal file
View File

@ -0,0 +1,30 @@
package sftp
import (
"github.com/alist-org/alist/v3/internal/driver"
"github.com/alist-org/alist/v3/internal/op"
)
type Addition struct {
Address string `json:"address" required:"true"`
Username string `json:"username" required:"true"`
PrivateKey string `json:"private_key" type:"text"`
Password string `json:"password"`
driver.RootFolderPath
}
var config = driver.Config{
Name: "SFTP",
LocalSort: true,
OnlyLocal: true,
DefaultRoot: "/",
CheckStatus: true,
}
func New() driver.Driver {
return &SFTP{}
}
func init() {
op.RegisterDriver(config, New)
}