Documentation
¶
Index ¶
- func ProgressDots(current, total int) string
- type App
- type AppOpts
- type DownloadProgressMsg
- type DownloadRecord
- type SearchDoneMsg
- type SearchModel
- type SearchResult
- type StartDownloadMsg
- type SummaryModel
- type SwipeDoneMsg
- type SwipeModel
- func (m SwipeModel) Current() source.WallpaperResult
- func (m SwipeModel) Init() tea.Cmd
- func (m SwipeModel) Records() []DownloadRecord
- func (m SwipeModel) Remaining() []source.WallpaperResult
- func (m SwipeModel) Total() int
- func (m SwipeModel) Update(msg tea.Msg) (SwipeModel, tea.Cmd)
- func (m SwipeModel) View() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ProgressDots ¶
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
App is the root bubbletea model.
type AppOpts ¶
type AppOpts struct {
NeedWizard bool
Config config.Config
Sources map[string]source.Source
Query string
Source string
Count int
Downloader *download.Downloader
}
AppOpts holds startup configuration.
type DownloadProgressMsg ¶
DownloadProgressMsg is sent as each item finishes.
type DownloadRecord ¶
type DownloadRecord struct {
Result source.WallpaperResult
Downloaded bool
Skipped bool
Error string
Path string
}
DownloadRecord tracks the outcome of a single wallpaper.
type SearchDoneMsg ¶
type SearchDoneMsg struct {
Result SearchResult
}
SearchDoneMsg is emitted when the form is submitted.
type SearchModel ¶
type SearchModel struct {
// contains filtered or unexported fields
}
SearchModel is the multi-step search form.
func NewSearchModel ¶
func NewSearchModel(defaultSource string, count int) SearchModel
func (SearchModel) Done ¶
func (m SearchModel) Done() bool
func (SearchModel) Init ¶
func (m SearchModel) Init() tea.Cmd
func (SearchModel) Result ¶
func (m SearchModel) Result() SearchResult
func (*SearchModel) SetSources ¶
func (m *SearchModel) SetSources(s map[string]source.Source)
SetSources gives the model access to sources for total fetching.
func (SearchModel) Update ¶
func (m SearchModel) Update(msg tea.Msg) (SearchModel, tea.Cmd)
func (SearchModel) View ¶
func (m SearchModel) View() string
type SearchResult ¶
type SearchResult struct {
Source string
Query string
Sort string
Count int
MinRes string
Colors []string
Subreddit string
}
SearchResult carries choices from the search form.
type StartDownloadMsg ¶
type StartDownloadMsg struct {
Index int
Result source.WallpaperResult
}
StartDownloadMsg triggers download of a single result.
type SummaryModel ¶
type SummaryModel struct {
// contains filtered or unexported fields
}
SummaryModel displays a final report.
func NewSummaryModel ¶
func NewSummaryModel(records []DownloadRecord, dir string) SummaryModel
func (SummaryModel) Init ¶
func (m SummaryModel) Init() tea.Cmd
func (SummaryModel) Update ¶
func (m SummaryModel) Update(msg tea.Msg) (SummaryModel, tea.Cmd)
func (SummaryModel) View ¶
func (m SummaryModel) View() string
type SwipeDoneMsg ¶
type SwipeDoneMsg struct {
Records []DownloadRecord
}
SwipeDoneMsg signals completion of the download view.
type SwipeModel ¶
type SwipeModel struct {
// contains filtered or unexported fields
}
SwipeModel is the bulk download view with animated progress.
func NewSwipeModel ¶
func NewSwipeModel(results []source.WallpaperResult) SwipeModel
func (SwipeModel) Current ¶
func (m SwipeModel) Current() source.WallpaperResult
func (SwipeModel) Init ¶
func (m SwipeModel) Init() tea.Cmd
Init starts the spinner and kicks off the first download.
func (SwipeModel) Records ¶
func (m SwipeModel) Records() []DownloadRecord
func (SwipeModel) Remaining ¶
func (m SwipeModel) Remaining() []source.WallpaperResult
Remaining returns unprocessed results.
func (SwipeModel) Total ¶
func (m SwipeModel) Total() int
func (SwipeModel) Update ¶
func (m SwipeModel) Update(msg tea.Msg) (SwipeModel, tea.Cmd)
func (SwipeModel) View ¶
func (m SwipeModel) View() string