Documentation ¶
Overview ¶
Package scp provides SCP functionality atop the go.crypto/ssh package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type File ¶
File is a file being read from or written to a remote host. It implements the io.Reader and os.FileInfo interfaces, with the io.Reader portion delegated through to a bufio.Reader in the case that this is a file being read from a remote host.
func NewFile ¶
NewFile constructs a new File object with the given parameters. The size must be provided in advance because the remote host has to know how large the file is, so it can reject it in advance if there's not enough space.
func Read ¶
Read opens a session on the provided ssh.Client to run the scp program remotely in "from" mode, and handles the SCP protocol to the degree required to read the content of a single file.
Errors that occur before the content is being read will be returned directly from Read, while errors that occur during content reception will be returned via the Reader (e.g. from Reader.Read).
func (File) ModTime ¶
ModTime returns the modification time of the file. It is currently not implemented and returns a zero value.