[feat] PkgVersion

This commit is contained in:
what 2024-11-22 15:39:14 +08:00
parent e434c33afb
commit 4e99e723c9
2 changed files with 25 additions and 1 deletions

16
base/pkg_version.go Normal file
View File

@ -0,0 +1,16 @@
package base
type PkgVersion struct {
Name string `db:"pkg"`
Bundle string `db:"bundle"`
Hash string `db:"hash"`
FileName string `db:"filename"`
SourceMapFileName string `db:"sourcemapFileName"`
Imports []string `db:"imports"`
VersionAt string `db:"version_at"`
}
func (this PkgVersion) GetFile() []byte
func (this PkgVersion) GetSourceMap() []byte
type GetPkgVersion func(pkg string) (PkgVersion, bool)

View File

@ -101,6 +101,7 @@ var (
// 请求第三个接口 // 请求第三个接口
ErrApiRequest = &Errno{Code: 20501, Msg: "Api Request Error"} ErrApiRequest = &Errno{Code: 20501, Msg: "Api Request Error"}
ErrApiResponsed = &Errno{Code: 20502, Msg: "Api Responsed Error"} ErrApiResponsed = &Errno{Code: 20502, Msg: "Api Responsed Error"}
ErrApiAuth = &Errno{Code: 20503, Msg: "Api Auth Error"}
// 验证码错误,206 // 验证码错误,206
ErrCaptcha = &Errno{Code: 20601, Msg: "验证码生成器不存在"} ErrCaptcha = &Errno{Code: 20601, Msg: "验证码生成器不存在"}
@ -110,7 +111,14 @@ var (
ErrCaptchaSend = &Errno{Code: 20605, Msg: "验证码发送错误"} ErrCaptchaSend = &Errno{Code: 20605, Msg: "验证码发送错误"}
ErrCaptchaInterval = &Errno{Code: 20606, Msg: "验证码获取失败, 请稍后再试"} ErrCaptchaInterval = &Errno{Code: 20606, Msg: "验证码获取失败, 请稍后再试"}
// // Pkg 错误
ErrPkgUnknown = &Errno{Code: 20701, Msg: "pkg unknown"}
ErrPkgInvalid = &Errno{Code: 20702, Msg: "pkg invalid"}
ErrPkgPlatformInvalid = &Errno{Code: 20703, Msg: "pkg platform invalid"}
ErrPkgUpgrade = &Errno{Code: 20704, Msg: "pkg upgrade fail"}
ErrPkgDownload = &Errno{Code: 20705, Msg: "pkg download fail"}
ErrPkgUpload = &Errno{Code: 20706, Msg: "pkg upload fail"}
ErrPkgBuild = &Errno{Code: 20707, Msg: "pkg build fail"}
) )
// 使用 错误码 和 error 创建新的 错误 // 使用 错误码 和 error 创建新的 错误