Versions in this module Expand all Collapse all v0 v0.2.0 Nov 7, 2026 Changes in this version + var ErrNotConnected = errors.New("ftp: not connected") + var ErrResumeNotSeekable = errors.New("ftp: resume requires io.Seeker") + var ErrResumeNotSupported = errors.New("ftp: resume not supported") + var ErrResumeOffsetMismatch = errors.New("ftp: resume offset mismatch") + var ErrStopIteration = errors.New("ftp: stop iteration") + type Client interface + Close func() error + func NewClient(cfg Config) (Client, error) + type Config struct + Host string + Password string + Port int + Timeout time.Duration + TransferBufferSize int + User string + func ConfigDefault() Config + func (c *Config) Validate() error + func (c Config) Addr() string + type Downloader interface + Download func(ctx context.Context, remotePath, localPath string, opts ...TransferOption) error + DownloadWriter func(ctx context.Context, remotePath string, w io.Writer, opts ...TransferOption) error + type Entry struct + Name string + Size uint64 + Type EntryType + type EntryType int + const EntryTypeFile + const EntryTypeFolder + const EntryTypeLink + type ListIter struct + func (it *ListIter) Next() (Entry, error) + type Lister interface + List func(ctx context.Context, remoteDir string) ([]string, error) + ListEach func(ctx context.Context, remoteDir string, fn func(Entry) error) error + ListIter func(ctx context.Context, remoteDir string) (*ListIter, error) + WalkEach func(ctx context.Context, root string, fn func(Entry) error) error + type TransferOption func(*transferOpts) + func WithBufferSize(n int) TransferOption + func WithResume(enabled bool) TransferOption + func WithResumeOffset(n int64) TransferOption + type Uploader interface + Upload func(ctx context.Context, localPath, remotePath string, opts ...TransferOption) error + UploadReader func(ctx context.Context, r io.Reader, remotePath string, opts ...TransferOption) error