ftp

package
v0.1.2-alpha Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package ftp provides an FTP client that implements remote.Client.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Host config.Host
	// contains filtered or unexported fields
}

Client wraps an FTP connection.

func Connect

func Connect(ctx context.Context, host config.Host) (*Client, error)

Connect dials an FTP server and logs in.

func (*Client) Close

func (c *Client) Close() error

Close logs out and closes the connection.

func (*Client) DeleteFile

func (c *Client) DeleteFile(remotePath string) error

DeleteFile removes a file on the remote host.

func (*Client) DownloadFile

func (c *Client) DownloadFile(remotePath, localPath string) error

DownloadFile copies a remote file to a local path.

func (*Client) ReadFile

func (c *Client) ReadFile(remotePath string) ([]byte, error)

ReadFile reads the full contents of a remote file.

func (*Client) Stat

func (c *Client) Stat(remotePath string) (os.FileInfo, error)

Stat returns file info for a remote path.

func (*Client) UploadFile

func (c *Client) UploadFile(localPath, remotePath string) error

UploadFile copies a local file to a remote path.

func (*Client) WalkFiles

func (c *Client) WalkFiles(remoteRoot string, fn func(string) error) error

WalkFiles calls fn for every regular file under remoteRoot, recursively.

func (*Client) WriteFile

func (c *Client) WriteFile(remotePath string, data []byte) error

WriteFile writes data to a remote path, creating parent directories as needed.

Jump to

Keyboard shortcuts

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