Documentation ¶
Index ¶
- func NewFileSys(Sessions *Sessions) sftp.Handlers
- type ListerAt
- type Server
- func (s *Server) AuthHandler(conn net.Conn) func(conn ssh.ConnMetadata, password []byte) (*ssh.Permissions, error)
- func (s *Server) Close()
- func (s *Server) GetPrivateKeys() map[string][]byte
- func (s *Server) ListenAndServe() error
- func (s *Server) Logger() *slog.Logger
- func (s *Server) SetLogger(l *slog.Logger)
- func (s *Server) SetPrivateKey(name string, pk []byte)
- func (s *Server) SetPrivateKeyFile(pk string) error
- func (s *Server) TryListenAndServe(d time.Duration) (err error)
- type Sessions
- func (s *Sessions) Filecmd(request *sftp.Request) error
- func (s *Sessions) Filelist(request *sftp.Request) (sftp.ListerAt, error)
- func (s *Sessions) Fileread(request *sftp.Request) (io.ReaderAt, error)
- func (s *Sessions) Filewrite(request *sftp.Request) (io.WriterAt, error)
- func (s *Sessions) PosixRename(request *sftp.Request) error
- func (s *Sessions) StatVFS(request *sftp.Request) (*sftp.StatVFS, error)
- type Users
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewFileSys ¶
Types ¶
type Server ¶
type Server struct { Addr string // contains filtered or unexported fields }
func NewSFTPServer ¶
func NewSFTPServer(addr string, fs filesystem.FSWithReadWriteAt, users Users) *Server
func (*Server) AuthHandler ¶
func (s *Server) AuthHandler(conn net.Conn) func(conn ssh.ConnMetadata, password []byte) (*ssh.Permissions, error)
AuthHandler is called by the SSH server when a client attempts to authenticate.
func (*Server) GetPrivateKeys ¶ added in v0.1.20
GetPrivateKeys returns the private key for the server.
func (*Server) ListenAndServe ¶
func (*Server) SetPrivateKey ¶
SetPrivateKey sets the private key for the server. if not called the server will generate a new key
func (*Server) SetPrivateKeyFile ¶
type Sessions ¶ added in v0.1.18
type Sessions struct { UserInfo ssh.ConnMetadata // contains filtered or unexported fields }
func (*Sessions) PosixRename ¶ added in v0.1.18
Click to show internal directories.
Click to hide internal directories.