robot-control-manager/modules/utils/globals.go

57 lines
1.3 KiB
Go

package utils
import "time"
const (
RobotPingRetries = 3
RobotPingHandlerInterval = 5 // seconds
RobotFreeUpJobInterval = 5 * time.Minute
RobotsPageLimit = 5
RobotsPermitJoinAutoDisable = 120 // seconds
UnauthorizedRobotsPageLimit = 5
minRobotNameLength = "2"
maxRobotNameLength = "30"
maxJobNameLength = "30"
)
const (
RobotStatusIdle = 1
RobotStatusRunning = 2
RobotStatusConnecting = 3
RobotStatusError = 4
RobotStatusOffline = 5
RobotStatusWaiting = 6
)
const (
RobotTypeRex = 1
RobotTypeYeet = 2
)
const (
ResponseStatusOk = 0
ResponseStatusError = 1
ResponseStatusOffline = 2
)
const (
SSESentCmdUpdateRobotStatus = 1
SSESentCmdAddUnauthorizedRobot = 2
SSESentCmdAddRobot = 3
SSESentCmdRemoveUnauthorizedRobot = 4
SSESentCmdRemoveRobot = 5
SSESentCmdRobotUpdated = 6
SSESentCmdUpdateRobotCurrentJob = 7
SSESentCmdUpdateRobotJobsWaitingCount = 8
SSESentCmdPermitJoinUpdated = 9
)
var (
generalRules = map[string]string{
"RobotName": "required,min=" + minRobotNameLength + ",max=" + maxRobotNameLength,
"Type": "required,numeric",
"JobName": "required,max=" + maxJobNameLength,
}
)