ftpserver

package
v1.0.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 21, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ListenAddr    string // Address to listen on
	Port          int    // Port to listen on
	RootDir       string // Root directory that FTP users will be restricted to
	HomePattern   string // Pattern for user home directories (e.g., "/home/%s")
	TLSCertFile   string // Path to TLS certificate file
	TLSKeyFile    string // Path to TLS private key file
	PasvPortRange [2]int // Range of ports for passive mode transfers
	PasvAddress   string // Public IP for passive mode connections
	PasvIPVerify  bool   // Whether to verify data connection IPs
}

Config holds the server configuration

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server wraps the FTP server with our custom auth

func New

func New(config *Config, authorizer *authorization.Authorizer, authenticator *authentication.Authenticator, version string) (*Server, error)

New creates a new FTP server

func (*Server) GetActiveConnections added in v1.0.11

func (s *Server) GetActiveConnections() int32

GetActiveConnections returns the current number of active connections

func (*Server) GetStartTime added in v1.0.11

func (s *Server) GetStartTime() time.Time

GetStartTime returns the server start time

func (*Server) GetTotalConnections added in v1.0.12

func (s *Server) GetTotalConnections() int64

GetTotalConnections returns the total number of connections since server start

func (*Server) ListenAndServe

func (s *Server) ListenAndServe() error

ListenAndServe starts the server

func (*Server) Stop

func (s *Server) Stop() error

Stop stops the server

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL