Documentation ¶
Index ¶
Constants ¶
View Source
const ( // SourceKind go安装包种类-源码 SourceKind = "Source" // ArchiveKind go安装包种类-压缩文件 ArchiveKind = "Archive" // InstallerKind go安装包种类-可安装程序 InstallerKind = "Installer" )
View Source
const (
// DefaultURL 提供go版本信息的默认网址
DefaultURL = "https://golang.org/dl/"
)
Variables ¶
View Source
var ( // ErrUnsupportedChecksumAlgorithm 不支持的校验和算法 ErrUnsupportedChecksumAlgorithm = errors.New("unsupported checksum algorithm") // ErrChecksumNotMatched 校验和不匹配 ErrChecksumNotMatched = errors.New("file checksum does not match the computed checksum") )
View Source
var ErrPackageNotFound = errors.New("installation package not found")
ErrPackageNotFound 版本包不存在
View Source
var ErrVersionNotFound = errors.New("version not found")
ErrVersionNotFound 版本不存在
Functions ¶
func NewDownloadError ¶
NewDownloadError 返回下载失败错误实例
func NewURLUnreachableError ¶
NewURLUnreachableError 返回URL不可达错误实例
Types ¶
type Collector ¶
type Collector struct {
// contains filtered or unexported fields
}
Collector go版本信息采集器
func (*Collector) AllVersions ¶
AllVersions 返回所有已知版本
func (*Collector) ArchivedVersions ¶
ArchivedVersions 返回已归档版本
func (*Collector) StableVersions ¶
StableVersions 返回所有稳定版本
type DownloadError ¶
type DownloadError struct {
// contains filtered or unexported fields
}
DownloadError 下载失败错误
func (*DownloadError) Error ¶
func (e *DownloadError) Error() string
type Package ¶
type Package struct { FileName string URL string Kind string OS string Arch string Size string Checksum string Algorithm string // checksum algorithm }
Package go版本安装包
func (*Package) VerifyChecksum ¶
VerifyChecksum 验证目标文件的校验和与当前安装包的校验和是否一致
type URLUnreachableError ¶
type URLUnreachableError struct {
// contains filtered or unexported fields
}
URLUnreachableError URL不可达错误
func (*URLUnreachableError) Error ¶
func (e *URLUnreachableError) Error() string
Click to show internal directories.
Click to hide internal directories.