Documentation ¶
Index ¶
- type Client
- func (c *Client) Download(filePath string) error
- func (c *Client) DownloadFile(file *os.File) error
- func (c *Client) DownloadWriter(writer io.Writer) error
- func (c *Client) Upload(filePath string) error
- func (c *Client) UploadFile(remoteFilepath string, file *os.File) error
- func (c *Client) UploadReader(remoteFilepath string, source io.Reader) error
- type Entry
- type EntryType
- type FTPS
- func (ftps *FTPS) ChangeWorkingDirectory(path string) (err error)
- func (ftps *FTPS) Connect(host string, port int, isImplicit bool) (err error)
- func (ftps *FTPS) DeleteFile(path string) (err error)
- func (ftps *FTPS) List() (entries []Entry, err error)
- func (ftps *FTPS) Login(username, password string) (err error)
- func (ftps *FTPS) MakeDirectory(path string) (err error)
- func (ftps *FTPS) Noop() (err error)
- func (ftps *FTPS) PrintWorkingDirectory() (directory string, err error)
- func (ftps *FTPS) PutFile(remoteFilepath string, f *os.File) (err error)
- func (ftps *FTPS) Quit() (err error)
- func (ftps *FTPS) RemoveDirectory(path string) (err error)
- func (ftps *FTPS) Rename(from, to string) error
- func (ftps *FTPS) RetrieveFile(remoteFilepath string, file *os.File) (err error)
- func (ftps *FTPS) RetrieveFileData(remoteFilepath string) (data []byte, err error)
- func (ftps *FTPS) RetrieveWriter(remoteFilepath string, w io.Writer) (err error)
- func (ftps *FTPS) SizeFile(path string) (res string, err error)
- func (ftps *FTPS) StoreFile(remoteFilepath string, f *os.File) (err error)
- func (ftps *FTPS) StoreReader(remoteFilepath string, r io.Reader) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client FTPS Client
func (*Client) DownloadFile ¶
DownloadFile file from server
func (*Client) DownloadWriter ¶
DownloadFile file from server
func (*Client) UploadFile ¶
UploadFile file to Server
type FTPS ¶
type FTPS struct { Debug bool TLSConfig tls.Config SendDone chan bool // contains filtered or unexported fields }
func (*FTPS) ChangeWorkingDirectory ¶
func (*FTPS) DeleteFile ¶
func (*FTPS) MakeDirectory ¶
func (*FTPS) PrintWorkingDirectory ¶
func (*FTPS) RemoveDirectory ¶
func (*FTPS) RetrieveFile ¶
func (*FTPS) RetrieveFileData ¶
func (*FTPS) RetrieveWriter ¶
func (*FTPS) StoreReader ¶
func shutdownWrite(conn net.Conn) { // anonymous interface. Could explicitly use TCP instead. if v, ok := conn.(interface{ CloseWrite() error }); ok { v.CloseWrite() } }
func (ftps *FTPS) WaitClose(c net.Conn) { one := make([]byte, 1) c.SetReadDeadline(time.Now()) for true { if _, err := c.Read(one); err == io.EOF { c.Close() c = nil ftps.SendDone <- true } else { c.SetReadDeadline(time.Now().Add(10 * time.Millisecond)) } } }
Click to show internal directories.
Click to hide internal directories.