domain

package
v0.261.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const KeepCachedBinary = ""

KeepCachedBinary is the release to install when the cached binary stays.

Variables

This section is empty.

Functions

func CleanVersion

func CleanVersion(v string) string

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

type CachedBinary struct {
	Present       bool
	KilledAtStart bool
	Version       string
}

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

type LatestRelease func(ctx context.Context) (string, error)

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.

Jump to

Keyboard shortcuts

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