Documentation
¶
Overview ¶
Package joeftp implements a FTP client descrive in RFC 959
see https://www.ietf.org/rfc/rfc959.txt
https://www.ietf.org/rfc/rfc2428.txt https://www.ietf.org/rfc/rfc4217.txt
Currently FTP commands supports ==============================
Yes - USER <SP> <username> <CRLF> Yes - PASS <SP> <password> <CRLF> No - ACCT <SP> <account-information> <CRLF> No - CWD <SP> <pathname> <CRLF> No - CDUP <CRLF> No - SMNT <SP> <pathname> <CRLF> Yes - QUIT <CRLF> No - REIN <CRLF> No - PORT <SP> <host-port> <CRLF> No - PASV <CRLF> Yes - TYPE <SP> <type-code> <CRLF> No - STRU <SP> <structure-code> <CRLF> No - MODE <SP> <mode-code> <CRLF> Yes - RETR <SP> <pathname> <CRLF> Yes - STOR <SP> <pathname> <CRLF> No - STOU <CRLF> No - APPE <SP> <pathname> <CRLF> No - ALLO <SP> <decimal-integer> [<SP> R <SP> <decimal-integer>] <CRLF> No - REST <SP> <marker> <CRLF> No - RNFR <SP> <pathname> <CRLF> No - RNTO <SP> <pathname> <CRLF> No - ABOR <CRLF> Yes - DELE <SP> <pathname> <CRLF> No - RMD <SP> <pathname> <CRLF> No - MKD <SP> <pathname> <CRLF> Yes - PWD <CRLF> Yes - LIST [<SP> <pathname>] <CRLF> No - NLST [<SP> <pathname>] <CRLF> Yes - SITE <SP> <string> <CRLF> No - SYST <CRLF> Yes - STAT [<SP> <pathname>] <CRLF> No - HELP [<SP> <string>] <CRLF> No - NOOP <CRLF> Non Passive command ABOR, ALLO, DELE, CWD, CDUP, SMNT, HELP, MODE, NOOP, PASV, QUIT, SITE, PORT, SYST, STAT, RMD, MKD, PWD, STRU, and TYPE. Commands that require passive APPE, LIST, NLST, REIN, RETR, STOR, and STOU.
Index ¶
- type JoeFtp
- func (ftp *JoeFtp) Close() error
- func (ftp *JoeFtp) Connect() (int, string, error)
- func (ftp *JoeFtp) DeleteFile(fileName string) (int, string, error)
- func (ftp *JoeFtp) List() (int, string, []byte, error)
- func (ftp *JoeFtp) Logon(userName string, password string) (int, string, error)
- func (ftp *JoeFtp) LogonAnonymous() (int, string, error)
- func (ftp *JoeFtp) Quit() (int, string, error)
- func (ftp *JoeFtp) RetreiveFile(fileName string) (int, string, []byte, error)
- func (ftp *JoeFtp) SendCommand(command string) (int, string, error)
- func (ftp *JoeFtp) Site(parameters string) (int, string, error)
- func (ftp *JoeFtp) Stat() (int, string, error)
- func (ftp *JoeFtp) StoreBytes(fileName string, data []byte) (int, string, []byte, error)
- func (ftp *JoeFtp) StoreFile(fileName string, filePath string) (int, string, []byte, error)
- func (ftp *JoeFtp) Type(parameters string) (int, string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type JoeFtp ¶
type JoeFtp struct { Host string Port int Timeout time.Duration FTPS bool ExtendedPassive bool DebugMode bool TlsInsecureSkipVerify bool TlsMinVersion uint16 // contains filtered or unexported fields }
JoeFtp structure to control access to a FTP server
func (*JoeFtp) DeleteFile ¶
DeleteFile This command causes the specifed file deleted from the FTP site used FTP commands: DELE
func (*JoeFtp) List ¶
List This command retries the current "list" for files to be transfered to the client used FTP commands: LIST & PASV
func (*JoeFtp) Logon ¶
Logon login to the specified FTP server using the supplied credentials used FTP commands: USER and PASS
func (*JoeFtp) LogonAnonymous ¶
LogonAnonymous login to the specified FTP server using the anonymous user (no password) used FTP commands: USER
func (*JoeFtp) RetreiveFile ¶
RetreiveFile This command causes the specifed file to be retrieved from the FTP site used FTP commands: RETR & PASV
func (*JoeFtp) SendCommand ¶
SendCommand send a command to the FTP server
func (*JoeFtp) Site ¶
Site This command is used by the server to provide services specific to his system that are essential to file transfer but not sufficiently universal to be included as commands in the protocol.
used FTP commands: SITE
func (*JoeFtp) Stat ¶
Stat This command shall cause a status response to be sent over the control connection in the form of a reply. used FTP commands: STAT
func (*JoeFtp) StoreBytes ¶
StoreBytes This command shall causes the specified byte stream to be transfered to the FTP server to a file used FTP commands: STOR & PASV