Versions in this module Expand all Collapse all v0 v0.0.1 Apr 10, 2020 Changes in this version + const ATTR_MODE — linux/amd64, windows/amd64 + const ATTR_SIZE — linux/amd64, windows/amd64 + const ATTR_TIME — linux/amd64, windows/amd64 + const ATTR_UIDGID — linux/amd64, windows/amd64 + const MODE_DIR — linux/amd64, windows/amd64 + const MODE_REGULAR — linux/amd64, windows/amd64 + const SSH_FILEXFER_ATTR_ACMODTIME + const SSH_FILEXFER_ATTR_EXTENDED + const SSH_FILEXFER_ATTR_PERMISSIONS + const SSH_FILEXFER_ATTR_SIZE + const SSH_FILEXFER_ATTR_UIDGID + const SSH_FXF_APPEND + const SSH_FXF_CREAT + const SSH_FXF_EXCL + const SSH_FXF_READ + const SSH_FXF_TRUNC + const SSH_FXF_WRITE + const SSH_FXP_ATTRS + const SSH_FXP_CLOSE + const SSH_FXP_DATA + const SSH_FXP_EXTENDED + const SSH_FXP_EXTENDED_REPLY + const SSH_FXP_FSETSTAT + const SSH_FXP_FSTAT + const SSH_FXP_HANDLE + const SSH_FXP_INIT + const SSH_FXP_LSTAT + const SSH_FXP_MKDIR + const SSH_FXP_NAME + const SSH_FXP_OPEN + const SSH_FXP_OPENDIR + const SSH_FXP_READ + const SSH_FXP_READDIR + const SSH_FXP_READLINK + const SSH_FXP_REALPATH + const SSH_FXP_REMOVE + const SSH_FXP_RENAME + const SSH_FXP_RMDIR + const SSH_FXP_SETSTAT + const SSH_FXP_STAT + const SSH_FXP_STATUS + const SSH_FXP_SYMLINK + const SSH_FXP_VERSION + const SSH_FXP_WRITE + const SSH_FX_BAD_MESSAGE + const SSH_FX_CONNECTION_LOST + const SSH_FX_EOF + const SSH_FX_FAILURE + const SSH_FX_NO_CONNECTION + const SSH_FX_NO_SUCH_FILE + const SSH_FX_OK + const SSH_FX_OP_UNSUPPORTED + const SSH_FX_PERMISSION_DENIED + const S_IFMT + var Failure = errors.New("Failure") + var SSH_FXP_MAP = map[SSH_FXP]string + var SSH_FX_MAP = map[SSH_FX]string + func IsSftpRequest(req *ssh.Request) bool + func NewSftpFs(client *sftp.Client) *sftpFs + func NewSshClientConfig(sshUser, sshPassword, sshType, sshKey, sshKeyPassword string, ...) (config *ssh.ClientConfig, err error) + func NewSshUpstream(host, username, password string, timeout time.Duration) (*ssh.Client, *ssh.Session, error) + func ServeChannel(c ssh.Channel, fs FileSystem, sysType int) error + type Attr struct — linux/amd64, windows/amd64 + ATime time.Time + Extended []string + Flags uint32 + Gid uint32 + Group string + MTime time.Time + Mode os.FileMode + ModeString string + Size uint64 + Uid uint32 + User string + func (a *Attr) FillFrom(fi os.FileInfo, sysType int) + type Config struct + FileSystem FileSystem + HostPort string + LogFunc func(v ...interface{}) + func (c *Config) BlockTillReady() error + func (c *Config) Close() error + func (c *Config) Init() + func (c *Config) RunServer() error + type Dir interface — linux/amd64, windows/amd64 + Readdir func(count int, handles Handles) ([]NamedAttr, error) + type EmptyDir struct + func (EmptyDir) Close() error + func (EmptyDir) Readdir(count int, handles Handles) ([]NamedAttr, error) + type EmptyFS struct + func (EmptyFS) CreateLink(p string, t string, f uint32) error + func (EmptyFS) Mkdir(string, *Attr) error + func (EmptyFS) OpenDir(string) (Dir, error) + func (EmptyFS) OpenFile(string, uint32, *Attr) (File, error) + func (EmptyFS) ReadLink(p string) (string, error) + func (EmptyFS) RealPath(p string) (string, error) + func (EmptyFS) Remove(string) error + func (EmptyFS) Rename(string, string, uint32) error + func (EmptyFS) Rmdir(string) error + func (EmptyFS) SetStat(string, *Attr) error + func (EmptyFS) Stat(string, bool) (*Attr, error) + type EmptyFile struct + func (EmptyFile) Close() error + func (EmptyFile) FSetStat(*Attr) error + func (EmptyFile) FStat() (*Attr, error) + func (EmptyFile) ReadAt([]byte, int64) (int, error) + func (EmptyFile) WriteAt([]byte, int64) (int, error) + type File interface — linux/amd64, windows/amd64 + FSetStat func(*Attr) error + FStat func() (*Attr, error) + type FileSystem interface — linux/amd64, windows/amd64 + CreateLink func(path string, target string, flags uint32) error + Mkdir func(name string, attr *Attr) error + OpenDir func(name string) (Dir, error) + OpenFile func(name string, flags uint32, attr *Attr) (File, error) + ReadLink func(path string) (string, error) + RealPath func(path string) (string, error) + Remove func(name string) error + Rename func(old string, new string, flags uint32) error + Rmdir func(name string) error + SetStat func(name string, attr *Attr) error + Stat func(name string, islstat bool) (*Attr, error) + type Handles struct + func (h *Handles) CloseAll() + func (h *Handles) CloseHandle(k string) + func (h *Handles) GetDir(n string) Dir + func (h *Handles) GetFile(n string) File + func (h *Handles) Init() + func (h *Handles) Ndir() int + func (h *Handles) NewDir(f Dir) string + func (h *Handles) NewFile(f File) string + func (h *Handles) Nfiles() int + type LocalDir struct + func NewLocalDir(dir *os.File) *LocalDir + func (d *LocalDir) Close() error + func (d *LocalDir) Readdir(count int, handles Handles) ([]NamedAttr, error) + type LocalFile struct + func NewLocalFile(file *os.File) *LocalFile + func (rf *LocalFile) Close() error + func (rf *LocalFile) FSetStat(a *Attr) error + func (rf *LocalFile) FStat() (*Attr, error) + func (rf *LocalFile) ReadAt(bs []byte, pos int64) (int, error) + func (rf *LocalFile) WriteAt(bs []byte, pos int64) (int, error) + type LocalFs struct + func NewLocalFs(root string) *LocalFs + func (fs *LocalFs) CreateLink(path string, target string, flags uint32) error + func (fs *LocalFs) Mkdir(path string, attr *Attr) error + func (fs *LocalFs) OpenDir(path string) (Dir, error) + func (fs *LocalFs) OpenFile(path string, mode uint32, a *Attr) (File, error) + func (fs *LocalFs) ReadLink(path string) (string, error) + func (fs *LocalFs) RealPath(pathX string) (string, error) + func (fs *LocalFs) Remove(path string) error + func (fs *LocalFs) Rename(oldName, newName string, flag uint32) error + func (fs *LocalFs) Rmdir(path string) error + func (fs *LocalFs) SetStat(path string, attr *Attr) error + func (fs *LocalFs) Stat(path string, isLstat bool) (*Attr, error) + type NamedAttr struct — linux/amd64, windows/amd64 + Name string + type SSH_FX byte + func (b SSH_FX) String() string + type SSH_FXP byte + func (b SSH_FXP) String() string + type SftpDir struct + func NewSftpDir(client *sftp.Client, path string) *SftpDir + func (sd *SftpDir) Close() error + func (sd *SftpDir) Readdir(count int, handles Handles) ([]NamedAttr, error) + type SftpFile struct + func NewSftpFile(file *sftp.File) *SftpFile + func (sf *SftpFile) Close() error + func (sf *SftpFile) FSetStat(a *Attr) error + func (sf *SftpFile) FStat() (*Attr, error) + func (sf *SftpFile) ReadAt(bs []byte, pos int64) (int, error) + func (sf *SftpFile) WriteAt(bs []byte, pos int64) (int, error)