woodpecker-autoscaler/internal/models/structs.go

57 lines
1.5 KiB
Go
Raw Normal View History

package models
/*
{
"pending": [
{
"id": "146",
"data": "REDACTED",
"labels": {
"repo": "REDACTED",
"type": "picus"
},
"dependencies": null,
"run_on": null,
"dep_status": {},
"agent_id": 0
}
],
"waiting_on_deps": null,
"running": null,
"stats": {
"worker_count": 40,
"pending_count": 1,
"waiting_on_deps_count": 0,
"running_count": 0,
"completed_count": 0
},
"paused": false
}
*/
type PendingInformation struct {
ID int `json:"id"`
Data string `json:"data"`
Labels map[string]string `json:"labels"`
2023-10-30 21:49:48 +00:00
Dependencies string `json:"dependencies,omitempty"`
RunOn string `json:"run_on"`
DepStatus string `json:"-"` // dont need those
AgentId int `json:"agent_id"`
}
type Stats struct {
WorkerCount int `json:"worker_count"`
PendingCount int `json:"pending_count"`
WaitingOnDepsCount int `json:"waiting_on_deps_count"`
RunningCount int `json:"running_count"`
CompletedCount int `json:"completed_count"`
}
type QueueInfo struct {
2023-10-30 21:49:48 +00:00
Pending []PendingInformation `json:"pending,omitempty"`
WaitingOnDeps string `json:"-"` // dont need those
2023-10-30 21:49:48 +00:00
Running int `json:"running,omitempty"`
Stats Stats `json:"stats"`
Paused bool `json:"paused"`
}