|
1 | 1 | package local |
| 2 | + |
| 3 | +import ( |
| 4 | + "context" |
| 5 | + "errors" |
| 6 | + "github.com/alist-org/alist/v3/internal/driver" |
| 7 | + "github.com/alist-org/alist/v3/internal/model" |
| 8 | + "github.com/alist-org/alist/v3/pkg/utils" |
| 9 | +) |
| 10 | + |
| 11 | +type Driver struct { |
| 12 | + model.Account |
| 13 | + Addition |
| 14 | +} |
| 15 | + |
| 16 | +func (d Driver) Config() driver.Config { |
| 17 | + return config |
| 18 | +} |
| 19 | + |
| 20 | +func (d *Driver) Init(ctx context.Context, account model.Account) error { |
| 21 | + addition := d.Account.Addition |
| 22 | + err := utils.Json.UnmarshalFromString(addition, d.Addition) |
| 23 | + if err != nil { |
| 24 | + return errors.New("error") |
| 25 | + } |
| 26 | + return nil |
| 27 | +} |
| 28 | + |
| 29 | +func (d *Driver) Update(ctx context.Context, account model.Account) error { |
| 30 | + //TODO implement me |
| 31 | + panic("implement me") |
| 32 | +} |
| 33 | + |
| 34 | +func (d *Driver) Drop(ctx context.Context) error { |
| 35 | + //TODO implement me |
| 36 | + panic("implement me") |
| 37 | +} |
| 38 | + |
| 39 | +func (d *Driver) GetAccount() model.Account { |
| 40 | + //TODO implement me |
| 41 | + panic("implement me") |
| 42 | +} |
| 43 | + |
| 44 | +func (d *Driver) File(ctx context.Context, path string) (*driver.FileInfo, error) { |
| 45 | + //TODO implement me |
| 46 | + panic("implement me") |
| 47 | +} |
| 48 | + |
| 49 | +func (d *Driver) List(ctx context.Context, path string) ([]driver.FileInfo, error) { |
| 50 | + //TODO implement me |
| 51 | + panic("implement me") |
| 52 | +} |
| 53 | + |
| 54 | +func (d *Driver) Link(ctx context.Context, args driver.LinkArgs) (*driver.Link, error) { |
| 55 | + //TODO implement me |
| 56 | + panic("implement me") |
| 57 | +} |
| 58 | + |
| 59 | +func (d *Driver) MakeDir(ctx context.Context, path string) error { |
| 60 | + //TODO implement me |
| 61 | + panic("implement me") |
| 62 | +} |
| 63 | + |
| 64 | +func (d *Driver) Move(ctx context.Context, src, dst string) error { |
| 65 | + //TODO implement me |
| 66 | + panic("implement me") |
| 67 | +} |
| 68 | + |
| 69 | +func (d *Driver) Rename(ctx context.Context, src, dst string) error { |
| 70 | + //TODO implement me |
| 71 | + panic("implement me") |
| 72 | +} |
| 73 | + |
| 74 | +func (d *Driver) Copy(ctx context.Context, src, dst string) error { |
| 75 | + //TODO implement me |
| 76 | + panic("implement me") |
| 77 | +} |
| 78 | + |
| 79 | +func (d *Driver) Remove(ctx context.Context, path string) error { |
| 80 | + //TODO implement me |
| 81 | + panic("implement me") |
| 82 | +} |
| 83 | + |
| 84 | +func (d *Driver) Put(ctx context.Context, stream driver.FileStream, parentPath string) error { |
| 85 | + //TODO implement me |
| 86 | + panic("implement me") |
| 87 | +} |
| 88 | + |
| 89 | +var _ driver.Driver = (*Driver)(nil) |
| 90 | + |
| 91 | +func init() { |
| 92 | + driver.RegisterDriver(config.Name, New) |
| 93 | +} |
0 commit comments