feat: add a driver template

This commit is contained in:
Noah Hsu
2022-08-31 16:32:51 +08:00
parent 41edac5826
commit 7d407de22e
7 changed files with 150 additions and 18 deletions

33
drivers/template/meta.go Normal file
View File

@ -0,0 +1,33 @@
package local
import (
"github.com/alist-org/alist/v3/internal/driver"
"github.com/alist-org/alist/v3/internal/operations"
)
type Addition struct {
// Usually one of two
driver.RootFolderPath
driver.RootFolderId
// define other
Field string `json:"field" type:"select" required:"true" options:"a,b,c" default:"a"`
}
var config = driver.Config{
Name: "template",
LocalSort: false,
OnlyLocal: false,
OnlyProxy: false,
NoCache: false,
NoUpload: false,
NeedMs: false,
DefaultRoot: "root, / or other",
}
func New() driver.Driver {
return &Template{}
}
func init() {
operations.RegisterDriver(config, New)
}