diff --git a/base/pkg_version.go b/base/pkg_version.go new file mode 100644 index 0000000..bd47c3f --- /dev/null +++ b/base/pkg_version.go @@ -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) diff --git a/errno.go b/errno.go index 35bc296..77c6c7b 100644 --- a/errno.go +++ b/errno.go @@ -101,6 +101,7 @@ var ( // 请求第三个接口 ErrApiRequest = &Errno{Code: 20501, Msg: "Api Request Error"} ErrApiResponsed = &Errno{Code: 20502, Msg: "Api Responsed Error"} + ErrApiAuth = &Errno{Code: 20503, Msg: "Api Auth Error"} // 验证码错误,206 ErrCaptcha = &Errno{Code: 20601, Msg: "验证码生成器不存在"} @@ -110,7 +111,14 @@ var ( ErrCaptchaSend = &Errno{Code: 20605, 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 创建新的 错误