Versions in this module Expand all Collapse all v0 v0.12.5 Feb 22, 2021 Changes in this version + const StatusActionAborted + const StatusActionNotTaken + const StatusActionNotTakenNoFile + const StatusAuthAccepted + const StatusBadCommandSequence + const StatusCannotOpenDataConnection + const StatusClosingControlConn + const StatusClosingDataConn + const StatusCommandNotImplemented + const StatusDirectoryStatus + const StatusEnteringEPSV + const StatusEnteringPASV + const StatusFileActionNotTaken + const StatusFileActionPending + const StatusFileOK + const StatusFileStatus + const StatusFileStatusOK + const StatusHelpMessage + const StatusNotImplemented + const StatusNotImplementedParam + const StatusNotLoggedIn + const StatusOK + const StatusPathCreated + const StatusServiceNotAvailable + const StatusServiceReady + const StatusSyntaxErrorNotRecognised + const StatusSyntaxErrorParameters + const StatusSystemStatus + const StatusSystemType + const StatusTransferAborted + const StatusUserLoggedIn + const StatusUserOK + var ErrNoAvailableListeningPort = errors.New("could not find any port to listen to") + var ErrNotListening = errors.New("we aren't listening") + var ErrRemoteAddrFormat = errors.New("remote address has a bad format") + type ClientContext interface + Close func() error + Debug func() bool + GetClientVersion func() string + GetLastCommand func() string + HasTLSForControl func() bool + HasTLSForTransfers func() bool + ID func() uint32 + LocalAddr func() net.Addr + Path func() string + RemoteAddr func() net.Addr + SetDebug func(debug bool) + type ClientDriver interface + type ClientDriverExtensionAllocate interface + AllocateSpace func(size int) error + type ClientDriverExtensionAvailableSpace interface + GetAvailableSpace func(dirName string) (int64, error) + type ClientDriverExtensionFileList interface + ReadDir func(name string) ([]os.FileInfo, error) + type ClientDriverExtensionHasher interface + ComputeHash func(name string, algo HASHAlgo, startOffset, endOffset int64) (string, error) + type ClientDriverExtensionRemoveDir interface + RemoveDir func(name string) error + type ClientDriverExtensionSymlink interface + Symlink func(oldname, newname string) error + type ClientDriverExtentionFileTransfer interface + GetHandle func(name string, flags int, offset int64) (FileTransfer, error) + type CommandDescription struct + Fn func(*clientHandler, string) error + Open bool + SpecialAction bool + TransferRelated bool + type FileTransfer interface + type FileTransferError interface + TransferError func(err error) + type FtpServer struct + Logger log.Logger + func NewFtpServer(driver MainDriver) *FtpServer + func (server *FtpServer) Addr() string + func (server *FtpServer) Listen() error + func (server *FtpServer) ListenAndServe() error + func (server *FtpServer) Serve() error + func (server *FtpServer) Stop() error + type HASHAlgo int + const HASHAlgoCRC32 + const HASHAlgoMD5 + const HASHAlgoSHA1 + const HASHAlgoSHA256 + const HASHAlgoSHA512 + type MainDriver interface + AuthUser func(cc ClientContext, user, pass string) (ClientDriver, error) + ClientConnected func(cc ClientContext) (string, error) + ClientDisconnected func(cc ClientContext) + GetSettings func() (*Settings, error) + GetTLSConfig func() (*tls.Config, error) + type PortRange struct + End int + Start int + type PublicIPResolver func(ClientContext) (string, error) + type Settings struct + ActiveTransferPortNon20 bool + Banner string + ConnectionTimeout int + DefaultTransferType TransferType + DisableActiveMode bool + DisableLISTArgs bool + DisableMFMT bool + DisableMLSD bool + DisableMLST bool + DisableSTAT bool + DisableSYST bool + DisableSite bool + EnableCOMB bool + EnableHASH bool + IdleTimeout int + ListenAddr string + Listener net.Listener + PassiveTransferPortRange *PortRange + PublicHost string + PublicIPResolver PublicIPResolver + TLSRequired TLSRequirement + type TLSRequirement int + const ClearOrEncrypted + const ImplicitEncryption + const MandatoryEncryption + type TransferType int + const TransferTypeASCII + const TransferTypeBinary