Categorygithub.com/discobean/goftp-server
modulepackage
0.0.16
Repository: https://github.com/discobean/goftp-server.git
Documentation: pkg.go.dev

# README

server

Moved to https://gitea.com/goftp/server

CircleCI codecov

A FTP server framework forked from github.com/yob/graval and changed a lot.

Full documentation for the package is available on godoc

Version

v0.2.3

Installation

go get github.com/goftp/server

Usage

To boot a FTP server you will need to provide a driver that speaks to your persistence layer - the required driver contract is in the documentation.

Look at the file driver to see an example of how to build a backend.

There is a sample ftp server as a demo. You can build it with this command:

go install github.com/goftp/server/exampleftpd

Then run it if you have add $GOPATH to your $PATH:

exampleftpd -root /tmp

And finally, connect to the server with any FTP client and the following details:

host: 127.0.0.1
port: 2121
username: admin
password: 123456

This uses the file driver mentioned above to serve files.

Contributors

see https://github.com/goftp/server/graphs/contributors

Warning

FTP is an incredibly insecure protocol. Be careful about forcing users to authenticate with an username or password that are important.

License

This library is distributed under the terms of the MIT License. See the included file for more detail.

Contributing

All suggestions and patches welcome, preferably via a git repository I can pull from. If this library proves useful to you, please let me know.

Further Reading

There are a range of RFCs that together specify the FTP protocol. In chronological order, the more useful ones are:

For an english summary that's somewhat more legible than the RFCs, and provides some commentary on what features are actually useful or relevant 24 years after RFC959 was published:

For a history lesson, check out Appendix III of RCF959. It lists the preceding (obsolete) RFC documents that relate to file transfers, including the ye old RFC114 from 1971, "A File Transfer Protocol"

This library is heavily based on em-ftpd, an FTPd framework with similar design goals within the ruby and EventMachine ecosystems. It worked well enough, but you know, callbacks and event loops make me something something.

# Packages

This is a very simple ftpd server using this library as an example and as something to run tests against.

# Functions

NewServer initialises a new FTP server.
No description provided by the author
Version returns the library version.

# Variables

ErrServerClosed is returned by ListenAndServe() or Serve() when a shutdown was requested.

# Structs

No description provided by the author
Silent logger, produces no output.
Server is the root of your FTP application.
ServerOpts contains parameters for server.NewServer().
SimpleAuth implements Auth interface to provide a memory user login auth.
No description provided by the author
Use an instance of this to log in a standard format.

# Interfaces

Auth is an interface to auth your ftp user login.
No description provided by the author
DataSocket describes a data socket is used to send non-control data between the client and server.
Driver is an interface that you will create an implementation that speaks to your chosen persistence layer.
DriverFactory is a driver factory to create driver.
No description provided by the author
No description provided by the author
No description provided by the author

# Type aliases

Permissions is a map name value pair to store users data upon successful login.