Documentation
¶
Index ¶
- func DownloadUrlToTempFile(url string) (string, error)
- func ExtractGithubOwnerRepo(githubURL string) (string, string, error)
- func FindAppImageLink(pageURL string) (string, error)
- func SaveReaderToTempFile(reader io.Reader) (string, error)
- func StringOrDefault(description *string, defaultStr string) string
- func TrimSuffixes(s string, suffixes ...string) string
- type AppImage
- type AppImageLink
- type ReaderCloser
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DownloadUrlToTempFile ¶
func ExtractGithubOwnerRepo ¶
ExtractGithubOwnerRepo extracts the organization and repository from a GitHub URL.
func FindAppImageLink ¶
FindAppImageLink returns the latest AppImage link discovered on the page.
func StringOrDefault ¶
func TrimSuffixes ¶
TrimSuffixes removes the first matching suffix from the input string.
Types ¶
type AppImage ¶
type AppImage struct {
// contains filtered or unexported fields
}
func NewAppImage ¶
type AppImageLink ¶
type AppImageLink struct {
// Href is the raw attribute value as seen in the HTML.
Href string
// URL is the fully resolved absolute URL that can be downloaded. When
// redirects are encountered this will contain the final destination.
URL string
// Filename is the last path element of the resolved URL.
Filename string
}
AppImageLink represents a discovered AppImage hyperlink.
func FindAppImageLinks ¶
func FindAppImageLinks(pageURL, matchExpr string) ([]AppImageLink, error)
FindAppImageLinks returns all AppImage links on the provided page sorted in version-aware order. When matchExpr is provided it is treated as a case insensitive regular expression applied to the raw href attribute.
func FindAppImageLinksWithExtension ¶
func FindAppImageLinksWithExtension(pageURL, matchExpr, extension string) ([]AppImageLink, error)
FindAppImageLinksWithExtension behaves like FindAppImageLinks but allows callers to override the file extension matched on the source page.
type ReaderCloser ¶
func (*ReaderCloser) Close ¶
func (oc *ReaderCloser) Close() error
Click to show internal directories.
Click to hide internal directories.