Documentation
¶
Index ¶
- Constants
- type SFTPDriver
- func (d *SFTPDriver) CreateFile(mountID int, path string) (io.WriteCloser, error)
- func (d *SFTPDriver) ListDir(mountID int, path string) ([]api.FileInfo, error)
- func (d *SFTPDriver) Mkdir(mountID int, path string) error
- func (d *SFTPDriver) Mount(mountID int, config map[string]string) error
- func (d *SFTPDriver) Name() string
- func (d *SFTPDriver) OpenFile(mountID int, path string) (io.ReadCloser, error)
- func (d *SFTPDriver) Remove(mountID int, path string) error
- func (d *SFTPDriver) Rename(mountID int, oldPath, newPath string) error
- func (d *SFTPDriver) Stat(mountID int, path string) (api.FileInfo, error)
- func (d *SFTPDriver) Stats() *api.MountStats
- func (d *SFTPDriver) Unmount(mountID int) error
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) 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) 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) 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
Click to show internal directories.
Click to hide internal directories.