release

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package release reads and compares published GitHub releases.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompareSemanticVersions

func CompareSemanticVersions(first, second SemanticVersion) int

CompareSemanticVersions 按发布版本规则比较两个已解析版本。

func NewReleaseHTTPClient

func NewReleaseHTTPClient(proxy string) (*http.Client, error)

NewReleaseHTTPClient creates the GitHub client used only by javdb update. A blank proxy preserves the Go transport's documented HTTPS_PROXY/ALL_PROXY behavior.

Types

type GitHubReleaseClient

type GitHubReleaseClient struct {
	// contains filtered or unexported fields
}

GitHubReleaseClient reads GitHub's public Releases API.

func NewGitHubReleaseClient

func NewGitHubReleaseClient(options ReleaseClientOptions) (*GitHubReleaseClient, error)

NewGitHubReleaseClient constructs an unauthenticated Release reader.

func (*GitHubReleaseClient) Check

func (c *GitHubReleaseClient) Check(ctx context.Context, includePrerelease bool) (*Release, error)

Check returns the highest SemVer release. GitHub page links are followed until exhausted so a repository with more than one API page is not silently truncated.

type Release

type Release = model.Release

Release 与 ReleaseAsset 是发布 API 使用的稳定模型别名。

type ReleaseAsset

type ReleaseAsset = model.ReleaseAsset

type ReleaseChecker

type ReleaseChecker interface {
	Check(context.Context, bool) (*Release, error)
}

ReleaseChecker resolves the highest compatible published GitHub Release.

type ReleaseClientOptions

type ReleaseClientOptions struct {
	HTTPClient *http.Client
	Endpoint   string
}

ReleaseClientOptions exposes the API endpoint for deterministic tests.

type SemanticVersion

type SemanticVersion = semanticVersion

SemanticVersion 是更新流程可传递的已校验版本值;字段仍保持内部封装。

func ParseSemanticVersion

func ParseSemanticVersion(tag string) (SemanticVersion, error)

ParseSemanticVersion 将发布 tag 解析为可比较的版本。

Jump to

Keyboard shortcuts

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