errs

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrUnsupportedChecksumAlgorithm Unsupported checksum algorithm
	ErrUnsupportedChecksumAlgorithm = errors.New("unsupported checksum algorithm")
	// ErrChecksumNotMatched File checksum does not match the computed checksum
	ErrChecksumNotMatched = errors.New("file checksum does not match the computed checksum")
	// ErrChecksumFileNotFound Checksum file not found
	ErrChecksumFileNotFound = errors.New("checksum file not found")
	// ErrAssetNotFound Asset not found
	ErrAssetNotFound = errors.New("asset not found")
	// ErrCollectorNotFound Collector not found
	ErrCollectorNotFound = errors.New("collector not found")
	// ErrEmptyURL URL is empty
	ErrEmptyURL = errors.New("empty url")
)

Functions

func IsDownload added in v1.6.0

func IsDownload(err error) bool

IsDownload 若是下载失败错误,返回true;反之,返回false。

func IsMalformedVersion added in v1.6.0

func IsMalformedVersion(err error) bool

IsMalformedVersion 若是版本号格式错误,返回true;反之,返回false。

func IsPackageNotFound added in v1.6.0

func IsPackageNotFound(err error) bool

IsPackageNotFound 若是软件包不存在错误,则返回true;反之,返回false。

func IsURLUnreachable added in v1.6.0

func IsURLUnreachable(err error) bool

IsURLUnreachable 若是URL不可达错误,返回true;反之,返回false。

func IsVersionNotFound added in v1.6.0

func IsVersionNotFound(err error) bool

IsVersionNotFound 若是版本不存在错误,返回true;反之,返回false。

func NewDownloadError

func NewDownloadError(url string, err error) error

NewDownloadError 返回下载失败错误实例

func NewMalformedVersionError added in v1.6.0

func NewMalformedVersionError(version string, err error) error

NewMalformedVersionError 返回版本号格式错误实例

func NewPackageNotFoundError added in v1.6.0

func NewPackageNotFoundError(kind, goos, goarch string) error

NewPackageNotFoundError 返回软件包不存在错误实例

func NewURLUnreachableError

func NewURLUnreachableError(url string, err error) error

NewURLUnreachableError 返回URL不可达错误实例

func NewVersionNotFoundError added in v1.6.0

func NewVersionNotFoundError(version, goos, goarch string) error

NewVersionNotFoundError 返回版本不存在错误实例

Types

type DownloadError

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

DownloadError 下载失败错误

func (DownloadError) Error

func (e DownloadError) Error() string

Error 返回错误详情

func (DownloadError) URL

func (e DownloadError) URL() string

URL 返回资源URL

func (DownloadError) Unwrap added in v1.6.0

func (e DownloadError) Unwrap() error

Unwrap 返回错误对象

type MalformedVersionError added in v1.6.0

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

MalformedVersionError 版本号格式错误

func (MalformedVersionError) Error added in v1.6.0

func (e MalformedVersionError) Error() string

Error 返回错误详情

func (MalformedVersionError) Unwrap added in v1.6.0

func (e MalformedVersionError) Unwrap() error

Unwrap 返回源错误

func (MalformedVersionError) Version added in v1.6.0

func (e MalformedVersionError) Version() string

Version 返回版本号

type PackageNotFoundError added in v1.6.0

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

PackageNotFoundError 软件包不存在错误

func (PackageNotFoundError) Error added in v1.6.0

func (e PackageNotFoundError) Error() string

Error 返回错误详情

type URLUnreachableError

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

URLUnreachableError URL不可达错误

func (URLUnreachableError) Error

func (e URLUnreachableError) Error() string

Error 返回错误详情

func (URLUnreachableError) URL

func (e URLUnreachableError) URL() string

URL 返回URL地址

func (URLUnreachableError) Unwrap added in v1.6.0

func (e URLUnreachableError) Unwrap() error

Unwrap 返回源错误

type VersionNotFoundError added in v1.6.0

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

VersionNotFoundError 版本不存在错误

func (VersionNotFoundError) Error added in v1.6.0

func (e VersionNotFoundError) Error() string

Error 返回错误详情

func (VersionNotFoundError) Version added in v1.6.0

func (e VersionNotFoundError) Version() string

Version 返回版本号

Jump to

Keyboard shortcuts

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