Documentation
¶
Overview ¶
Package ftp provides functions for interacting with a FTP server.
Index ¶
Constants ¶
View Source
const ( DefaultPort = 21 DefaultTimeout = 5 * time.Second )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
Reader implements the io.ReadCloser interface to enabling reading a remote file on a FTP server and closing the underlying connections.
func Fetch ¶
Fetch returns a Reader for an object for given FTP address. ReadFTPFile returns the Reader and error, if any.
ReadFTPFile returns an error if the address cannot be dialed, the userinfo cannot be parsed, the user and password are invalid, or the file cannot be retrieved.
func NewReader ¶
func NewReader(response *ftp.Response, server *ftp.ServerConn) *Reader
NewReader creates a new Reader for reading from a FTP server.
func NewReaderWithDeadline ¶
func NewReaderWithDeadline(response *ftp.Response, server *ftp.ServerConn, deadline time.Time) (*Reader, error)
NewReaderWithDeadline creates a new Reader for reading from a FTP server with a set deadline.
Click to show internal directories.
Click to hide internal directories.