sftp

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const DriverTypeID = 2

Driver type ID - must match dispatcher registry

Variables

This section is empty.

Functions

This section is empty.

Types

type SFTPDriver

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

SFTPDriver implements the Driver interface for SFTP connections

func (*SFTPDriver) CreateFile

func (d *SFTPDriver) CreateFile(mountID int, path string) (io.WriteCloser, error)

CreateFile returns a writer for file creation

func (*SFTPDriver) ListDir

func (d *SFTPDriver) ListDir(mountID int, path string) ([]api.FileInfo, error)

ListDir returns directory entries

func (*SFTPDriver) Mkdir

func (d *SFTPDriver) Mkdir(mountID int, path string) error

Mkdir creates a directory

func (*SFTPDriver) Mount

func (d *SFTPDriver) Mount(mountID int, config map[string]string) error

Mount establishes SFTP connection Config expects: host, port, user, pass, root, use_ssh_agent

func (*SFTPDriver) Name

func (d *SFTPDriver) Name() string

Name returns the driver identifier

func (*SFTPDriver) OpenFile

func (d *SFTPDriver) OpenFile(mountID int, path string) (io.ReadCloser, error)

OpenFile returns a reader for file contents

func (*SFTPDriver) Remove

func (d *SFTPDriver) Remove(mountID int, path string) error

Remove deletes a file or directory

func (*SFTPDriver) Rename

func (d *SFTPDriver) Rename(mountID int, oldPath, newPath string) error

Rename moves/renames a file

func (*SFTPDriver) Stat

func (d *SFTPDriver) Stat(mountID int, path string) (api.FileInfo, error)

Stat retrieves file/directory info

func (*SFTPDriver) Stats

func (d *SFTPDriver) Stats() *api.MountStats

Stats implements api.StatsProvider so the MountManager can hand our transport counters back through the C ABI.

func (*SFTPDriver) Unmount

func (d *SFTPDriver) Unmount(mountID int) error

Unmount closes SFTP connection

Directories

Path Synopsis
cmd
sftp command

Jump to

Keyboard shortcuts

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