assets

package
v0.17.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 25, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SanitizeName

func SanitizeName(name, version string) string

SanitizeName removes irrelevant information from the file name in case it exists

Types

type Asset

type Asset struct {
	Name string
	// Some providers (like gitlab) have non-descriptive names for files,
	// so we're using this DisplayName as a helper to produce prettier
	// outputs for bin
	DisplayName string
	URL         string
}

func (Asset) String added in v0.2.1

func (g Asset) String() string

type Filter added in v0.6.0

type Filter struct {
	// contains filtered or unexported fields
}

func NewFilter added in v0.6.0

func NewFilter(opts *FilterOpts) *Filter

func (*Filter) FilterAssets added in v0.6.0

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 added in v0.6.0

func (f *Filter) ProcessURL(gf *FilteredAsset) (*finalFile, error)

ProcessURL processes a FilteredAsset by uncompressing/unarchiving the URL of the asset.

type FilterOpts added in v0.6.0

type FilterOpts struct {
	SkipScoring   bool
	SkipPathCheck bool

	// In case of updates, we're sending the previous version package path
	// so in case it's the same one, we can re-use it.
	PackageName string

	// If target file is in a package format (tar, zip,etc) use this
	// variable to filter the resulting outputs. This is very useful
	// so we don't prompt the user to pick the file again on updates
	PackagePath string
}

type FilteredAsset

type FilteredAsset struct {
	RepoName    string
	Name        string
	DisplayName string
	URL         string

	ExtraHeaders map[string]string
	// contains filtered or unexported fields
}

func (FilteredAsset) String

func (g FilteredAsset) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL