server

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2023 License: MIT Imports: 13 Imported by: 21

Documentation

Overview

Package server contains the core FTP server code

Index

Constants

This section is empty.

Variables

View Source
var ErrNotEnabled = errors.New("not enabled")

ErrNotEnabled is returned when a feature hasn't been enabled

View Source
var ErrTimeout = errors.New("timeout")

ErrTimeout is returned when an operation timeouts

Functions

This section is empty.

Types

type ClientDriver added in v0.7.0

type ClientDriver struct {
	afero.Fs
}

The ClientDriver is the internal structure used for handling the client. At this stage it's limited to the afero.Fs

type Server added in v0.7.0

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

Server structure

func NewServer added in v0.7.0

func NewServer(config *config.Config, logger log.Logger) (*Server, error)

NewServer creates a server instance

func (*Server) AuthUser added in v0.7.0

func (s *Server) AuthUser(cc serverlib.ClientContext, user, pass string) (serverlib.ClientDriver, error)

AuthUser authenticates the user and selects an handling driver

func (*Server) ClientConnected added in v0.7.0

func (s *Server) ClientConnected(cc serverlib.ClientContext) (string, error)

ClientConnected is called to send the very first welcome message

func (*Server) ClientDisconnected added in v0.7.0

func (s *Server) ClientDisconnected(cc serverlib.ClientContext)

ClientDisconnected is called when the user disconnects, even if he never authenticated

func (*Server) GetSettings added in v0.7.0

func (s *Server) GetSettings() (*serverlib.Settings, error)

GetSettings returns some general settings around the server setup

func (*Server) GetTLSConfig added in v0.7.0

func (s *Server) GetTLSConfig() (*tls.Config, error)

GetTLSConfig returns a TLS Certificate to use The certificate could frequently change if we use something like "let's encrypt"

func (*Server) Stop added in v0.7.0

func (s *Server) Stop()

Stop will trigger a graceful stop of the server. All currently connected clients won't be disconnected instantly.

func (*Server) WaitGracefully added in v0.7.0

func (s *Server) WaitGracefully(timeout time.Duration) error

WaitGracefully allows to gracefully wait for all currently connected clients before disconnecting

Jump to

Keyboard shortcuts

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