Documentation
¶
Overview ¶
Package ftp implements the "ftp" protocol.Protocol driver. It speaks plain FTP and FTPS. The control connection is one command at a time, so a call takes one session from a pool and gives it back. Every transfer also opens a data connection.
The client library sets no deadline after the TCP connect. Each call sets a deadline on the control connection and on each data connection, and a watchdog closes those connections when the budget ends.
Uploads and deletes change files on the server. They need allow_writes, and a fixed path or a delete also needs allow_admin. An account that can only touch a scratch directory is the real lock.
Index ¶
- Variables
- type Driver
- func (d *Driver) Call(opts map[string]string, body []byte, timeout time.Duration) (*Driver, error)
- func (d *Driver) Close() error
- func (d *Driver) Do(ctx context.Context) (protocol.Result, error)
- func (d *Driver) DoTimed(ctx context.Context) (protocol.Result, xfercommon.Timing, error)
- func (d *Driver) Name() string
- func (d *Driver) Run(parent context.Context) (protocol.Result, Reply)
- type Entry
- type Reply
- type Timing
Constants ¶
This section is empty.
Variables ¶
var Options = append([]string{ "mode", "path", "size", "fill", "expect_size", "expect_sha256", "expect", "limit", "hidden", "username", "password_env", "tls", "tls_verify", "tls_max", "sessions", "connection", "data_host", "epsv", "allow_writes", "allow_admin", }, tlsconf.Keys...)
Options are the -opt keys this driver accepts.
Functions ¶
This section is empty.
Types ¶
type Driver ¶
type Driver struct {
// contains filtered or unexported fields
}
Driver is an FTP protocol.Protocol.
func NewConn ¶
NewConn is New for a script. password is already known, so password_env is not read. The job of each call is set with Call.
func (*Driver) Call ¶
Call returns a driver for one script call. It shares the pool. Close on it does nothing.
type Entry ¶
type Entry = xfercommon.Entry
Entry, Timing and Reply are the shared file-transfer values.
type Reply ¶
type Reply = xfercommon.Reply
type Timing ¶
type Timing = xfercommon.Timing