github

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoUpgrade = errors.New("requested release is not more recent than current version")

Functions

func ResolveTag added in v1.13.0

func ResolveTag(repo, tag string, prerelease bool, getter HTTPGetter) (string, error)

ResolveTag resolves a tag, or a tag pattern, to a concrete release tag. An empty tag resolves the repository's latest release and a pattern resolves the newest matching release, so callers such as `query` accept the same tag grammar as an install without selecting an asset.

func SetVerbose

func SetVerbose(enabled bool, writer io.Writer)

func VerboseEnabledForTest

func VerboseEnabledForTest() bool

Types

type AssetFinder

type AssetFinder struct {
	Repo       string
	Tag        string
	Prerelease bool
	MinTime    time.Time
	Getter     HTTPGetter
	// contains filtered or unexported fields
}

func NewAssetFinder

func NewAssetFinder(repo, tag string, prerelease bool, minTime time.Time) *AssetFinder

func (*AssetFinder) AssetMetadata added in v1.8.8

func (f *AssetFinder) AssetMetadata(url string) (id, size int64, updatedAt time.Time, digest string, ok bool)

func (*AssetFinder) Find

func (f *AssetFinder) Find() ([]string, error)

func (*AssetFinder) FindMatch

func (f *AssetFinder) FindMatch() ([]string, error)

FindMatch scans releases newest-first and returns the first whose tag satisfies the filter. Unlike a plain substring match, a bare filter anchors at the tag prefix so it cannot select an unrelated product's release inside a monorepo.

A stable tag is preferred. When only prerelease tags match — common when a monorepo marks each product release prerelease so the repository-wide Latest pointer does not jump between products — the newest prerelease is used.

func (*AssetFinder) ReleaseVersion added in v1.7.3

func (f *AssetFinder) ReleaseVersion() string

type Error

type Error struct {
	Code   int
	Status string
	Body   []byte
	URL    string
}

func (*Error) Error

func (e *Error) Error() string

type Finder

type Finder interface {
	Find() ([]string, error)
}

type HTTPGetter

type HTTPGetter interface {
	Get(url string) (*http.Response, error)
}

type HTTPGetterFunc added in v1.13.0

type HTTPGetterFunc func(url string) (*http.Response, error)

HTTPGetterFunc adapts a plain function to HTTPGetter.

func (HTTPGetterFunc) Get added in v1.13.0

func (f HTTPGetterFunc) Get(url string) (*http.Response, error)

type Release

type Release struct {
	Assets []releaseAsset `json:"assets"`

	Prerelease bool      `json:"prerelease"`
	Tag        string    `json:"tag_name"`
	CreatedAt  time.Time `json:"created_at"`
}

type SourceFinder

type SourceFinder struct {
	Tool string
	Repo string
	Tag  string
}

func NewSourceFinder

func NewSourceFinder(repo, tag, tool string) *SourceFinder

func (*SourceFinder) Find

func (f *SourceFinder) Find() ([]string, error)

Jump to

Keyboard shortcuts

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