2022-09-01 14:13:37 +00:00
|
|
|
package template
|
2022-08-31 08:32:51 +00:00
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
|
|
|
"github.com/alist-org/alist/v3/internal/driver"
|
|
|
|
"github.com/alist-org/alist/v3/internal/errs"
|
|
|
|
"github.com/alist-org/alist/v3/internal/model"
|
|
|
|
)
|
|
|
|
|
|
|
|
type Template struct {
|
|
|
|
model.Storage
|
|
|
|
Addition
|
|
|
|
}
|
|
|
|
|
|
|
|
func (d *Template) Config() driver.Config {
|
|
|
|
return config
|
|
|
|
}
|
|
|
|
|
|
|
|
func (d *Template) GetAddition() driver.Additional {
|
2022-12-13 10:03:30 +00:00
|
|
|
return &d.Addition
|
2022-08-31 08:32:51 +00:00
|
|
|
}
|
|
|
|
|
2022-12-13 10:03:30 +00:00
|
|
|
func (d *Template) Init(ctx context.Context) error {
|
2022-08-31 08:32:51 +00:00
|
|
|
// TODO login / refresh token
|
2022-08-31 13:01:15 +00:00
|
|
|
//op.MustSaveDriverStorage(d)
|
2022-12-13 10:03:30 +00:00
|
|
|
return nil
|
2022-08-31 08:32:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (d *Template) Drop(ctx context.Context) error {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (d *Template) List(ctx context.Context, dir model.Obj, args model.ListArgs) ([]model.Obj, error) {
|
|
|
|
// TODO return the files list
|
|
|
|
return nil, errs.NotImplement
|
|
|
|
}
|
|
|
|
|
|
|
|
func (d *Template) Link(ctx context.Context, file model.Obj, args model.LinkArgs) (*model.Link, error) {
|
|
|
|
// TODO return link of file
|
|
|
|
return nil, errs.NotImplement
|
|
|
|
}
|
|
|
|
|
|
|
|
func (d *Template) MakeDir(ctx context.Context, parentDir model.Obj, dirName string) error {
|
|
|
|
// TODO create folder
|
|
|
|
return errs.NotImplement
|
|
|
|
}
|
|
|
|
|
|
|
|
func (d *Template) Move(ctx context.Context, srcObj, dstDir model.Obj) error {
|
|
|
|
// TODO move obj
|
|
|
|
return errs.NotImplement
|
|
|
|
}
|
|
|
|
|
|
|
|
func (d *Template) Rename(ctx context.Context, srcObj model.Obj, newName string) error {
|
|
|
|
// TODO rename obj
|
|
|
|
return errs.NotImplement
|
|
|
|
}
|
|
|
|
|
|
|
|
func (d *Template) Copy(ctx context.Context, srcObj, dstDir model.Obj) error {
|
|
|
|
// TODO copy obj
|
|
|
|
return errs.NotImplement
|
|
|
|
}
|
|
|
|
|
|
|
|
func (d *Template) Remove(ctx context.Context, obj model.Obj) error {
|
|
|
|
// TODO remove obj
|
|
|
|
return errs.NotImplement
|
|
|
|
}
|
|
|
|
|
|
|
|
func (d *Template) Put(ctx context.Context, dstDir model.Obj, stream model.FileStreamer, up driver.UpdateProgress) error {
|
|
|
|
// TODO upload file
|
|
|
|
return errs.NotImplement
|
|
|
|
}
|
|
|
|
|
2022-09-11 10:40:19 +00:00
|
|
|
//func (d *Template) Other(ctx context.Context, args model.OtherArgs) (interface{}, error) {
|
|
|
|
// return nil, errs.NotSupport
|
|
|
|
//}
|
2022-08-31 08:32:51 +00:00
|
|
|
|
|
|
|
var _ driver.Driver = (*Template)(nil)
|