model

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package model 保存更新流程跨领域共享的数据模型。

Index

Constants

View Source
const (
	// GitHubRepository 是官方 GitHub 仓库标识。
	GitHubRepository = "FlanChanXwO/javdb-cli"
	// GoInstallPackage 是 go install 更新使用的模块路径。
	GoInstallPackage = "github.com/FlanChanXwO/javdb-cli/cmd/javdb"
	// HomebrewFormula 是 Homebrew 更新使用的 formula 标识。
	HomebrewFormula = "FlanChanXwO/tap/javdb-cli"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type InstallSource

type InstallSource string

InstallSource describes the package manager or artifact that owns javdb.

const (
	InstallSourceDevelopment InstallSource = "development"
	InstallSourceHomebrew    InstallSource = "homebrew"
	InstallSourceGoInstall   InstallSource = "go-install"
	InstallSourceRelease     InstallSource = "release"
)

type Release

type Release struct {
	TagName    string         `json:"tag_name"`
	Prerelease bool           `json:"prerelease"`
	Assets     []ReleaseAsset `json:"assets"`
}

Release is a verified candidate returned by the GitHub Releases API.

type ReleaseAsset

type ReleaseAsset struct {
	Name        string `json:"name"`
	DownloadURL string `json:"browser_download_url"`
}

ReleaseAsset is the subset of GitHub Release asset metadata used by updater.

type Request

type Request struct {
	BuildInfo         buildinfo.Info
	Check             bool
	IncludePrerelease bool
}

Request 描述一次显式 javdb update 调用。

type Result

type Result struct {
	Source           InstallSource `json:"source"`
	CurrentVersion   string        `json:"current_version"`
	LatestVersion    *string       `json:"latest_version"`
	LatestPrerelease bool          `json:"latest_prerelease"`
	UpdateAvailable  bool          `json:"update_available"`
}

Result 是人类输出和 JSON 检查结果共用的稳定状态模型。

Jump to

Keyboard shortcuts

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