serverversion

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RepoURL              = "https://github.com/srl-labs/clab-api-server"
	LatestReleaseURL     = RepoURL + "/releases/latest"
	DefaultInstallScript = "https://raw.githubusercontent.com/srl-labs/clab-api-server/main/install.sh"
)

Variables

This section is empty.

Functions

func Check

func Check(ctx context.Context, currentVersion string, opts CheckOptions) (string, error)

func CompareReleaseVersions

func CompareReleaseVersions(currentVersion, latestVersion string) (int, bool)

func DownloadURL

func DownloadURL(ctx context.Context, url string, w io.Writer) error

func FetchLatestVersion

func FetchLatestVersion(ctx context.Context) (string, error)

func FormatInfo

func FormatInfo(info BuildInfo) string

func FormatNewVersionMessage

func FormatNewVersionMessage(latestVersion string) string

func ParseLatestReleaseLocation

func ParseLatestReleaseLocation(location string) (string, error)

func RunCommand

func RunCommand(ctx context.Context, name string, args []string, env []string, stdout, stderr io.Writer) error

func Upgrade

func Upgrade(ctx context.Context, opts UpgradeOptions) error

func VersionCheckDisabled

func VersionCheckDisabled() bool

Types

type BuildInfo

type BuildInfo struct {
	Version string
	Commit  string
	Date    string
}

type CheckOptions

type CheckOptions struct {
	FetchLatestVersion func(context.Context) (string, error)
}

type UpgradeOptions

type UpgradeOptions struct {
	InstallScriptURL string
	Download         func(context.Context, string, io.Writer) error
	RunCommand       func(context.Context, string, []string, []string, io.Writer, io.Writer) error
	IsRoot           func() bool
	Environ          func() []string
	Stdout           io.Writer
	Stderr           io.Writer
}

Jump to

Keyboard shortcuts

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