Documentation
¶
Overview ¶
Package ftp provides a minimal FTP client as defined in RFC 959.
Index ¶
- type Client
- func (client *Client) Binary(command string) (io.ReadWriteCloser, error)
- func (client *Client) Close() error
- func (client *Client) Do(command string) (Reply, error)
- func (client *Client) Login(username, password string) error
- func (client *Client) Quit() error
- func (client *Client) Text(command string) (io.ReadWriteCloser, error)
- type Code
- type Reply
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { Welcome Reply // contains filtered or unexported fields }
A Client is an FTP client. A single FTP connection cannot handle simultaneous transfers.
func (*Client) Binary ¶
func (client *Client) Binary(command string) (io.ReadWriteCloser, error)
Binary sends a command and opens a new passive data connection in image mode.
func (*Client) Do ¶
Do sends a command over the control connection and waits for the response. It returns any protocol error encountered while performing the command.
type Code ¶
type Code int
Code is an FTP reply code.
const ( CodeRestartMarker Code = 110 CodeServiceReadySoon Code = 120 CodeStartingTransfer Code = 125 CodeFileStatusOkay Code = 150 CodeOkay Code = 200 CodeSuperfluous Code = 202 CodeSystemStatus Code = 211 CodeDirectoryStatus Code = 212 CodeFileStatus Code = 213 CodeHelpMessage Code = 214 CodeSystemType Code = 215 CodeServiceReady Code = 220 CodeServiceClosing Code = 221 CodeNoTransfer Code = 225 CodeClosingData Code = 226 CodePassive Code = 227 CodeExtendedPassive Code = 229 CodeLoggedIn Code = 230 CodeActionOkay Code = 250 CodeCreated Code = 257 CodeNeedPassword Code = 331 CodeNeedAccount Code = 332 CodePendingInformation Code = 350 CodeServiceNotAvailable Code = 421 CodeCantOpenData Code = 425 CodeTransferAborted Code = 426 CodeActionNotTaken Code = 450 CodeLocalError Code = 451 CodeInsufficientStorage Code = 452 CodeUnrecognizedCommand Code = 500 CodeParameterSyntaxError Code = 501 CodeNotImplemented Code = 502 CodeBadSequence Code = 503 CodeParameterNotImplemented Code = 504 CodeNotLoggedIn Code = 530 CodeNoAccount Code = 532 CodePageTypeUnknown Code = 551 CodeExceededQuota Code = 552 CodeFileNameNotAllowed Code = 553 )
FTP reply codes defined in RFC 959.
func (Code) Complete ¶
Complete returns whether this code indicates a complete reply. A complete reply code is not necessarily positive.
func (Code) PositiveComplete ¶
PositiveComplete returns whether this code is a positive completion.
func (Code) Preliminary ¶
Preliminary returns whether the code indicates a preliminary positive reply.