drivers

package
v1.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 8, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddDriver

func AddDriver(name string, driver Driver)

Types

type BaseDriver

type BaseDriver struct {
	TargetPath string
}

func (*BaseDriver) GetTargetPath

func (d *BaseDriver) GetTargetPath() string

func (*BaseDriver) SetTargetPath

func (d *BaseDriver) SetTargetPath(targetPath string)

type Driver

type Driver interface {
	// Implementation
	Init() error
	ListDirs(path string) ([]string, error)
	Mkdir(path string) error
	Delete(src string) error
	Copy(src, dst string) (int64, error)

	// baseDriver
	SetTargetPath(path string)
	GetTargetPath() string
}

func GetDriver

func GetDriver(name string) (Driver, error)

type DryRunDriver added in v1.1.0

type DryRunDriver struct {
	BaseDriver
	Wrapped Driver
}

func (*DryRunDriver) Copy added in v1.1.0

func (d *DryRunDriver) Copy(src, dst string) (int64, error)

func (*DryRunDriver) Delete added in v1.1.0

func (d *DryRunDriver) Delete(src string) error

func (*DryRunDriver) GetTargetPath added in v1.1.0

func (d *DryRunDriver) GetTargetPath() string

func (*DryRunDriver) Init added in v1.1.0

func (d *DryRunDriver) Init() error

func (*DryRunDriver) ListDirs added in v1.1.0

func (d *DryRunDriver) ListDirs(path string) ([]string, error)

func (*DryRunDriver) Mkdir added in v1.1.0

func (d *DryRunDriver) Mkdir(path string) error

func (*DryRunDriver) SetTargetPath added in v1.1.0

func (d *DryRunDriver) SetTargetPath(path string)

type LocalDriver

type LocalDriver struct {
	BaseDriver
}

func (*LocalDriver) Copy

func (d *LocalDriver) Copy(src, dst string) (int64, error)

func (*LocalDriver) Delete

func (d *LocalDriver) Delete(src string) error

func (*LocalDriver) Init

func (d *LocalDriver) Init() error

func (*LocalDriver) ListDirs

func (d *LocalDriver) ListDirs(path string) ([]string, error)

func (*LocalDriver) Mkdir

func (d *LocalDriver) Mkdir(path string) error

type S3Driver

type S3Driver struct {
	BaseDriver
	// contains filtered or unexported fields
}

func (*S3Driver) Copy

func (d *S3Driver) Copy(src, dst string) (int64, error)

func (*S3Driver) Delete

func (d *S3Driver) Delete(src string) error

func (*S3Driver) Init

func (d *S3Driver) Init() error

func (*S3Driver) ListDirs

func (d *S3Driver) ListDirs(path string) ([]string, error)

func (*S3Driver) Mkdir

func (d *S3Driver) Mkdir(path string) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL