Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompareVersions ¶
CompareVersions 比较版本号,返回: -1: oldVersion < newVersion
0: oldVersion == newVersion 1: oldVersion > newVersion
func SaveVersionInfo ¶
SaveVersionInfo 保存当前版本信息
Types ¶
type Installer ¶
type Installer interface {
// Install 将程序安装到系统PATH中
Install(executablePath string) error
// Uninstall 从系统PATH中移除程序
Uninstall() error
}
Installer 接口定义了安装程序的方法
type LinuxInstaller ¶
type LinuxInstaller struct {
// contains filtered or unexported fields
}
LinuxInstaller 实现了Linux系统下的安装逻辑
func (*LinuxInstaller) Install ¶
func (l *LinuxInstaller) Install(executablePath string) error
Install 在Linux系统中安装程序到PATH
func (*LinuxInstaller) Uninstall ¶
func (l *LinuxInstaller) Uninstall() error
Uninstall 在Linux系统中从PATH移除程序
type VersionInfo ¶
type VersionInfo struct {
Version string `json:"version"`
InstallPath string `json:"install_path"`
InstallTime time.Time `json:"install_time"`
BackupPath string `json:"backup_path,omitempty"`
}
VersionInfo 存储安装的版本信息
func GetInstalledVersion ¶
func GetInstalledVersion() (*VersionInfo, error)
GetInstalledVersion 获取已安装的版本信息
Click to show internal directories.
Click to hide internal directories.