Documentation
¶
Overview ¶
Package pkg contains the ffclient and helper methods.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FFDownloader ¶
type FFDownloader struct {
// contains filtered or unexported fields
}
FFDownloader represents a downloader for resources from https://fuckingfast.co/ It handles URL validation, content fetching, and file downloading.
func NewFF ¶
func NewFF(pageUrl string, spinner *mpb.Bar) (*FFDownloader, error)
NewFF creates a new FFDownloader instance and validates the provided page URL. It takes a page URL string and a progress bar spinner as parameters. Returns a new FFDownloader instance and an error if validation fails.
func (*FFDownloader) Download ¶
func (ff *FFDownloader) Download(path string, bar *mpb.Bar) error
Download performs the actual file download to the specified path. It takes a destination path and a progress bar as parameters. Returns an error if the download fails at any stage.
func (*FFDownloader) DownloadUrl ¶
func (ff *FFDownloader) DownloadUrl() string
DownloadUrl returns the download URL extracted from the page.
func (*FFDownloader) FileName ¶
func (ff *FFDownloader) FileName() string
FileName returns the filename extracted from the page content.
func (*FFDownloader) IsValid ¶
func (ff *FFDownloader) IsValid() bool
IsValid returns whether the FFDownloader has a valid configuration.
func (*FFDownloader) PageUrl ¶
func (ff *FFDownloader) PageUrl() string
PageUrl returns the page URL associated with the FFDownloader.