Documentation
¶
Index ¶
- func Connect(ctx context.Context, connString string) (*pgxpool.Pool, error)
- func MigrateTo(pool *pgxpool.Pool, version int64) error
- type Batch
- type BatchState
- type CheckState
- type CheckStatus
- type CountQueuePositionParams
- type CreateBatchParams
- type DBTX
- type DequeuePRParams
- type EnqueuePRParams
- type EntryState
- type GetHeadOfQueueParams
- type GetLiveBatchParams
- type GetOrCreateRepoParams
- type GetQueueEntryParams
- type ListQueueParams
- type LoadActiveQueuesRow
- type NullBatchState
- type NullCheckState
- type NullEntryState
- type Queries
- func (q *Queries) CancelBatchesByRepo(ctx context.Context, repoID int64) error
- func (q *Queries) ClearCheckStatuses(ctx context.Context, ids []int64) error
- func (q *Queries) ClearEntryMergeBranch(ctx context.Context, ids []int64) error
- func (q *Queries) CountQueuePosition(ctx context.Context, arg CountQueuePositionParams) (int64, error)
- func (q *Queries) CreateBatch(ctx context.Context, arg CreateBatchParams) (Batch, error)
- func (q *Queries) DeleteEntriesByIDs(ctx context.Context, ids []int64) error
- func (q *Queries) DequeueAllByRepo(ctx context.Context, repoID int64) error
- func (q *Queries) DequeuePR(ctx context.Context, arg DequeuePRParams) error
- func (q *Queries) EnqueuePR(ctx context.Context, arg EnqueuePRParams) (QueueEntry, error)
- func (q *Queries) GetBatch(ctx context.Context, id int64) (Batch, error)
- func (q *Queries) GetCheckStatuses(ctx context.Context, queueEntryID int64) ([]CheckStatus, error)
- func (q *Queries) GetEntriesByIDs(ctx context.Context, ids []int64) ([]QueueEntry, error)
- func (q *Queries) GetHeadOfQueue(ctx context.Context, arg GetHeadOfQueueParams) (QueueEntry, error)
- func (q *Queries) GetLiveBatch(ctx context.Context, arg GetLiveBatchParams) (Batch, error)
- func (q *Queries) GetOrCreateRepo(ctx context.Context, arg GetOrCreateRepoParams) (Repo, error)
- func (q *Queries) GetQueueEntry(ctx context.Context, arg GetQueueEntryParams) (QueueEntry, error)
- func (q *Queries) ListActiveEntriesByRepo(ctx context.Context, repoID int64) ([]QueueEntry, error)
- func (q *Queries) ListLiveBatchesByRepo(ctx context.Context, repoID int64) ([]Batch, error)
- func (q *Queries) ListQueue(ctx context.Context, arg ListQueueParams) ([]QueueEntry, error)
- func (q *Queries) LoadActiveQueues(ctx context.Context) ([]LoadActiveQueuesRow, error)
- func (q *Queries) SaveBatch(ctx context.Context, arg SaveBatchParams) (Batch, error)
- func (q *Queries) SaveCheckStatus(ctx context.Context, arg SaveCheckStatusParams) error
- func (q *Queries) SetEntryActiveBatch(ctx context.Context, arg SetEntryActiveBatchParams) error
- func (q *Queries) TakeQueuedHead(ctx context.Context, arg TakeQueuedHeadParams) ([]QueueEntry, error)
- func (q *Queries) UpdateEntryError(ctx context.Context, arg UpdateEntryErrorParams) error
- func (q *Queries) UpdateEntryMergeBranch(ctx context.Context, arg UpdateEntryMergeBranchParams) error
- func (q *Queries) UpdateEntryState(ctx context.Context, arg UpdateEntryStateParams) error
- func (q *Queries) WithTx(tx pgx.Tx) *Queries
- type QueueEntry
- type Repo
- type SaveBatchParams
- type SaveCheckStatusParams
- type SetEntryActiveBatchParams
- type TakeQueuedHeadParams
- type UpdateEntryErrorParams
- type UpdateEntryMergeBranchParams
- type UpdateEntryStateParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Batch ¶
type Batch struct {
ID int64 `json:"id"`
RepoID int64 `json:"repo_id"`
TargetBranch string `json:"target_branch"`
State BatchState `json:"state"`
MemberIds []int64 `json:"member_ids"`
CurrentIds []int64 `json:"current_ids"`
Pending []byte `json:"pending"`
LandedIds []int64 `json:"landed_ids"`
EjectedIds []int64 `json:"ejected_ids"`
BranchName pgtype.Text `json:"branch_name"`
BranchSha pgtype.Text `json:"branch_sha"`
Builds int32 `json:"builds"`
FfRetries int32 `json:"ff_retries"`
Flaky bool `json:"flaky"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
TestingStartedAt pgtype.Timestamptz `json:"testing_started_at"`
}
type BatchState ¶
type BatchState string
const ( BatchStateForming BatchState = "forming" BatchStateTesting BatchState = "testing" BatchStateDone BatchState = "done" BatchStateCancelled BatchState = "cancelled" )
func (*BatchState) Scan ¶
func (e *BatchState) Scan(src interface{}) error
type CheckState ¶
type CheckState string
const ( CheckStatePending CheckState = "pending" CheckStateSuccess CheckState = "success" CheckStateFailure CheckState = "failure" CheckStateError CheckState = "error" )
func (*CheckState) Scan ¶
func (e *CheckState) Scan(src interface{}) error
type CheckStatus ¶
type CheckStatus struct {
ID int64 `json:"id"`
QueueEntryID int64 `json:"queue_entry_id"`
Context string `json:"context"`
State CheckState `json:"state"`
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
TargetUrl string `json:"target_url"`
}
type CreateBatchParams ¶
type DequeuePRParams ¶
type EnqueuePRParams ¶
type EntryState ¶
type EntryState string
const ( EntryStateQueued EntryState = "queued" EntryStateTesting EntryState = "testing" EntryStateSuccess EntryState = "success" EntryStateFailed EntryState = "failed" EntryStateCancelled EntryState = "cancelled" )
func (*EntryState) Scan ¶
func (e *EntryState) Scan(src interface{}) error
type GetHeadOfQueueParams ¶
type GetLiveBatchParams ¶
type GetOrCreateRepoParams ¶
type GetQueueEntryParams ¶
type ListQueueParams ¶
type LoadActiveQueuesRow ¶
type LoadActiveQueuesRow struct {
ID int64 `json:"id"`
RepoID int64 `json:"repo_id"`
PrNumber int64 `json:"pr_number"`
PrHeadSha string `json:"pr_head_sha"`
TargetBranch string `json:"target_branch"`
State EntryState `json:"state"`
EnqueuedAt pgtype.Timestamptz `json:"enqueued_at"`
TestingStartedAt pgtype.Timestamptz `json:"testing_started_at"`
CompletedAt pgtype.Timestamptz `json:"completed_at"`
MergeBranchName pgtype.Text `json:"merge_branch_name"`
MergeBranchSha pgtype.Text `json:"merge_branch_sha"`
ErrorMessage pgtype.Text `json:"error_message"`
ActiveBatchID pgtype.Int8 `json:"active_batch_id"`
Forge string `json:"forge"`
Owner string `json:"owner"`
RepoName string `json:"repo_name"`
}
type NullBatchState ¶
type NullBatchState struct {
BatchState BatchState `json:"batch_state"`
Valid bool `json:"valid"` // Valid is true if BatchState is not NULL
}
func (*NullBatchState) Scan ¶
func (ns *NullBatchState) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullCheckState ¶
type NullCheckState struct {
CheckState CheckState `json:"check_state"`
Valid bool `json:"valid"` // Valid is true if CheckState is not NULL
}
func (*NullCheckState) Scan ¶
func (ns *NullCheckState) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullEntryState ¶
type NullEntryState struct {
EntryState EntryState `json:"entry_state"`
Valid bool `json:"valid"` // Valid is true if EntryState is not NULL
}
func (*NullEntryState) Scan ¶
func (ns *NullEntryState) Scan(value interface{}) error
Scan implements the Scanner interface.
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func (*Queries) CancelBatchesByRepo ¶
func (*Queries) ClearCheckStatuses ¶
func (*Queries) ClearEntryMergeBranch ¶
func (*Queries) CountQueuePosition ¶
func (*Queries) CreateBatch ¶
func (*Queries) DeleteEntriesByIDs ¶
func (*Queries) DequeueAllByRepo ¶
func (*Queries) DequeuePR ¶
func (q *Queries) DequeuePR(ctx context.Context, arg DequeuePRParams) error
func (*Queries) EnqueuePR ¶
func (q *Queries) EnqueuePR(ctx context.Context, arg EnqueuePRParams) (QueueEntry, error)
func (*Queries) GetCheckStatuses ¶
func (*Queries) GetEntriesByIDs ¶
func (*Queries) GetHeadOfQueue ¶
func (q *Queries) GetHeadOfQueue(ctx context.Context, arg GetHeadOfQueueParams) (QueueEntry, error)
func (*Queries) GetLiveBatch ¶
func (*Queries) GetOrCreateRepo ¶
func (*Queries) GetQueueEntry ¶
func (q *Queries) GetQueueEntry(ctx context.Context, arg GetQueueEntryParams) (QueueEntry, error)
func (*Queries) ListActiveEntriesByRepo ¶
func (*Queries) ListLiveBatchesByRepo ¶
func (*Queries) ListQueue ¶
func (q *Queries) ListQueue(ctx context.Context, arg ListQueueParams) ([]QueueEntry, error)
func (*Queries) LoadActiveQueues ¶
func (q *Queries) LoadActiveQueues(ctx context.Context) ([]LoadActiveQueuesRow, error)
func (*Queries) SaveCheckStatus ¶
func (q *Queries) SaveCheckStatus(ctx context.Context, arg SaveCheckStatusParams) error
func (*Queries) SetEntryActiveBatch ¶
func (q *Queries) SetEntryActiveBatch(ctx context.Context, arg SetEntryActiveBatchParams) error
func (*Queries) TakeQueuedHead ¶
func (q *Queries) TakeQueuedHead(ctx context.Context, arg TakeQueuedHeadParams) ([]QueueEntry, error)
func (*Queries) UpdateEntryError ¶
func (q *Queries) UpdateEntryError(ctx context.Context, arg UpdateEntryErrorParams) error
func (*Queries) UpdateEntryMergeBranch ¶
func (q *Queries) UpdateEntryMergeBranch(ctx context.Context, arg UpdateEntryMergeBranchParams) error
func (*Queries) UpdateEntryState ¶
func (q *Queries) UpdateEntryState(ctx context.Context, arg UpdateEntryStateParams) error
type QueueEntry ¶
type QueueEntry struct {
ID int64 `json:"id"`
RepoID int64 `json:"repo_id"`
PrNumber int64 `json:"pr_number"`
PrHeadSha string `json:"pr_head_sha"`
TargetBranch string `json:"target_branch"`
State EntryState `json:"state"`
EnqueuedAt pgtype.Timestamptz `json:"enqueued_at"`
TestingStartedAt pgtype.Timestamptz `json:"testing_started_at"`
CompletedAt pgtype.Timestamptz `json:"completed_at"`
MergeBranchName pgtype.Text `json:"merge_branch_name"`
MergeBranchSha pgtype.Text `json:"merge_branch_sha"`
ErrorMessage pgtype.Text `json:"error_message"`
ActiveBatchID pgtype.Int8 `json:"active_batch_id"`
}
type SaveBatchParams ¶
type SaveBatchParams struct {
ID int64 `json:"id"`
State BatchState `json:"state"`
CurrentIds []int64 `json:"current_ids"`
Pending []byte `json:"pending"`
LandedIds []int64 `json:"landed_ids"`
EjectedIds []int64 `json:"ejected_ids"`
BranchName pgtype.Text `json:"branch_name"`
BranchSha pgtype.Text `json:"branch_sha"`
Builds int32 `json:"builds"`
FfRetries int32 `json:"ff_retries"`
Flaky bool `json:"flaky"`
TestingStartedAt pgtype.Timestamptz `json:"testing_started_at"`
}
type SaveCheckStatusParams ¶
type SaveCheckStatusParams struct {
QueueEntryID int64 `json:"queue_entry_id"`
Context string `json:"context"`
State CheckState `json:"state"`
TargetUrl string `json:"target_url"`
}
type TakeQueuedHeadParams ¶
type UpdateEntryErrorParams ¶
type UpdateEntryStateParams ¶
type UpdateEntryStateParams struct {
State EntryState `json:"state"`
RepoID int64 `json:"repo_id"`
PrNumber int64 `json:"pr_number"`
}
Click to show internal directories.
Click to hide internal directories.