82 lines
1.8 KiB
Go
82 lines
1.8 KiB
Go
package models
|
|
|
|
const (
|
|
QUEUE_OPEN = 1
|
|
QUEUE_CLOSE = 2
|
|
QUEUE_INACT = 3
|
|
QUEUE_ACT = 4
|
|
)
|
|
|
|
var SupportedQueueActions = []string{"open", "close", "deactive", "active"}
|
|
|
|
var ActionMap = map[string]int{
|
|
"close": QUEUE_CLOSE,
|
|
"open": QUEUE_OPEN,
|
|
"active": QUEUE_ACT,
|
|
"deactive": QUEUE_INACT,
|
|
}
|
|
|
|
// queues info query supported filter
|
|
var QUEUE_SUPPORT_FILTERS = []string{
|
|
"queue_name",
|
|
"priority",
|
|
"description",
|
|
"num_pend",
|
|
"num_run",
|
|
"num_ssusp",
|
|
"num_ususp",
|
|
"num_done",
|
|
}
|
|
|
|
var QUEUE_SUPPORT_SORT = []string{
|
|
"queue_name",
|
|
}
|
|
var QUEUESTAT = map[string]int{
|
|
"OPEN": 0x00,
|
|
"CLOSED": 0x01,
|
|
"INACTIVE_WIN": 0x02,
|
|
"INACTIVE_ADM": 0x04,
|
|
"NOPERM": 0x08,
|
|
"DISC": 0x10,
|
|
"FAIRSHARE_DEFAULT": 0x20,
|
|
}
|
|
|
|
// JSONBFields contains the list of fields that are in JSONB format
|
|
var JSONBQFields = []string{"fs_info"}
|
|
|
|
var QUEUE_DEFAULT_COLUMN = []string{
|
|
"queue_name",
|
|
"queue_status",
|
|
"priority",
|
|
"description",
|
|
"num_pend",
|
|
"num_run",
|
|
"num_ssusp",
|
|
"num_ususp",
|
|
"num_done",
|
|
"fs_info",
|
|
}
|
|
|
|
type QueueInfo struct {
|
|
QueueName string `json:"queue_name"`
|
|
QueueStatus int `json:"queue_status"`
|
|
Priority int `json:"priority"`
|
|
Description string `json:"description"`
|
|
NumPend int `json:"num_pend"`
|
|
NumRun int `json:"num_run"`
|
|
NumSSusp int `json:"num_ssusp"`
|
|
NumUSusp int `json:"num_ususp"`
|
|
NumDone int `json:"num_done"`
|
|
FSInfo string `json:"fs_info"` // JSONB
|
|
}
|
|
|
|
type QueueControlRequest struct {
|
|
ControlAction string `json:"action" binding:"required"`
|
|
QueueName []string `json:"queue_name" binding:"required"`
|
|
Comment string `json:"comment"`
|
|
}
|
|
|
|
type QueueControlEvent struct {
|
|
Queuename string `json:"queue_name" binding:"required"`
|
|
Comment string `json:"comment,omitempty"`
|
|
}
|