Documentation
¶
Overview ¶
Package sftp implements the "sftp" protocol.Protocol driver. It speaks the SSH File Transfer Protocol. One SSH connection is shared by the calls that use it, and those calls are multiplexed on one channel.
The SSH and SFTP libraries do not take a context. Each call runs a watchdog that closes the connection when the budget ends. A timeout closes that shared connection, so other calls on it fail too.
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, xfercommon.Reply)
Constants ¶
This section is empty.
Variables ¶
var Options = []string{
"mode", "path", "size", "fill", "expect_size", "expect_sha256", "expect",
"limit", "hidden", "username", "password_env", "key_file", "key_passphrase_env",
"host_key", "connections", "connection", "allow_writes", "allow_admin",
"concurrent_writes",
}
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 SFTP protocol.Protocol.
func NewConn ¶
func NewConn(target protocol.Target, timeout time.Duration, password, passphrase *string) (*Driver, error)
NewConn is New for a script. password and passphrase are already known, so the environment variables are 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 connections. Close on it does nothing.