brunel/domain/packages.go

71 lines
1.5 KiB
Go
Raw Normal View History

2024-07-28 20:59:50 +02:00
package domain
import (
"time"
2024-07-30 02:24:18 +02:00
"github.com/alphadose/haxmap"
2024-07-28 20:59:50 +02:00
)
type PackagesCount struct {
Stale int `json:"stale"`
Missing int `json:"missing"`
Current int `json:"built"`
Error int `json:"error"`
Queued int `json:"queued"`
Building int `json:"building"`
}
type SourcePackage struct {
Name string `gorm:"primarykey"`
Has32bit bool
Version string
NewVersion string
Status PackageStatus
LastBuildStatus PackageStatus
BuildAttempts int
Packages *haxmap.Map[string, PackageInfo] `gorm:"foreignKey:PackageInfo;references:PackageName"`
2024-07-28 20:59:50 +02:00
}
type SourcePackageDTO struct {
2024-08-04 13:25:24 +02:00
Name string `gorm:"primarykey"`
Has32bit bool
Version string
NewVersion string
Status PackageStatus
LastBuildStatus PackageStatus
BuildAttempts int
Packages []PackageInfo `gorm:"foreignKey:PackageName"`
2024-07-28 20:59:50 +02:00
}
type PackageInfo struct {
PackageName string `gorm:"primarykey"`
Version string
Source string
Architecture string
Description string
Status PackageStatus
NewVersion string
LastBuildStatus PackageStatus
2024-07-30 09:20:32 +02:00
BuildAttempts int
2024-07-28 20:59:50 +02:00
}
type PackageStatus string
const (
// Package is built
Built PackageStatus = "Built"
// Package is stale
Stale PackageStatus = "Stale"
// Package build errored out
Error PackageStatus = "Error"
// Package is being missing
Missing PackageStatus = "Missing"
// Package is upto date
Current PackageStatus = "Current"
)
type TimeContainer struct {
ID string
Time time.Time
}