sftp

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: MIT Imports: 27 Imported by: 0

Documentation

Rendered for windows/amd64

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSftpHandler

func NewSftpHandler(ctx context.Context, driveLetter string, snapshot *snapshots.WinVSSSnapshot) (*sftp.Handlers, error)

func Serve

func Serve(ctx context.Context, errChan chan string, sftpConfig *SFTPConfig, address, port string, driveLetter string)

Types

type CustomFileInfo added in v0.3.0

type CustomFileInfo struct {
	os.FileInfo
	// contains filtered or unexported fields
}

func (*CustomFileInfo) Size added in v0.3.0

func (f *CustomFileInfo) Size() int64

type FileLister

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

func (*FileLister) ListAt

func (fl *FileLister) ListAt(fileList []os.FileInfo, offset int64) (int, error)

type NewAgentResp

type NewAgentResp struct {
	PublicKey string `json:"public_key"`
}

type SFTPConfig

type SFTPConfig struct {
	ServerConfig *ssh.ServerConfig
	PrivateKey   []byte `json:"private_key"`
	PublicKey    []byte `json:"public_key"`
	ServerKey    []byte `json:"server_key"`
	Server       string `json:"server"`
	BasePath     string `json:"base_path"`
}

func InitializeSFTPConfig

func InitializeSFTPConfig(svc service.Service, driveLetter string) (*SFTPConfig, error)

func (*SFTPConfig) GetRegistryKey

func (s *SFTPConfig) GetRegistryKey() string

func (*SFTPConfig) PopulateKeys

func (config *SFTPConfig) PopulateKeys() error

type SftpHandler

type SftpHandler struct {
	DriveLetter string
	Snapshot    *snapshots.WinVSSSnapshot
	// contains filtered or unexported fields
}

func (*SftpHandler) FileLister

func (h *SftpHandler) FileLister(dirPath string) (*FileLister, error)

func (*SftpHandler) FileStat

func (h *SftpHandler) FileStat(filename string) (*FileLister, error)

func (*SftpHandler) Filecmd

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

func (*SftpHandler) Filelist

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

func (*SftpHandler) Fileread

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

func (*SftpHandler) Filewrite

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

Jump to

Keyboard shortcuts

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