Documentation
¶
Index ¶
- type App
- type BookmarksModel
- type BrowserModel
- func (m BrowserModel) ConnInfo() string
- func (m BrowserModel) CurrentPath() string
- func (m BrowserModel) FS() FileSystem
- func (m BrowserModel) Init() tea.Cmd
- func (m BrowserModel) LoadPath(p string) tea.Cmd
- func (m BrowserModel) Refresh() tea.Cmd
- func (m BrowserModel) Side() int
- func (m BrowserModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (m BrowserModel) View() string
- type CachedFS
- func (c *CachedFS) Base(p string) string
- func (c *CachedFS) Chmod(p string, m os.FileMode) error
- func (c *CachedFS) Dir(p string) string
- func (c *CachedFS) Home() string
- func (c *CachedFS) Inner() FileSystem
- func (c *CachedFS) Invalidate(p string)
- func (c *CachedFS) InvalidateAll()
- func (c *CachedFS) Join(parts ...string) string
- func (c *CachedFS) Kind() string
- func (c *CachedFS) Label() string
- func (c *CachedFS) List(p string) ([]sftpclient.FileEntry, error)
- func (c *CachedFS) Mkdir(p string) error
- func (c *CachedFS) ReadFileChunk(p string, n int64) ([]byte, bool, error)
- func (c *CachedFS) ReadFileRange(p string, offset, maxBytes int64) ([]byte, int64, error)
- func (c *CachedFS) Readlink(p string) (string, error)
- func (c *CachedFS) Remove(p string) error
- func (c *CachedFS) RemoveAll(p string) error
- func (c *CachedFS) Rename(o, n string) error
- func (c *CachedFS) Stat(p string) (sftpclient.FileEntry, error)
- type ConnListModel
- type ConnectField
- type ConnectModel
- type ConnectedMsg
- type DownloadModel
- type EditModel
- type ErrLogModel
- type FileSystem
- type HostPromptModel
- type LocalFS
- func (l *LocalFS) Base(p string) string
- func (l *LocalFS) Chmod(p string, m os.FileMode) error
- func (l *LocalFS) Dir(p string) string
- func (l *LocalFS) Home() string
- func (l *LocalFS) Join(parts ...string) string
- func (l *LocalFS) Kind() string
- func (l *LocalFS) Label() string
- func (l *LocalFS) List(p string) ([]sftpclient.FileEntry, error)
- func (l *LocalFS) Mkdir(p string) error
- func (l *LocalFS) ReadFileChunk(p string, maxBytes int64) ([]byte, bool, error)
- func (l *LocalFS) ReadFileRange(p string, offset, maxBytes int64) ([]byte, int64, error)
- func (l *LocalFS) Readlink(p string) (string, error)
- func (l *LocalFS) Remove(p string) error
- func (l *LocalFS) RemoveAll(p string) error
- func (l *LocalFS) Rename(o, n string) error
- func (l *LocalFS) Stat(p string) (sftpclient.FileEntry, error)
- type PassphraseModel
- type PreviewModel
- type RemoteFS
- func (r *RemoteFS) Base(p string) string
- func (r *RemoteFS) Chmod(p string, m os.FileMode) error
- func (r *RemoteFS) Client() *sftpclient.Client
- func (r *RemoteFS) Dir(p string) string
- func (r *RemoteFS) Home() string
- func (r *RemoteFS) Join(parts ...string) string
- func (r *RemoteFS) Kind() string
- func (r *RemoteFS) Label() string
- func (r *RemoteFS) List(p string) ([]sftpclient.FileEntry, error)
- func (r *RemoteFS) Mkdir(p string) error
- func (r *RemoteFS) ReadFileChunk(p string, maxBytes int64) ([]byte, bool, error)
- func (r *RemoteFS) ReadFileRange(p string, offset, maxBytes int64) ([]byte, int64, error)
- func (r *RemoteFS) Readlink(p string) (string, error)
- func (r *RemoteFS) Remove(p string) error
- func (r *RemoteFS) RemoveAll(p string) error
- func (r *RemoteFS) Rename(o, n string) error
- func (r *RemoteFS) Stat(p string) (sftpclient.FileEntry, error)
- type TwoPaneModel
- type UploadModel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BookmarksModel ¶
type BookmarksModel struct {
// contains filtered or unexported fields
}
func NewBookmarksModel ¶
func NewBookmarksModel(host, port, user string) BookmarksModel
func (BookmarksModel) Init ¶
func (m BookmarksModel) Init() tea.Cmd
func (BookmarksModel) View ¶
func (m BookmarksModel) View() string
type BrowserModel ¶
type BrowserModel struct {
// contains filtered or unexported fields
}
func NewBrowserModel ¶
func NewBrowserModel(fs FileSystem) BrowserModel
func NewBrowserModelSide ¶
func NewBrowserModelSide(fs FileSystem, side int) BrowserModel
NewBrowserModelSide constructs a browser tagged with a side identifier so the parent TwoPane can route async messages back to the panel that issued them. Single-pane callers should use NewBrowserModel.
func (BrowserModel) ConnInfo ¶
func (m BrowserModel) ConnInfo() string
func (BrowserModel) CurrentPath ¶
func (m BrowserModel) CurrentPath() string
func (BrowserModel) FS ¶
func (m BrowserModel) FS() FileSystem
func (BrowserModel) Init ¶
func (m BrowserModel) Init() tea.Cmd
func (BrowserModel) LoadPath ¶
func (m BrowserModel) LoadPath(p string) tea.Cmd
LoadPath navigates the browser to p on its next tick. Used by the App when the user picks a bookmark — the BrowserModel itself remembers cursorMem, so backing out to the previous path with `h` still feels natural.
func (BrowserModel) Refresh ¶
func (m BrowserModel) Refresh() tea.Cmd
func (BrowserModel) Side ¶
func (m BrowserModel) Side() int
func (BrowserModel) View ¶
func (m BrowserModel) View() string
type CachedFS ¶
type CachedFS struct {
// contains filtered or unexported fields
}
CachedFS wraps a FileSystem and memoises List(path) results. Cache is invalidated explicitly on Refresh (`R` in the UI) and on any write op that changes a directory's contents (Mkdir/Rename/Remove/Chmod). There's no TTL — stale entries persist until invalidated, which matches the requirement that stale cache reflects user intent ("I haven't pressed R").
func NewCachedFS ¶
func NewCachedFS(inner FileSystem) *CachedFS
func (*CachedFS) Inner ¶
func (c *CachedFS) Inner() FileSystem
Inner returns the underlying FS — used by code that needs a concrete *RemoteFS (e.g. to access *sftp.Client for copy/edit).
func (*CachedFS) Invalidate ¶
func (*CachedFS) InvalidateAll ¶
func (c *CachedFS) InvalidateAll()
func (*CachedFS) ReadFileChunk ¶
func (*CachedFS) ReadFileRange ¶
type ConnListModel ¶
type ConnListModel struct {
// contains filtered or unexported fields
}
func NewConnListModel ¶
func NewConnListModel() ConnListModel
func (ConnListModel) Init ¶
func (m ConnListModel) Init() tea.Cmd
func (ConnListModel) View ¶
func (m ConnListModel) View() string
type ConnectField ¶
type ConnectField int
type ConnectModel ¶
type ConnectModel struct {
// contains filtered or unexported fields
}
func NewConnectModel ¶
func NewConnectModel() ConnectModel
func (ConnectModel) Init ¶
func (m ConnectModel) Init() tea.Cmd
func (*ConnectModel) Prefill ¶
func (m *ConnectModel) Prefill(c ConnectedMsg)
Prefill loads connection details into the form. Used when the user selects a saved/ssh-config entry from the connections list. KeyPath is included; password and passphrase are left blank deliberately — saved-connection records do not store secrets.
func (ConnectModel) View ¶
func (m ConnectModel) View() string
type ConnectedMsg ¶
type DownloadModel ¶
type DownloadModel struct {
// contains filtered or unexported fields
}
func NewDownloadModel ¶
func NewDownloadModel(client *sftpclient.Client, entries []sftpclient.FileEntry, localDir string) DownloadModel
func (DownloadModel) Init ¶
func (m DownloadModel) Init() tea.Cmd
func (DownloadModel) View ¶
func (m DownloadModel) View() string
type EditModel ¶
type EditModel struct {
// contains filtered or unexported fields
}
func NewEditModel ¶
func NewEditModel(fs FileSystem, entry sftpclient.FileEntry) EditModel
type ErrLogModel ¶
type ErrLogModel struct {
// contains filtered or unexported fields
}
func NewErrLogModel ¶
func NewErrLogModel(entries []errLogEntry) ErrLogModel
func (ErrLogModel) Init ¶
func (m ErrLogModel) Init() tea.Cmd
func (ErrLogModel) View ¶
func (m ErrLogModel) View() string
type FileSystem ¶
type FileSystem interface {
List(path string) ([]sftpclient.FileEntry, error)
Stat(path string) (sftpclient.FileEntry, error)
Remove(path string) error
RemoveAll(path string) error
Rename(oldPath, newPath string) error
Mkdir(path string) error
Chmod(path string, mode os.FileMode) error
ReadFileChunk(path string, maxBytes int64) (data []byte, truncated bool, err error)
ReadFileRange(path string, offset, maxBytes int64) (data []byte, total int64, err error)
Readlink(path string) (string, error)
Home() string
Join(parts ...string) string
Dir(p string) string
Base(p string) string
// Kind returns "local" or "remote" — used by TwoPane to decide transfer
// direction.
Kind() string
// Label is shown in the panel header (e.g. "local" or "user@host:port").
Label() string
}
FileSystem is the minimal set of operations both panels need. The remote adapter wraps *sftpclient.Client; the local adapter calls into os/filepath. All methods take absolute paths in the filesystem's native format.
Path manipulation is delegated to the FS because the local side may use platform-specific separators (Windows in the future); both adapters here normalize to forward slashes on Linux/Mac.
type HostPromptModel ¶
type HostPromptModel struct {
// contains filtered or unexported fields
}
func NewHostPromptModel ¶
func NewHostPromptModel(challenge *sftpclient.UnknownHostKeyError) HostPromptModel
func (HostPromptModel) Init ¶
func (m HostPromptModel) Init() tea.Cmd
func (HostPromptModel) View ¶
func (m HostPromptModel) View() string
type LocalFS ¶
type LocalFS struct{}
func NewLocalFS ¶
func NewLocalFS() *LocalFS
func (*LocalFS) ReadFileChunk ¶
func (*LocalFS) ReadFileRange ¶
type PassphraseModel ¶
type PassphraseModel struct {
// contains filtered or unexported fields
}
func NewPassphraseModel ¶
func NewPassphraseModel(keyPath string, bad bool) PassphraseModel
func (PassphraseModel) Init ¶
func (m PassphraseModel) Init() tea.Cmd
func (PassphraseModel) View ¶
func (m PassphraseModel) View() string
type PreviewModel ¶
type PreviewModel struct {
// contains filtered or unexported fields
}
func NewPreviewModel ¶
func NewPreviewModel(fs FileSystem, entry sftpclient.FileEntry) PreviewModel
func (PreviewModel) Init ¶
func (m PreviewModel) Init() tea.Cmd
func (PreviewModel) View ¶
func (m PreviewModel) View() string
type RemoteFS ¶
type RemoteFS struct {
// contains filtered or unexported fields
}
func NewRemoteFS ¶
func NewRemoteFS(client *sftpclient.Client, label string) *RemoteFS
func (*RemoteFS) Client ¶
func (r *RemoteFS) Client() *sftpclient.Client
func (*RemoteFS) ReadFileChunk ¶
func (*RemoteFS) ReadFileRange ¶
type TwoPaneModel ¶
type TwoPaneModel struct {
// contains filtered or unexported fields
}
func NewTwoPaneModel ¶
func NewTwoPaneModel(client *sftpclient.Client, leftFS, rightFS FileSystem) TwoPaneModel
func (TwoPaneModel) Init ¶
func (m TwoPaneModel) Init() tea.Cmd
func (TwoPaneModel) View ¶
func (m TwoPaneModel) View() string
type UploadModel ¶
type UploadModel struct {
// contains filtered or unexported fields
}
func NewUploadModel ¶
func NewUploadModel(client *sftpclient.Client, remoteDir string) UploadModel
func NewUploadModelMulti ¶
func NewUploadModelMulti(client *sftpclient.Client, remoteDir string, sources []string) UploadModel
NewUploadModelMulti starts an upload of pre-known source paths without prompting the user. Used for the two-pane F5 copy where the source list is the active panel's selection — the view opens straight into progress.
func (UploadModel) Init ¶
func (m UploadModel) Init() tea.Cmd
func (UploadModel) View ¶
func (m UploadModel) View() string