Documentation ¶
Overview ¶
download.go
download an asset after filtering
filter.go
filter assets from a release, determine which one is the one to download based on highest scoring
processor.go
process downloaded asset, maybe it is binary file(eg. jq-osx-amd64) or an archive(tar.gz, tar.xz, zip)
resolver.go
resolve target host info (OS, arch) for filtering the best asset to download
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SanitizeName ¶
SanitizeName removes irrelevant information from the file name in case it exists
Types ¶
type Asset ¶
type Filter ¶
type Filter struct {
// contains filtered or unexported fields
}
func InitFilter ¶
func InitFilter(repoName string, name string, packagePath string, opts *FilterOpts) *Filter
func NewFilter ¶
func NewFilter(opts *FilterOpts) *Filter
func (*Filter) FilterAssetContents ¶
func (f *Filter) FilterAssetContents(repoName string, as []*Asset) (*FilteredAsset, error)
FilterAssetContents receives a slice of GL assets and tries to select the proper one and ask the user to manually select one in case it can't determine it
func (*Filter) FilterAssets ¶
func (f *Filter) FilterAssets(repoName string, as []*Asset) (*FilteredAsset, error)
FilterAssets receives a slice of GL assets and tries to select the proper one and ask the user to manually select one in case it can't determine it
func (*Filter) ProcessURL ¶
func (f *Filter) ProcessURL(gf *FilteredAsset) (*finalFile, error)
ProcessURL processes a FilteredAsset by uncompressing/unarchiving the URL of the asset.
type FilterOpts ¶
type FilteredAsset ¶
type FilteredAsset struct { RepoName string Name string DisplayName string URL string // API URL: https://api.github.com/repos/BurntSushi/ripgrep/releases/assets/38486907 BrowserDownloadURL string // BrowserDownloadURL: https://github.com/junegunn/fzf/releases/download/0.42.0/fzf-0.42.0-darwin_amd64.zip Size int64 ContentMd5 string ExtraHeaders map[string]string // contains filtered or unexported fields }
TODO: use BrowserDownloadURL to download not API URL see ReleaseAsset struct in go-github/github/repo_releases.go
func (FilteredAsset) String ¶
func (g FilteredAsset) String() string