ftp

package
v4.1.23 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2022 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 Client added in v4.1.13

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

func NewClient

func NewClient(username, password, ftpHost string) (Client, error)

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

type Downloader

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

func NewDownloader

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

func (*Downloader) Sync

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

type FileInfoMap

type FileInfoMap map[string]os.FileInfo

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