Documentation
¶
Overview ¶
Package fs defines the shared FileEntry type used for both local and remote files.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FileEntry ¶
type FileEntry struct {
Name string
Path string // absolute path (local or remote)
Kind EntryKind
Size int64
ModTime time.Time
Mode fs.FileMode
// Tree metadata (used by the browser TUI)
Depth int
Expanded bool // directories only
Children []*FileEntry
Parent *FileEntry
}
FileEntry represents a single file or directory, local or remote.
type SelectionState ¶
type SelectionState struct {
Marked map[string]struct{} // keyed by FileEntry.Path
}
SelectionState tracks which entries are marked by the user.
func NewSelectionState ¶
func NewSelectionState() *SelectionState
NewSelectionState returns an empty SelectionState.
func (*SelectionState) Count ¶
func (s *SelectionState) Count() int
Count returns the number of marked entries.
func (*SelectionState) IsMarked ¶
func (s *SelectionState) IsMarked(path string) bool
IsMarked returns true if the path is currently marked.
func (*SelectionState) Toggle ¶
func (s *SelectionState) Toggle(path string)
Toggle marks an entry if unmarked, or unmarks it if already marked.
Click to show internal directories.
Click to hide internal directories.