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) ReloadConfig() 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 ¶ added in v0.7.0
The ClientDriver is the internal structure used for handling the client. At this stage it's limited to the afero.Fs
func (*ClientDriver) Symlink ¶ added in v0.16.0
func (d *ClientDriver) Symlink(oldname, newname string) error
Symlink creates a symbolic link. It implements ftpserverlib's ClientDriverExtensionSymlink interface (the "SITE SYMLINK" command), delegating to the underlying filesystem when it supports symlinks (the local OS backend does). Backends that can't create symlinks return an *os.LinkError wrapping afero.ErrNoSymlink. See #980.
type Server ¶ added in v0.7.0
type Server struct {
// contains filtered or unexported fields
}
Server structure
func (*Server) AuthUser ¶ added in v0.7.0
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 ¶ added in v0.7.0
func (s *Server) ClientConnected(cc serverlib.ClientContext) (string, error)
ClientConnected is called to send the very first welcome message
func (*Server) ClientDisconnected ¶ added in v0.7.0
func (s *Server) ClientDisconnected(cc serverlib.ClientContext)
ClientDisconnected is called when the user disconnects, even if he never authenticated
func (*Server) GetSettings ¶ added in v0.7.0
GetSettings returns some general settings around the server setup
func (*Server) GetTLSConfig ¶ added in v0.7.0
GetTLSConfig returns a TLS Certificate to use The certificate could frequently change if we use something like "let's encrypt"