mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2026-04-28 11:37:26 +02:00
37 lines
1.3 KiB
Go
37 lines
1.3 KiB
Go
// Copyright 2021 Woodpecker Authors
|
|
//
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
// you may not use this file except in compliance with the License.
|
|
// You may obtain a copy of the License at
|
|
//
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
//
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
// See the License for the specific language governing permissions and
|
|
// limitations under the License.
|
|
|
|
package model
|
|
|
|
// QueueTask represents a task in the queue with additional API-specific fields.
|
|
type QueueTask struct {
|
|
Task
|
|
PipelineNumber int64 `json:"pipeline_number"`
|
|
AgentName string `json:"agent_name"`
|
|
}
|
|
|
|
// QueueInfo represents the response structure for queue information API.
|
|
type QueueInfo struct {
|
|
Pending []QueueTask `json:"pending"`
|
|
WaitingOnDeps []QueueTask `json:"waiting_on_deps"`
|
|
Running []QueueTask `json:"running"`
|
|
Stats struct {
|
|
WorkerCount int `json:"worker_count"`
|
|
PendingCount int `json:"pending_count"`
|
|
WaitingOnDepsCount int `json:"waiting_on_deps_count"`
|
|
RunningCount int `json:"running_count"`
|
|
} `json:"stats"`
|
|
Paused bool `json:"paused"`
|
|
} // @name QueueInfo
|