Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetRVBLabels ¶
func HasRVBLabels ¶
Types ¶
type Builder ¶
type Builder struct {
ID int64 `bun:",pk,autoincrement" json:"id"`
Name string `bun:",unique"`
Sponsor string
Token string `bun:",type:text" json:"token"`
Meta map[string]string
Labels []string
Type BuilderType
Status BuilderStatus
FailedCount int
TaskID int64 `bun:"task_id"`
CreatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp" json:"created_at"`
UpdatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp" json:"updated_at"`
}
func (*Builder) AfterCreateTable ¶
type BuilderStatus ¶
type BuilderStatus string
const ( BuilderIdle BuilderStatus = "idle" BuilderLocked BuilderStatus = "locked" BuilderPreparing BuilderStatus = "preparing" BuilderWorking BuilderStatus = "working" BuilderDied BuilderStatus = "died" BuilderQuarantined BuilderStatus = "quarantined" )
type BuilderType ¶
type BuilderType string
const ( BuilderSSH BuilderType = "ssh" BuilderPodman BuilderType = "podman" )
type GithubInstall ¶
type GithubInstall struct {
}
type GithubWorkflowJob ¶
type GithubWorkflowJob struct {
ID int64 `bun:"id,pk" json:"id"`
RunID int64 `bun:",notnull" json:"run_id"`
HeadSHA string `bun:",notnull" json:"head_sha"`
Name string `json:"name"`
Status GithubWorkflowJobStatus `json:"status"`
// Runner related
Labels []string `json:"labels"`
RunnerID int64 `json:"runner_id"`
RunnerName string `json:"runner_name"`
WorkflowName string `json:"workflow_name"`
// Repo
Owner string `json:"owner"`
RepoID int64 `bun:",notnull" json:"repo_id"`
RepoName string `json:"repo_name"`
// Install
InstallationID int64 `json:"installation_id"`
CreatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp" json:"created_at"`
UpdatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp" json:"updated_at"`
}
func (*GithubWorkflowJob) AfterCreateTable ¶
func (*GithubWorkflowJob) AfterCreateTable(ctx context.Context, query *bun.CreateTableQuery) error
func (*GithubWorkflowJob) BeforeAppendModel ¶
func (*GithubWorkflowJob) IsStatusChangable ¶
func (g *GithubWorkflowJob) IsStatusChangable(ns GithubWorkflowJobStatus) bool
type GithubWorkflowJobStatus ¶
type GithubWorkflowJobStatus string
const ( WorkflowJobQueued GithubWorkflowJobStatus = "queued" WorkflowJobInProgress GithubWorkflowJobStatus = "in_progress" WorkflowJobCompleted GithubWorkflowJobStatus = "completed" WorkflowWaiting GithubWorkflowJobStatus = "waiting" WorkflowRequested GithubWorkflowJobStatus = "requested" WorkflowPending GithubWorkflowJobStatus = "pending" WorkflowJobScheduled = "scheduled" // rvb status WorkflowJobTimeout = "timeout" // rvb status WorkflowJobFailed = "failed" // rvb status )
type Task ¶
type Task struct {
ID int64 `bun:",pk,autoincrement" json:"id"`
Builder *Builder `bun:"rel:belongs-to,join:builder_id=id" json:"-"`
BuilderID int64 `bun:"builder_id" json:"builder_id"`
Job *GithubWorkflowJob `bun:"rel:belongs-to,join:job_id=id" json:"-"`
JobID int64 `bun:"job_id,unique" json:"job_id"`
Name string
Labels []string
SystemLabels []string
URL string `bun:",type:text"`
Ephemeral bool
Status TaskStatus
CreatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp" json:"created_at"`
UpdatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp" json:"updated_at"`
QueuedAt time.Time `bun:"queued_at,nullzero,notnull,default:current_timestamp"`
DeadLine time.Time `bun:"deadline,nullzero,notnull" json:"deadline"`
}
func (*Task) AfterCreateTable ¶
type TaskStatus ¶
type TaskStatus string
const ( TaskPending TaskStatus = "pending" TaskBuilderAssigned TaskStatus = "builder_assigned" TaskBuilderPreparing TaskStatus = "builder_preparing" TaskBuilderReady TaskStatus = "builder_ready" TaskInProgress TaskStatus = "in_progress" TaskCompleted TaskStatus = "completed" TaskTimeout TaskStatus = "timeout" TaskFailed TaskStatus = "failed" )
type Token ¶
type Token struct {
ID int64 `bun:"id,pk,autoincrement"`
Type TokenType
Key string
Value string `bun:",text"`
CreatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp" json:"created_at"`
UpdatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp" json:"updated_at"`
ExpiredAt time.Time `bun:",nullzero,notnull" json:"expired_at"`
}
func (*Token) AfterCreateTable ¶
Click to show internal directories.
Click to hide internal directories.