packages

package
v0.0.0-...-8bf0aa5 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2023 License: MIT Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoPackages = errors.New("no packages found")

Functions

This section is empty.

Types

type GithubReleaseProvider

type GithubReleaseProvider struct {
	*github.Client
	// contains filtered or unexported fields
}

func NewGithubReleaseProvider

func NewGithubReleaseProvider(config GithubReleaseProviderConfig, logger *zap.Logger) *GithubReleaseProvider

func (*GithubReleaseProvider) FindLatestPackage

func (g *GithubReleaseProvider) FindLatestPackage(ctx context.Context, goos, goarch, goarm string) (*Package, error)

func (*GithubReleaseProvider) GetLatestPackages

func (g *GithubReleaseProvider) GetLatestPackages(ctx context.Context) ([]Package, error)

type GithubReleaseProviderConfig

type GithubReleaseProviderConfig struct {
	Owner string
	Repo  string
}

type Package

type Package struct {
	GOOS        string `json:"goos"`
	GOARCH      string `json:"goarch"`
	GOARM       string `json:"goarm"`
	Version     string `json:"version"`
	DownloadURL string `json:"downloadUrl"`
}

type Provider

type Provider interface {
	// GetLatestPackages returns all the available packages for the latest release and
	// returns ErrNoPackages if no packages can be found.
	GetLatestPackages(ctx context.Context) ([]Package, error)

	// FindLatestPackage returns the latest package for the given GOOS, GOARCH, and GOARM
	// and returns ErrNoPackages if no package can be found.
	FindLatestPackage(ctx context.Context, goos, goarch, goarm string) (*Package, error)
}

Jump to

Keyboard shortcuts

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