sftpserver

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2025 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultHandler

type DefaultHandler struct {
	Root       string
	ClientIP   string
	SFTPServer *SFTPServer
}

DefaultHandler is an SFTP handler that allows all operations

func (*DefaultHandler) Filecmd

func (h *DefaultHandler) Filecmd(r *sftp.Request) error

func (*DefaultHandler) Filelist

func (h *DefaultHandler) Filelist(r *sftp.Request) (sftp.ListerAt, error)

func (*DefaultHandler) Fileread

func (h *DefaultHandler) Fileread(r *sftp.Request) (io.ReaderAt, error)

func (*DefaultHandler) Filewrite

func (h *DefaultHandler) Filewrite(r *sftp.Request) (io.WriterAt, error)

func (*DefaultHandler) GetHandler

func (h *DefaultHandler) GetHandler() sftp.Handlers

type ReadOnlyHandler

type ReadOnlyHandler struct {
	Root       string
	ClientIP   string
	SFTPServer *SFTPServer
}

ReadOnlyHandler is an SFTP handler that only allows read operations

func (*ReadOnlyHandler) Filecmd

func (h *ReadOnlyHandler) Filecmd(r *sftp.Request) error

func (*ReadOnlyHandler) Filelist

func (h *ReadOnlyHandler) Filelist(r *sftp.Request) (sftp.ListerAt, error)

func (*ReadOnlyHandler) Fileread

func (h *ReadOnlyHandler) Fileread(r *sftp.Request) (io.ReaderAt, error)

func (*ReadOnlyHandler) Filewrite

func (h *ReadOnlyHandler) Filewrite(r *sftp.Request) (io.WriterAt, error)

func (*ReadOnlyHandler) GetHandler

func (h *ReadOnlyHandler) GetHandler() sftp.Handlers

type SFTPServer

type SFTPServer struct {
	IP          string
	Port        int
	KeyFile     string
	Username    string
	Password    string
	Root        string
	ReadOnly    bool
	UploadOnly  bool
	HostKeyFile string
	Webhook     webhook.Webhook
	Whitelist   *httpserver.Whitelist
}

SFTPServer represents an SFTP server configuration

func (*SFTPServer) HandleWebhookSend added in v1.0.8

func (s *SFTPServer) HandleWebhookSend(event string, r *sftp.Request, ip string, blocked bool)

func (*SFTPServer) Start

func (s *SFTPServer) Start() error

Start initializes and starts the SFTP server

type UploadOnlyHandler

type UploadOnlyHandler struct {
	Root       string
	ClientIP   string
	SFTPServer *SFTPServer
}

UploadOnlyHandler is an SFTP handler that only allows upload operations

func (*UploadOnlyHandler) Filecmd

func (h *UploadOnlyHandler) Filecmd(r *sftp.Request) error

func (*UploadOnlyHandler) Filelist

func (h *UploadOnlyHandler) Filelist(r *sftp.Request) (sftp.ListerAt, error)

func (*UploadOnlyHandler) Fileread

func (h *UploadOnlyHandler) Fileread(r *sftp.Request) (io.ReaderAt, error)

func (*UploadOnlyHandler) Filewrite

func (h *UploadOnlyHandler) Filewrite(r *sftp.Request) (io.WriterAt, error)

func (*UploadOnlyHandler) GetHandler

func (h *UploadOnlyHandler) GetHandler() sftp.Handlers

Jump to

Keyboard shortcuts

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