oficina / equipo Public

Clone
git clone https://amadan.net/oficina/equipo

Plain git — no account needed to clone.

Download

Download this file

1package equipo
2
3import (
4 "time"
5
6 "amadan.net/oficina/equipo/internal/equipo/team"
7 "amadan.net/oficina/equipo/internal/runnerproto"
8)
9
10type Scope = team.Scope
11type ClaimRequest = runnerproto.ClaimRequest
12type RunnerRequest = runnerproto.RunnerRequest
13
14type Assignment = runnerproto.Assignment
15type RunnerBrief = runnerproto.RunnerBrief
16type ClaimResponse = runnerproto.ClaimResponse
17type runnerAssignment struct {
18 ProtocolVersion int `gorm:"not null;default:1"`
19 ID string `gorm:"primaryKey"`
20 TaskID string `gorm:"uniqueIndex:runner_assignment_step"`
21 StepKey string `gorm:"uniqueIndex:runner_assignment_step"`
22 WorkspaceKey, TeamID, RunnerID, Person, Selection, Isolation, Kind, State string
23 Revision int64 `gorm:"uniqueIndex:runner_assignment_step"`
24 JobID, AttemptID, Fence int64
25 ClaimRequest, Brief string
26 LeaseDeadline time.Time
27 InvalidationID int64
28}
29
30func (runnerAssignment) TableName() string { return "runner_assignments" }
31
32type runnerCleanup struct {
33 ID string `gorm:"primaryKey"`
34 AssignmentID, RunnerID, Person, MachineKeyHash, InstanceID, Audience string
35 TokenHash string `gorm:"uniqueIndex:runner_cleanup_token"`
36 Fence, AttemptID int64
37 ExpiresAt time.Time
38}
39
40func (runnerCleanup) TableName() string { return "runner_cleanups" }
41
42type runnerObservation struct {
43 AssignmentID string `gorm:"primaryKey"`
44 RequestID string `gorm:"primaryKey"`
45 Operation, PayloadHash, Payload string
46 At time.Time
47}
48
49func (runnerObservation) TableName() string { return "runner_observations" }
50
51type runnerRotation struct {
52 RunnerID string `gorm:"primaryKey"`
53 AssignmentID, RequestID, State, CredentialID string
54}
55
56func (runnerRotation) TableName() string { return "runner_rotations" }
57
58type executionAdmissionTicket struct {
59 ActionID int64 `gorm:"primaryKey;autoIncrement:false"`
60 JobID int64 `gorm:"not null"`
61 RequestID string `gorm:"not null"`
62 AttemptID int64 `gorm:"not null"`
63 Fence int64 `gorm:"not null"`
64 Runner, Dispatch, ExpiresAt string `gorm:"not null"`
65 Incarnation int64 `gorm:"not null"`
66}
67
68func (executionAdmissionTicket) TableName() string { return "admission_tickets" }
69
70type RunnerValidators = runnerproto.Validators
71
72// SetRunnerValidators is a startup-only dependency injection seam.
73func (e *Execution) SetRunnerValidators(v RunnerValidators) { e.validators = v }
74
75type CredentialRotation = runnerproto.CredentialRotation
76