Documentation ¶
Overview ¶
Package server contains the core FTP server code
Index ¶
- Variables
- type ClientDriver
- type Server
- func (s *Server) AuthUser(cc serverlib.ClientContext, user, pass string) (serverlib.ClientDriver, error)
- func (s *Server) ClientConnected(cc serverlib.ClientContext) (string, error)
- func (s *Server) ClientDisconnected(cc serverlib.ClientContext)
- func (s *Server) GetSettings() (*serverlib.Settings, error)
- func (s *Server) GetTLSConfig() (*tls.Config, error)
- func (s *Server) Stop()
- func (s *Server) WaitGracefully(timeout time.Duration) error
Constants ¶
This section is empty.
Variables ¶
var ErrNotEnabled = errors.New("not enabled")
ErrNotEnabled is returned when a feature hasn't been enabled
var ErrTimeout = errors.New("timeout")
ErrTimeout is returned when an operation timeouts
Functions ¶
This section is empty.
Types ¶
type ClientDriver ¶
The ClientDriver is the internal structure used for handling the client. At this stage it's limited to the afero.Fs
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server structure
func (*Server) AuthUser ¶
func (s *Server) AuthUser(cc serverlib.ClientContext, user, pass string) (serverlib.ClientDriver, error)
AuthUser authenticates the user and selects an handling driver
func (*Server) ClientConnected ¶
func (s *Server) ClientConnected(cc serverlib.ClientContext) (string, error)
ClientConnected is called to send the very first welcome message
func (*Server) ClientDisconnected ¶
func (s *Server) ClientDisconnected(cc serverlib.ClientContext)
ClientDisconnected is called when the user disconnects, even if he never authenticated
func (*Server) GetSettings ¶
GetSettings returns some general settings around the server setup
func (*Server) GetTLSConfig ¶
GetTLSConfig returns a TLS Certificate to use The certificate could frequently change if we use something like "let's encrypt"