Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrMissingConnectionHandlerFunction ... ErrMissingConnectionHandlerFunction = errors.New("new connection handler is not defined") // ErrMissingSSHConfig ... ErrMissingSSHConfig = errors.New("ssh Config is not defined") // ErrMissingLoggerInterface ... ErrMissingLoggerInterface = errors.New("logger interface is not defined") // ErrInvalidPort ... ErrInvalidPort = errors.New("port must not be 0 or bigger then 65535") )
Functions ¶
This section is empty.
Types ¶
type LogType ¶
type LogType string
LogType defined various types of logs and errors that can happen within the SFTP implementation
const ( // ServerStarted is logged when the SFTP server is first launched. ServerStarted LogType = "server-started" // ChannelNotSession is logged when the SFTP receives a request for a new channel which is NOT of type 'session'. ChannelNotSession LogType = "channel-not-session" // AcceptNetworkError is logged when there is an error accepting network connections within the listener. AcceptNetworkError LogType = "accept-network-error" // SSHKeyExchangeError is logged when there is an error performing a key exchange between the SFTP client and server. SSHKeyExchangeError LogType = "ssh-key-exchange-error" // AcceptChannelError is logged when there is an error while trying to accept the new request channel. AcceptChannelError LogType = "accept-channel-error" )
type Options ¶
type Options struct { Port int PublicIP string Logger Logger SSHConfig *ssh.ServerConfig // ConnectionKeepAlive controls how long the connection keep-alive duration is set to. ConnectionKeepAlive time.Duration // SSHHandshakeDeadline controls the time.Duration which ssh session // have to complete their handshake. This option is not a part of the // ssh.ServerConfig so we had to implement it separately. SSHHandshakeDeadline time.Duration // BeforeHandle will be executed before `HandleSFTPSession` and before // error checking happens during the socket listener.Accept(). // // if acceptConn is true the connection will be accepted, if not // the .Close() method is called and the connection dropped. BeforeHandle func(conn net.Conn, err error) (acceptConn bool) // HandleSFTPSession is executed when a new SFTP session is requested. HandleSFTPSession func(channel ssh.Channel, sconn *ssh.ServerConn) }
Options defines required configurations used when calling NewServer().
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server implements a composable SFTP Server.
Click to show internal directories.
Click to hide internal directories.