Versions in this module Expand all Collapse all v0 v0.0.1 Apr 7, 2021 Changes in this version + var ErrServerClosed = errors.New("ftp: Server closed") + func Version() string + type Auth interface + CheckPasswd func(string, string) (bool, error) + type Command interface + Execute func(*Conn, string) + IsExtend func() bool + RequireAuth func() bool + RequireParam func() bool + type Conn struct + func (conn *Conn) Close() + func (conn *Conn) IsLogin() bool + func (conn *Conn) LoginUser() string + func (conn *Conn) PassivePort() int + func (conn *Conn) PublicIp() string + func (conn *Conn) Serve() + type DataSocket interface + Close func() error + Host func() string + Port func() int + Read func(p []byte) (n int, err error) + ReadFrom func(r io.Reader) (int64, error) + Write func(p []byte) (n int, err error) + type DiscardLogger struct + func (logger *DiscardLogger) Print(sessionId string, message interface{}) + func (logger *DiscardLogger) PrintCommand(sessionId string, command string, params string) + func (logger *DiscardLogger) PrintResponse(sessionId string, code int, message string) + func (logger *DiscardLogger) Printf(sessionId string, format string, v ...interface{}) + type Driver interface + ChangeDir func(string) error + DeleteDir func(string) error + DeleteFile func(string) error + GetFile func(string, int64) (int64, io.ReadCloser, error) + Init func(*Conn) + ListDir func(string, func(FileInfo) error) error + MakeDir func(string) error + PutFile func(string, io.Reader, bool) (int64, error) + Rename func(string, string) error + Stat func(string) (FileInfo, error) + type DriverFactory interface + NewDriver func() (Driver, error) + type FileInfo interface + Group func() string + Owner func() string + type Logger interface + Print func(sessionId string, message interface{}) + PrintCommand func(sessionId string, command string, params string) + PrintResponse func(sessionId string, code int, message string) + Printf func(sessionId string, format string, v ...interface{}) + type Perm interface + ChGroup func(string, string) error + ChMode func(string, os.FileMode) error + ChOwner func(string, string) error + GetGroup func(string) (string, error) + GetMode func(string) (os.FileMode, error) + GetOwner func(string) (string, error) + type Server struct + func NewServer(opts *ServerOpts) *Server + func (server *Server) ListenAndServe() error + func (server *Server) Serve(l net.Listener) error + func (server *Server) Shutdown() error + type ServerOpts struct + Auth Auth + CertFile string + ExplicitFTPS bool + Factory DriverFactory + Hostname string + KeyFile string + Logger Logger + Name string + PassivePorts string + Port int + PublicIp string + TLS bool + WelcomeMessage string + type SimpleAuth struct + Name string + Password string + func (a *SimpleAuth) CheckPasswd(name, pass string) (bool, error) + type SimplePerm struct + func NewSimplePerm(owner, group string) *SimplePerm + func (s *SimplePerm) ChGroup(string, string) error + func (s *SimplePerm) ChMode(string, os.FileMode) error + func (s *SimplePerm) ChOwner(string, string) error + func (s *SimplePerm) GetGroup(string) (string, error) + func (s *SimplePerm) GetMode(string) (os.FileMode, error) + func (s *SimplePerm) GetOwner(string) (string, error) + type StdLogger struct + func (logger *StdLogger) Print(sessionId string, message interface{}) + func (logger *StdLogger) PrintCommand(sessionId string, command string, params string) + func (logger *StdLogger) PrintResponse(sessionId string, code int, message string) + func (logger *StdLogger) Printf(sessionId string, format string, v ...interface{})