Documentation
¶
Index ¶
- type Config
- type FTPDownloader
- func (f *FTPDownloader) ChangeWorkingDirectory(path string) error
- func (f *FTPDownloader) Close() error
- func (f *FTPDownloader) Connect(ctx context.Context, serverURL string) error
- func (f *FTPDownloader) Download(ctx context.Context, urlStr string, writer io.Writer) error
- func (f *FTPDownloader) GetCurrentDirectory() (string, error)
- func (f *FTPDownloader) GetFileSize(ctx context.Context, urlStr string) (int64, error)
- func (f *FTPDownloader) IsConnected() bool
- func (f *FTPDownloader) ListFiles(ctx context.Context, urlStr string) ([]string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Timeout time.Duration
DialTimeout time.Duration
Username string
Password string
TLSConfig interface{} // For FTPS support
PassiveMode bool
DebugMode bool
}
Config holds FTP connection configuration
type FTPDownloader ¶
type FTPDownloader struct {
// contains filtered or unexported fields
}
FTPDownloader handles FTP protocol downloads
func NewFTPDownloader ¶
func NewFTPDownloader(config *Config) *FTPDownloader
NewFTPDownloader creates a new FTP downloader instance
func (*FTPDownloader) ChangeWorkingDirectory ¶
func (f *FTPDownloader) ChangeWorkingDirectory(path string) error
ChangeWorkingDirectory changes the current working directory on the FTP server
func (*FTPDownloader) Connect ¶
func (f *FTPDownloader) Connect(ctx context.Context, serverURL string) error
Connect establishes a connection to the FTP server
func (*FTPDownloader) Download ¶
Download downloads a file from FTP server and writes it to the provided writer
func (*FTPDownloader) GetCurrentDirectory ¶
func (f *FTPDownloader) GetCurrentDirectory() (string, error)
GetCurrentDirectory returns the current working directory on the FTP server
func (*FTPDownloader) GetFileSize ¶
GetFileSize retrieves the size of a file on the FTP server
func (*FTPDownloader) IsConnected ¶
func (f *FTPDownloader) IsConnected() bool
IsConnected returns true if the FTP client is connected
Click to show internal directories.
Click to hide internal directories.