Sen descrición

Julien Laffaye b9f3ade291 Merge branch 'master' of github.com:jlaffaye/ftp %!s(int64=4) %!d(string=hai) anos
.github 6841a2daa0 stale bot: ignore accepted issues %!s(int64=4) %!d(string=hai) anos
.travis.yml dfb8646068 Fix get of golint %!s(int64=4) %!d(string=hai) anos
LICENSE 3a7f65cd20 Update copyright years. %!s(int64=11) %!d(string=hai) anos
README.md d4caf6ffca Add close on read example %!s(int64=4) %!d(string=hai) anos
client_test.go 827e50c0bd Add support for append (APPE) command %!s(int64=4) %!d(string=hai) anos
conn_test.go 827e50c0bd Add support for append (APPE) command %!s(int64=4) %!d(string=hai) anos
debug.go 8b7b512afb Add DialWithDebugOutput to log commands. %!s(int64=5) %!d(string=hai) anos
ftp.go b9f3ade291 Merge branch 'master' of github.com:jlaffaye/ftp %!s(int64=4) %!d(string=hai) anos
go.mod c037483193 Create Go module. %!s(int64=4) %!d(string=hai) anos
go.sum c037483193 Create Go module. %!s(int64=4) %!d(string=hai) anos
parse.go c1312a7102 Correctly parse symlink (#152) %!s(int64=5) %!d(string=hai) anos
parse_test.go c1312a7102 Correctly parse symlink (#152) %!s(int64=5) %!d(string=hai) anos
scanner.go 602886c6b8 Do not export the scanner type %!s(int64=7) %!d(string=hai) anos
scanner_test.go 602886c6b8 Do not export the scanner type %!s(int64=7) %!d(string=hai) anos
status.go ac1574d383 Add DialWithExplicitTLS %!s(int64=4) %!d(string=hai) anos
status_test.go 8019e67744 Add tests for StatusText %!s(int64=5) %!d(string=hai) anos
walker.go 37a04759dd Fixed a typo so that we are no longer ignoring an error and am now using path.Join instead of fmt.Sprintf() %!s(int64=4) %!d(string=hai) anos
walker_test.go 74a8c4bcbc Renamed Step func to Next() as per PR comments %!s(int64=5) %!d(string=hai) anos

README.md

goftp

Build Status Coverage Status Go ReportCard godoc.org

A FTP client package for Go

Install

go get -u github.com/jlaffaye/ftp

Example

c, err := ftp.Dial("ftp.example.org:21", ftp.DialWithTimeout(5*time.Second))
if err != nil {
    log.Fatal(err)
}

err = c.Login("anonymous", "anonymous")
if err != nil {
    log.Fatal(err)
}

// Do something with the FTP conn

if err := c.Quit(); err != nil {
    log.Fatal(err)
}

Store a file example

data := bytes.NewBufferString("Hello World")
err = c.Stor("test-file.txt", data)
if err != nil {
	panic(err)
}

Read a file example

r, err := c.Retr("test-file.txt")
if err != nil {
	panic(err)
}
defer r.Close()

buf, err := ioutil.ReadAll(r)
println(string(buf))