Documentation ¶
Index ¶
- Constants
- Variables
- func New(fs afero.Fs) *ftpserver.FtpServer
- type Driver
- func (d *Driver) AuthUser(_ ftpserver.ClientContext, user, pass string) (ftpserver.ClientDriver, error)
- func (d *Driver) ClientConnected(cc ftpserver.ClientContext) (string, error)
- func (d *Driver) ClientDisconnected(cc ftpserver.ClientContext)
- func (d *Driver) GetSettings() (*ftpserver.Settings, error)
- func (d *Driver) GetTLSConfig() (*tls.Config, error)
Constants ¶
View Source
const IPResolveURL = "https://ipinfo.io/ip"
Variables ¶
View Source
var ( ErrNoTLS = errors.New("TLS is not configured") // Error for missing TLS configuration ErrBadUserNameOrPassword = errors.New("bad username or password") // Error for failed authentication )
Define custom error messages
Functions ¶
Types ¶
type Driver ¶
type Driver struct { Fs afero.Fs // The file system to serve over FTP Debug bool // Debug mode flag Settings *ftpserver.Settings // The FTP server settings // contains filtered or unexported fields }
Driver is the FTP server driver implementation.
func (*Driver) AuthUser ¶
func (d *Driver) AuthUser(_ ftpserver.ClientContext, user, pass string) (ftpserver.ClientDriver, error)
AuthUser authenticates a user during the FTP server login process.
func (*Driver) ClientConnected ¶
ClientConnected is called when a client is connected to the FTP server.
func (*Driver) ClientDisconnected ¶
func (d *Driver) ClientDisconnected(cc ftpserver.ClientContext)
ClientDisconnected is called when a client is disconnected from the FTP server.
func (*Driver) GetSettings ¶
GetSettings returns the FTP server settings.
Click to show internal directories.
Click to hide internal directories.