source

package
v0.0.0-...-e48dafa Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrSkipDir     = errors.New("skip dir")
	ErrStopWalking = errors.New("stop walking")
)

Functions

func CopyDirToLocal

func CopyDirToLocal(source Source, localDir, src string) (retErr error)

func CopyToLocal

func CopyToLocal(source Source, localFile, src string) (retErr error)

Types

type FTPServer

type FTPServer struct {
	// contains filtered or unexported fields
}

func OpenFTPServer

func OpenFTPServer(ctx context.Context, host, user, pass string) (*FTPServer, error)

func (*FTPServer) Open

func (s *FTPServer) Open(path string) (_ io.ReadCloser, retErr error)

func (*FTPServer) Rename

func (s *FTPServer) Rename(oldPath, newPath string) error

func (*FTPServer) Separator

func (s *FTPServer) Separator() string

func (*FTPServer) Walk

func (s *FTPServer) Walk(dir string, walkFn func(string, fs.FileInfo) error) error

Walk on the path

type Local

type Local struct {
	// contains filtered or unexported fields
}

func OpenLocal

func OpenLocal() (*Local, error)

func (*Local) Open

func (l *Local) Open(path string) (io.ReadCloser, error)

func (*Local) Rename

func (l *Local) Rename(oldPath, newPath string) error

func (*Local) Separator

func (l *Local) Separator() string

func (*Local) Walk

func (l *Local) Walk(dir string, walkFn func(string, fs.FileInfo) error) error

type Source

type Source interface {
	Walk(root string, walkFn func(string, fs.FileInfo) error) error
	Rename(oldPath, newPath string) error
	Open(path string) (io.ReadCloser, error)
	Separator() string
}

Jump to

Keyboard shortcuts

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