version

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2022 License: MIT Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	// SourceKind go安装包种类-源码
	SourceKind = "Source"
	// ArchiveKind go安装包种类-压缩文件
	ArchiveKind = "Archive"
	// InstallerKind go安装包种类-可安装程序
	InstallerKind = "Installer"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Package

type Package struct {
	FileName    string
	URL         string
	Kind        string
	OS          string
	Arch        string
	Size        string
	Checksum    string
	ChecksumURL string
	Algorithm   string // checksum algorithm
}

Package go版本安装包

func (*Package) DownloadWithProgress added in v1.2.0

func (pkg *Package) DownloadWithProgress(dst string) (size int64, err error)

DownloadWithProgress 下载版本另存为指定文件且显示下载进度

func (*Package) VerifyChecksum

func (pkg *Package) VerifyChecksum(filename string) (err error)

VerifyChecksum 验证目标文件的校验和与当前安装包的校验和是否一致

type Version

type Version struct {
	Name     string // 版本名,如'1.12.4'
	Packages []*Package
}

Version go版本

func FindVersion

func FindVersion(all []*Version, name string) (*Version, error)

FindVersion 返回指定名称的版本

func (*Version) FindPackage

func (v *Version) FindPackage(kind, goos, goarch string) (*Package, error)

FindPackage 返回指定操作系统和硬件架构的版本包

func (*Version) FindPackages added in v1.1.2

func (v *Version) FindPackages(kind, goos, goarch string) (pkgs []*Package, err error)

FindPackages 返回指定操作系统和硬件架构的版本包

Jump to

Keyboard shortcuts

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