ftp

package
v4.1.11 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Downloader

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

func NewDownloader

func NewDownloader(client FtpClient, ftpPath string, storagePath string, filePrefix string) *Downloader

func (*Downloader) Sync

func (f *Downloader) Sync() ([]string, error)

type FileInfoMap

type FileInfoMap map[string]os.FileInfo

type FtpClient

type FtpClient interface {
	Retrieve(path string, dest io.Writer) error
	ReadDir(path string) ([]os.FileInfo, error)
	Close() error
}

func NewClient

func NewClient(username string, password string, ftp_host string) (FtpClient, error)

NewClient is a thin wrapper around goftp.DialConfig. Connects instantly to the specified server.

type MockFile

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

func (MockFile) IsDir

func (m MockFile) IsDir() bool

func (MockFile) ModTime

func (m MockFile) ModTime() time.Time

func (MockFile) Mode

func (m MockFile) Mode() os.FileMode

func (MockFile) Name

func (m MockFile) Name() string

func (MockFile) Size

func (m MockFile) Size() int64

func (MockFile) Sys

func (m MockFile) Sys() interface{}

type MockFtpClient

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

func NewMockClient

func NewMockClient() MockFtpClient

func (MockFtpClient) Close

func (m MockFtpClient) Close() error

func (MockFtpClient) ReadDir

func (m MockFtpClient) ReadDir(path string) ([]os.FileInfo, error)

func (MockFtpClient) Retrieve

func (m MockFtpClient) Retrieve(path string, dest io.Writer) error

func (*MockFtpClient) SetDirContent

func (m *MockFtpClient) SetDirContent(path string, filenames []string)

func (*MockFtpClient) SetFileContent

func (m *MockFtpClient) SetFileContent(path string, content []byte)

Jump to

Keyboard shortcuts

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