make skip_reason optional
This commit is contained in:
9
api.go
9
api.go
@@ -30,13 +30,13 @@ type ThinPackage struct {
|
|||||||
Repo string `json:"repo"`
|
Repo string `json:"repo"`
|
||||||
SplitPackages []string `json:"split_packages"`
|
SplitPackages []string `json:"split_packages"`
|
||||||
Status dbpackage.Status `json:"status"`
|
Status dbpackage.Status `json:"status"`
|
||||||
SkipReason string `json:"skip_reason"`
|
SkipReason *string `json:"skip_reason,omitempty"`
|
||||||
LTO dbpackage.Lto `json:"lto"`
|
LTO dbpackage.Lto `json:"lto"`
|
||||||
DebugSymbols dbpackage.DebugSymbols `json:"debug_symbols"`
|
DebugSymbols dbpackage.DebugSymbols `json:"debug_symbols"`
|
||||||
ArchVersion string `json:"arch_version"`
|
ArchVersion string `json:"arch_version"`
|
||||||
RepoVersion string `json:"repo_version"`
|
RepoVersion string `json:"repo_version"`
|
||||||
BuildDate string `json:"build_date"`
|
BuildDate string `json:"build_date"`
|
||||||
PeakMem *string `json:"peak_mem"`
|
PeakMem *string `json:"peak_mem,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type PackageResponse struct {
|
type PackageResponse struct {
|
||||||
@@ -160,13 +160,16 @@ func GetPackages(w http.ResponseWriter, r *http.Request) {
|
|||||||
Repo: mPkg.Repository.String() + "-" + mPkg.March,
|
Repo: mPkg.Repository.String() + "-" + mPkg.March,
|
||||||
SplitPackages: mPkg.Packages,
|
SplitPackages: mPkg.Packages,
|
||||||
Status: mPkg.Status,
|
Status: mPkg.Status,
|
||||||
SkipReason: mPkg.SkipReason,
|
|
||||||
LTO: mPkg.Lto,
|
LTO: mPkg.Lto,
|
||||||
DebugSymbols: mPkg.DebugSymbols,
|
DebugSymbols: mPkg.DebugSymbols,
|
||||||
ArchVersion: mPkg.Version,
|
ArchVersion: mPkg.Version,
|
||||||
RepoVersion: mPkg.RepoVersion,
|
RepoVersion: mPkg.RepoVersion,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if mPkg.SkipReason != "" {
|
||||||
|
nPkg.SkipReason = &mPkg.SkipReason
|
||||||
|
}
|
||||||
|
|
||||||
if !mPkg.BuildTimeStart.IsZero() {
|
if !mPkg.BuildTimeStart.IsZero() {
|
||||||
nPkg.BuildDate = mPkg.BuildTimeStart.UTC().Format(time.RFC1123)
|
nPkg.BuildDate = mPkg.BuildTimeStart.UTC().Format(time.RFC1123)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user