Documentation
¶
Overview ¶
Package sftpfs adapts an SFTP client to the vfs interfaces.
Paths here are interpreted by the server, not by the machine mdc runs on, so this package must not use path/filepath.
Index ¶
- type FS
- func (f *FS) Chmod(name string, mode fs.FileMode) error
- func (f *FS) Client() *sftp.Client
- func (f *FS) Create(name string) (vfs.WriteFile, error)
- func (f *FS) Home() string
- func (f *FS) Label() string
- func (f *FS) Lstat(name string) (fs.FileInfo, error)
- func (f *FS) Mkdir(name string, perm fs.FileMode) error
- func (f *FS) MkdirAll(name string, perm fs.FileMode) error
- func (f *FS) Open(name string) (fs.File, error)
- func (f *FS) ReadDir(name string) ([]fs.DirEntry, error)
- func (f *FS) ReadLink(name string) (string, error)
- func (f *FS) Remove(name string) error
- func (f *FS) RemoveAll(name string) error
- func (f *FS) Rename(oldname, newname string) error
- func (f *FS) Stat(name string) (fs.FileInfo, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FS ¶
type FS struct {
// contains filtered or unexported fields
}
FS is a vfs.WritableFS over an SFTP session.
func New ¶
New wraps an established client. label is the panel header, by convention "ssh://user@host".
func (*FS) Mkdir ¶
Mkdir creates a directory. SFTP's mkdir carries no mode, so the permission is a separate best-effort step.
func (*FS) RemoveAll ¶
RemoveAll removes name and everything beneath it. The client's own RemoveAll decides what to recurse into with a symlink-following stat, so deleting a link to a directory would take the target's contents with it. os.RemoveAll does not behave that way, and the two backends have to agree.