github

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindAssetsContaining added in v1.0.0

func FindAssetsContaining(terms []string, assets []*github.ReleaseAsset) []*github.ReleaseAsset

FindAssetContaining searches the provided slice of assets for entries whose Name contains all of the given search terms.

func FindAssetsExcluding added in v1.0.0

func FindAssetsExcluding(terms []string, assets []*github.ReleaseAsset) []*github.ReleaseAsset

FindAssetsExcluding searches the provided slice of assets for entries whose Name contains none of the given search terms.

func FindAssetsForArch added in v1.0.0

func FindAssetsForArch(assets []*github.ReleaseAsset) []*github.ReleaseAsset

FindAssetsForArch searches the provided list of assets and returns the subset, if any, matching the local architecture as defined by runtime.GOARCH, as well as well-known alternative names for the architecture

func FindAssetsForArchAndOS added in v1.0.0

func FindAssetsForArchAndOS(assets []*github.ReleaseAsset) []*github.ReleaseAsset

FindAssetsForArchAndOS searches the provided list of assets and returns the subset, if any, matching the local architecture and OS, as defined by runtime.GOARCH and runtime.GOOS, respectively. In addition to these values, well-known alternatives are also used when searching.

func FindAssetsForOS added in v1.0.0

func FindAssetsForOS(assets []*github.ReleaseAsset) []*github.ReleaseAsset

FindAssetsForOS searches the provided list of assets and returns the subset, if any, matching the local OS as defined by runtime.GOOS, as well as any well-known alternative names for the OS

func FindAssetsMatching added in v1.0.0

func FindAssetsMatching(pattern string, assets []*github.ReleaseAsset) ([]*github.ReleaseAsset, error)

FindAssetMatching searches the provided slice of assets for entries whose Name matches the given pattern. All matches are returned. If no matches are found, an error is returned.

Types

type Source

type Source struct {
	// Owner specifies the organization or user this tool belongs to
	Owner string

	// Repo specifies the repository of the tool
	Repo string
	// contains filtered or unexported fields
}

func NewSource

func NewSource(owner, repo string) *Source

func (Source) DownloadReleaseAssets

func (s Source) DownloadReleaseAssets(assets []*github.ReleaseAsset, dir string) error

DownloadReleaseAssets downloads the provided GitHub release assets and stores them in the given directory. The resulting files will match the assets' names

func (Source) FetchLatestRelease

func (s Source) FetchLatestRelease() (*github.RepositoryRelease, error)

FetchLatestRelease returns the latest release of the tool from GitHub

func (Source) FetchLatestTag

func (s Source) FetchLatestTag() (string, error)

FetchTags returns the latest tag FetchLatestTag returns the latest tag

func (Source) FetchRelease

func (s Source) FetchRelease(releaseID int64) (*github.RepositoryRelease, error)

FetchRelease returns the specified release of the tool from GitHub

func (Source) ListReleases

func (s Source) ListReleases(opts *github.ListOptions) ([]*github.RepositoryRelease, error)

ListReleases returns all releases of the tool from GitHub

Jump to

Keyboard shortcuts

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