session

package
v0.0.0-...-1310e1d Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2018 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package session handles the FTP session state

Index

Constants

View Source
const (
	USER = 0 + iota
	PASS
	PWD
	TYPE
	PASV
	EPSV
	LIST
	SYST
	CWD
	CDUP
	SIZE
	RETR
	STOR
	DELE
	FEAT
	QUIT
	NOOP
	MKD
	RMD
	REST
	NLST
)

FTP Command constants

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthenticatorFunc

type AuthenticatorFunc func(name, password string) bool

AuthenticatorFunc is the function that will be called by the FTP Server as soon as the authentcation process completes (ie USER+PASS). If you return true the user is considered authenticated from there on

type Session

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

Session is the connected FTP session

func New

func New(conn securableConn.Conn, cert *tls.Certificate, connectionTimeout time.Duration, portassigner portassigner.PortAssigner, authFunc AuthenticatorFunc, fp fs.FileProvider) *Session

New creates a new FTP session

func (*Session) Close

func (ses *Session) Close()

Close closes the connection

func (*Session) Handle

func (ses *Session) Handle() error

Handle processed the command loop and dispatches the commands to relative handlers

func (*Session) String

func (ses *Session) String() string

Directories

Path Synopsis
Package securableConn hides the difference between a plain text connection and an encrypted one so there is no need to track the difference from outside.
Package securableConn hides the difference between a plain text connection and an encrypted one so there is no need to track the difference from outside.

Jump to

Keyboard shortcuts

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