Documentation
¶
Overview ¶
Package remote provides SSH/SFTP remote file access for fur. It implements a sync/cache model: files are downloaded from the remote host to a local cache directory, and a background goroutine polls for changes periodically.
Index ¶
- func IsRemotePath(s string) bool
- func NewSFTPFs(client *sftp.Client) afero.Fs
- type Conn
- type ConnState
- type SFTPFs
- func (s *SFTPFs) Chmod(name string, mode os.FileMode) error
- func (s *SFTPFs) Chown(name string, uid, gid int) error
- func (s *SFTPFs) Chtimes(name string, atime, mtime time.Time) error
- func (s *SFTPFs) Create(name string) (afero.File, error)
- func (s *SFTPFs) Mkdir(name string, perm os.FileMode) error
- func (s *SFTPFs) MkdirAll(path string, perm os.FileMode) error
- func (s *SFTPFs) Name() string
- func (s *SFTPFs) Open(name string) (afero.File, error)
- func (s *SFTPFs) OpenFile(name string, flag int, perm os.FileMode) (afero.File, error)
- func (s *SFTPFs) Remove(name string) error
- func (s *SFTPFs) RemoveAll(path string) error
- func (s *SFTPFs) Rename(oldname, newname string) error
- func (s *SFTPFs) Stat(name string) (os.FileInfo, error)
- func (s *SFTPFs) Walk(root string, fn WalkFunc) error
- type Target
- type WalkFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsRemotePath ¶
IsRemotePath returns true if the string looks like a remote path spec.
Types ¶
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
Conn manages an SSH connection and SFTP client to a remote host.
func (*Conn) Reconnect ¶
Reconnect attempts to re-establish the connection with exponential backoff.
type SFTPFs ¶
type SFTPFs struct {
// contains filtered or unexported fields
}
SFTPFs implements afero.Fs backed by an SFTP client. Only read operations are supported; write operations return errReadOnly.
type Target ¶
type Target struct {
User string // SSH username (empty = use ~/.ssh/config or current user)
Host string // hostname or SSH config alias
Port int // SSH port (0 = use default 22 or ~/.ssh/config)
Path string // remote directory path
}
Target represents a parsed remote path specification.
func ParseTarget ¶
ParseTarget parses an SCP-style remote path specification. Supported formats:
- host:/path
- user@host:/path
- user@host:port:/path
Returns nil if the input is not a remote path (no ':' separator or looks like a Windows drive letter).