alist/drivers/local/driver.go

85 lines
1.9 KiB
Go
Raw Normal View History

2022-06-06 14:06:33 +00:00
package local
2022-06-07 10:13:55 +00:00
import (
"context"
2022-06-14 11:44:25 +00:00
2022-06-07 10:13:55 +00:00
"github.com/alist-org/alist/v3/internal/driver"
"github.com/alist-org/alist/v3/internal/model"
"github.com/alist-org/alist/v3/pkg/utils"
2022-06-09 09:11:46 +00:00
"github.com/pkg/errors"
2022-06-07 10:13:55 +00:00
)
type Driver struct {
model.Account
Addition
}
func (d Driver) Config() driver.Config {
return config
}
func (d *Driver) Init(ctx context.Context, account model.Account) error {
2022-06-07 14:02:41 +00:00
d.Account = account
2022-06-07 10:13:55 +00:00
addition := d.Account.Addition
2022-06-14 11:44:25 +00:00
err := utils.Json.UnmarshalFromString(addition, &d.Addition)
2022-06-07 10:13:55 +00:00
if err != nil {
2022-06-09 09:11:46 +00:00
return errors.Wrap(err, "error while unmarshal addition")
2022-06-07 10:13:55 +00:00
}
return nil
}
func (d *Driver) Drop(ctx context.Context) error {
2022-06-07 14:02:41 +00:00
return nil
2022-06-07 10:13:55 +00:00
}
2022-06-08 08:20:58 +00:00
func (d *Driver) GetAddition() driver.Additional {
return d.Addition
2022-06-07 10:13:55 +00:00
}
func (d *Driver) List(ctx context.Context, path string) ([]driver.FileInfo, error) {
//TODO implement me
panic("implement me")
}
2022-06-10 13:00:51 +00:00
func (d *Driver) Link(ctx context.Context, path string, args driver.LinkArgs) (*driver.Link, error) {
2022-06-07 10:13:55 +00:00
//TODO implement me
panic("implement me")
}
2022-06-07 14:02:41 +00:00
func (d Driver) Other(ctx context.Context, data interface{}) (interface{}, error) {
//TODO implement me
panic("implement me")
}
2022-06-07 10:13:55 +00:00
func (d *Driver) MakeDir(ctx context.Context, path string) error {
//TODO implement me
panic("implement me")
}
func (d *Driver) Move(ctx context.Context, src, dst string) error {
//TODO implement me
panic("implement me")
}
func (d *Driver) Rename(ctx context.Context, src, dst string) error {
//TODO implement me
panic("implement me")
}
func (d *Driver) Copy(ctx context.Context, src, dst string) error {
//TODO implement me
panic("implement me")
}
func (d *Driver) Remove(ctx context.Context, path string) error {
//TODO implement me
panic("implement me")
}
2022-06-10 13:00:51 +00:00
func (d *Driver) Put(ctx context.Context, parentPath string, stream driver.FileStream) error {
2022-06-07 10:13:55 +00:00
//TODO implement me
panic("implement me")
}
var _ driver.Driver = (*Driver)(nil)