Documentation
¶
Index ¶
- func New(cfg *config.Config, st *state.DB) tea.Model
- type TUIController
- type TUIModel
- func (m *TUIModel) AddEphemeral(url, dest string, headers map[string]string, sha string)
- func (m *TUIModel) DestGuess(url string) string
- func (m *TUIModel) FilteredRows(statuses []string) []state.DownloadRow
- func (m *TUIModel) GetEphems() map[string]ephemeral
- func (m *TUIModel) GetPrev() map[string]obs
- func (m *TUIModel) GetRows() []state.DownloadRow
- func (m *TUIModel) GetRunning() map[string]context.CancelFunc
- func (m *TUIModel) LoadRows() error
- func (m *TUIModel) PreflightForDownload(url, dest string) error
- func (m *TUIModel) ProgressFor(url, dest string) (int64, int64, string)
- func (m *TUIModel) StartDownload(ctx context.Context, urlStr, dest, sha string, headers map[string]string) error
- type TUIView
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type TUIController ¶
type TUIController struct {
// contains filtered or unexported fields
}
TUIController manages user interaction state and event handling for the TUI.
func NewTUIController ¶
func NewTUIController(model *TUIModel, view *TUIView) *TUIController
NewTUIController creates a new TUIController instance with the given model and view.
func (*TUIController) Init ¶
func (c *TUIController) Init() tea.Cmd
Init initializes the controller by loading download rows and starting the tick command.
func (*TUIController) SetModel ¶
func (c *TUIController) SetModel(m tea.Model)
SetModel sets the reference to the main tea.Model instance for proper orchestration.
type TUIModel ¶
type TUIModel struct {
// contains filtered or unexported fields
}
TUIModel manages core data and business logic for the TUI application.
func NewTUIModel ¶
NewTUIModel creates a new TUIModel instance with the given configuration and state database.
func (*TUIModel) AddEphemeral ¶
AddEphemeral adds an ephemeral download state for the given URL and destination.
func (*TUIModel) FilteredRows ¶
func (m *TUIModel) FilteredRows(statuses []string) []state.DownloadRow
FilteredRows returns download rows filtered by the given status list.
func (*TUIModel) GetRows ¶
func (m *TUIModel) GetRows() []state.DownloadRow
GetRows returns the current download rows.
func (*TUIModel) GetRunning ¶
func (m *TUIModel) GetRunning() map[string]context.CancelFunc
GetRunning returns a snapshot of currently running downloads with their cancel functions.
func (*TUIModel) PreflightForDownload ¶
PreflightForDownload performs preflight checks before starting a download.
func (*TUIModel) ProgressFor ¶
ProgressFor returns the progress information for a specific download.
type TUIView ¶
type TUIView struct {
// contains filtered or unexported fields
}
TUIView handles all rendering logic and UI presentation for the TUI.
func NewTUIView ¶
func NewTUIView() *TUIView
NewTUIView creates a new TUIView instance with default styling and progress bar.