databasus--databasus
75f3dd141c
CodeQL / Analyze (go) (push) Has been cancelled
CodeQL / Analyze (actions) (push) Has been cancelled
CodeQL / Analyze (javascript-typescript) (push) Has been cancelled
CI and Release / lint-frontend (push) Has been cancelled
CI and Release / dockerfile-scan (push) Has been cancelled
CI and Release / test-frontend (push) Has been cancelled
CI and Release / lint-verification-agent (push) Has been cancelled
CI and Release / test-verification-agent (push) Has been cancelled
CI and Release / e2e-verification-agent (push) Has been cancelled
CI and Release / test-backend (push) Has been cancelled
CI and Release / build-dev-image (push) Has been cancelled
CI and Release / push-dev-image (push) Has been cancelled
CI and Release / build-image (push) Has been cancelled
CI and Release / build-verification-image (push) Has been cancelled
CI and Release / determine-version (push) Has been cancelled
CI and Release / push-image (push) Has been cancelled
CI and Release / push-verification-image (12) (push) Has been cancelled
CI and Release / lint-backend (push) Has been cancelled
CI and Release / push-verification-image (17) (push) Has been cancelled
CI and Release / push-verification-image (18) (push) Has been cancelled
CI and Release / release (push) Has been cancelled
CI and Release / publish-helm-chart (push) Has been cancelled
CI and Release / push-verification-image (13) (push) Has been cancelled
CI and Release / push-verification-image (14) (push) Has been cancelled
CI and Release / push-verification-image (15) (push) Has been cancelled
CI and Release / push-verification-image (16) (push) Has been cancelled
45 行
1.1 KiB
Go
45 行
1.1 KiB
Go
package verification_agents
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/google/uuid"
|
|
)
|
|
|
|
type CreateAgentRequest struct {
|
|
Name string `json:"name" binding:"required,min=1,max=200"`
|
|
}
|
|
|
|
type CreatedAgentResponse struct {
|
|
Agent *Agent `json:"agent"`
|
|
Token string `json:"token"`
|
|
}
|
|
|
|
type RotateTokenResponse struct {
|
|
Token string `json:"token"`
|
|
}
|
|
|
|
type AvailabilityResponse struct {
|
|
Count int64 `json:"count"`
|
|
HasAgents bool `json:"hasAgents"`
|
|
}
|
|
|
|
type HeartbeatRequest struct {
|
|
MaxCPU int `json:"maxCpu" binding:"min=0"`
|
|
MaxRAMGb int `json:"maxRamGb" binding:"min=0"`
|
|
MaxDiskGb int `json:"maxDiskGb" binding:"min=0"`
|
|
MaxConcurrentJobs int `json:"maxConcurrentJobs" binding:"min=0"`
|
|
|
|
// What the agent thinks it's running. Server returns the
|
|
// subset to abort if some information is outdated
|
|
CurrentVerificationIDs []uuid.UUID `json:"currentVerificationIds"`
|
|
}
|
|
|
|
type HeartbeatResponse struct {
|
|
LastSeenAt time.Time `json:"lastSeenAt"`
|
|
|
|
// IDs that vanished, were flipped to CANCELED or are no longer owned
|
|
// by this agent. So it needs to drop them.
|
|
AbortVerificationIDs []uuid.UUID `json:"abortVerificationIds"`
|
|
}
|