Documentation
¶
Index ¶
Constants ¶
const KeepCachedBinary = ""
KeepCachedBinary is the release to install when the cached binary stays.
Variables ¶
This section is empty.
Functions ¶
func CleanVersion ¶
CleanVersion normalizes a version ("v0.50.0" -> "0.50.0") and rejects values that do not look like one (HTML bodies, "latest", "sha256:...").
Types ¶
type CachedBinary ¶
CachedBinary is what the gateway binary in the CLI's cache says about itself: whether it is there, whether it still starts, and its version.
func (CachedBinary) Is ¶
func (b CachedBinary) Is(tag string) bool
Is reports whether the cached binary is the release tagged tag. A binary that cannot say its version is not known to be any release.
func (CachedBinary) Usable ¶
func (b CachedBinary) Usable() bool
Usable reports whether the cached binary can serve at all.
type LatestRelease ¶
LatestRelease looks up the tag of the newest gateway release.
type WantedRelease ¶
type WantedRelease struct {
PinnedTag string
}
WantedRelease is the gateway release the configuration asks for: the one tagged PinnedTag, or the latest release when no tag is pinned.
func (WantedRelease) ToInstall ¶
func (w WantedRelease) ToInstall(ctx context.Context, cached CachedBinary, latest LatestRelease) (string, error)
ToInstall names the release to put in place of the cached binary, or KeepCachedBinary. A pinned release is never updated past and needs no lookup. Following the latest keeps a usable binary when the lookup fails or the binary cannot say its version, so a start never breaks on GitHub.