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: 0

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