release

package
v0.13.10 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package release looks up published jcode releases on GitHub and compares build versions. It is shared by `jcode update` and the web settings page.

Index

Constants

View Source
const DefaultTimeout = 10 * time.Second

DefaultTimeout bounds a latest-release lookup when the caller's context has no deadline of its own.

View Source
const LatestURL = "https://api.github.com/repos/cnjack/jcode/releases/latest"

LatestURL is the GitHub API endpoint for the newest non-prerelease release.

View Source
const ReleasesURL = "https://github.com/cnjack/jcode/releases"

ReleasesURL is the public release listing; TagURL links to one release.

Variables

This section is empty.

Functions

func Compare

func Compare(a, b string) (cmp int, ok bool)

Compare orders two semantic versions ("v1.2.3", "1.2.3-rc.1", ...). It returns -1, 0, or 1 and ok=false when either side is not a valid version (e.g. an unstamped dev build), in which case callers should not claim an update relationship.

func IsNewer

func IsNewer(latest, current string) bool

IsNewer reports whether latest is a strictly newer version than current.

func Normalize

func Normalize(v string) string

Normalize strips surrounding whitespace and a leading "v".

func TagURL

func TagURL(tag string) string

TagURL returns the release page for tag. It is built from the fixed repository URL so callers never open an API-supplied link.

Types

type Info

type Info struct {
	Tag         string    `json:"tag_name"`
	PublishedAt time.Time `json:"published_at"`
}

Info describes a published release.

func Latest

func Latest(ctx context.Context, client *http.Client) (Info, error)

Latest fetches the newest published release. A nil client uses http.DefaultClient.

Jump to

Keyboard shortcuts

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