Documentation
¶
Index ¶
- Constants
- func CompareSemver(left string, right string) (int, error)
- func Endpoint(repository string) string
- func Format(result Result) string
- func NormalizeVersionTag(version string) (string, error)
- func ResolveEndpoint(endpointOrRepository string, repository string) (string, error)
- type Asset
- type AssetCheck
- type Options
- type Release
- type Result
- type Target
Constants ¶
View Source
const ( DefaultRepository = "Gitlawb/zero" DefaultTimeout = 5 * time.Second )
Variables ¶
This section is empty.
Functions ¶
func CompareSemver ¶
CompareSemver compares two semver-ish release tags.
func NormalizeVersionTag ¶
NormalizeVersionTag returns a comparable x.y.z version from a release tag.
Types ¶
type AssetCheck ¶
type AssetCheck struct {
Platform string `json:"platform"`
Arch string `json:"arch"`
ArchiveName string `json:"archiveName"`
ArchiveURL string `json:"archiveUrl,omitempty"`
ChecksumName string `json:"checksumName"`
ChecksumURL string `json:"checksumUrl,omitempty"`
ArchiveFound bool `json:"archiveFound"`
ChecksumFound bool `json:"checksumFound"`
Verified bool `json:"verified"`
}
type Options ¶
type Options struct {
CurrentVersion string
// Endpoint accepts a full release API URL, an owner/repo slug, or a data:
// endpoint for deterministic tests.
Endpoint string
Repository string
Timeout time.Duration
GOOS string
GOARCH string
// Fetch overrides the release fetcher for tests and alternate transports.
Fetch func(context.Context, string) (Release, error)
}
Options configures a release update check.
type Result ¶
type Target ¶
type Target struct {
Name string `json:"name"`
GOOS string `json:"goos"`
GOARCH string `json:"goarch"`
Platform string `json:"platform"`
Arch string `json:"arch"`
}
Target identifies a supported release archive target.
func ResolveTarget ¶
ResolveTarget maps a release target name like windows-x64 to Go build coordinates and release asset naming fields.
Click to show internal directories.
Click to hide internal directories.