Versions in this module Expand all Collapse all v0 v0.0.1 Aug 4, 2024 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 ErrFileNameNotAllowed = errors.New("filename not allowed") + 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") + var ErrStorageExceeded = errors.New("storage limit exceeded") + func Control(_, _ string, c syscall.RawConn) error — darwin/amd64, linux/amd64 + func Control(network, address string, c syscall.RawConn) error — js/wasm, windows/amd64 + type ClientContext interface + Close func() error + Debug func() bool + Extra func() any + GetClientVersion func() string + GetLastCommand func() string + GetLastDataChannel func() DataChannel + HasTLSForControl func() bool + HasTLSForTransfers func() bool + ID func() uint32 + LocalAddr func() net.Addr + Path func() string + RemoteAddr func() net.Addr + SetDebug func(debug bool) + SetExtra func(extra any) + SetListPath func(value string) + SetPath func(value string) + SetTLSRequirement func(requirement TLSRequirement) error + 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 DataChannel int8 + const DataChannelActive + const DataChannelPassive + type DataConnectionRequirement int8 + const IPMatchDisabled + const IPMatchRequired + type DriverError struct + func (e DriverError) Error() string + func (e DriverError) Unwrap() error + type FileAccessError struct + func (e FileAccessError) Error() string + func (e FileAccessError) Unwrap() error + 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 int8 + 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 MainDriverExtensionPassiveWrapper interface + WrapPassiveListener func(listener net.Listener) (net.Listener, error) + type MainDriverExtensionPostAuthMessage interface + PostAuthMessage func(cc ClientContext, user string, authErr error) string + type MainDriverExtensionQuitMessage interface + QuitMessage func() string + type MainDriverExtensionTLSVerifier interface + VerifyConnection func(cc ClientContext, user string, tlsConn *tls.Conn) (ClientDriver, error) + type MainDriverExtensionUserVerifier interface + PreAuthUser func(cc ClientContext, user string) error + type NetworkError struct + func (e NetworkError) Error() string + func (e NetworkError) Unwrap() error + type PortRange struct + End int + Start int + type PublicIPResolver func(ClientContext) (string, error) + type Settings struct + ActiveConnectionsCheck DataConnectionRequirement + 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 + PasvConnectionsCheck DataConnectionRequirement + PublicHost string + PublicIPResolver PublicIPResolver + TLSRequired TLSRequirement + type TLSRequirement int8 + const ClearOrEncrypted + const ImplicitEncryption + const MandatoryEncryption + type TransferType int8 + const TransferTypeASCII + const TransferTypeBinary