Documentation
¶
Index ¶
- type AuthAuditLog
- type AuthThrottle
- type BranchProtectionRule
- type CheckConclusion
- type CheckRun
- type CheckStatus
- type CheckSuite
- type CodeSearchContent
- type CodeSearchPath
- type CollabRole
- type CreateForkRepoParams
- type CreateRepoParams
- type DBTX
- type DeleteRedirectByUserOwnerOldNameParams
- type DomainEvent
- type DomainEventsProcessed
- type EmailVerification
- type ExistsRepoForOwnerOrgParams
- type ExistsRepoForOwnerUserParams
- type GetRepoByOwnerOrgAndNameParams
- type GetRepoByOwnerUserAndNameParams
- type GetRepoOwnerUsernameByIDRow
- type InsertRepoRedirectParams
- type InsertRepoTopicParams
- type InsertTransferRequestParams
- type Issue
- type IssueAssignee
- type IssueComment
- type IssueEvent
- type IssueKind
- type IssueLabel
- type IssueRefSource
- type IssueReference
- type IssueState
- type IssueStateReason
- type IssuesSearch
- type Job
- type Label
- type ListAllRepoFullNamesRow
- type ListForksOfRepoForRepackRow
- type ListForksOfRepoParams
- type ListForksOfRepoRow
- type ListReposNeedingReindexRow
- type ListSoftDeletedReposForOwnerRow
- type LookupRedirectByUserOwnerParams
- type Meta
- type Milestone
- type MilestoneState
- type Notification
- type NotificationEmailLog
- type NotificationThread
- type NotificationThreadKind
- type NullCheckConclusion
- type NullCheckStatus
- type NullCollabRole
- type NullIssueKind
- type NullIssueRefSource
- type NullIssueState
- type NullIssueStateReason
- type NullMilestoneState
- type NullNotificationThreadKind
- type NullOrgPlan
- type NullOrgRole
- type NullPrFileStatus
- type NullPrMergeMethod
- type NullPrMergeableState
- type NullPrReviewSide
- type NullPrReviewState
- type NullPrincipalKind
- type NullRepoInitStatus
- type NullRepoVisibility
- type NullTeamPrivacy
- type NullTeamRepoRole
- type NullTeamRole
- type NullTransactionalEmailStatus
- type NullTransferPrincipalKind
- type NullTransferStatus
- type NullWatchLevel
- type NullWebhookContentType
- type NullWebhookDeliveryStatus
- type NullWebhookOwnerKind
- type Org
- type OrgInvitation
- type OrgMember
- type OrgPlan
- type OrgRole
- type PasswordReset
- type PrFileStatus
- type PrMergeMethod
- type PrMergeableState
- type PrReview
- type PrReviewComment
- type PrReviewRequest
- type PrReviewSide
- type PrReviewState
- type Principal
- type PrincipalKind
- type PullRequest
- type PullRequestCommit
- type PullRequestFile
- type PushEvent
- type Querier
- type Queries
- func (q *Queries) AcceptTransferRequest(ctx context.Context, db DBTX, id int64) error
- func (q *Queries) ArchiveRepo(ctx context.Context, db DBTX, id int64) error
- func (q *Queries) CancelTransferRequest(ctx context.Context, db DBTX, id int64) error
- func (q *Queries) CountForksOfRepo(ctx context.Context, db DBTX, forkOfRepoID pgtype.Int8) (int64, error)
- func (q *Queries) CountRecentRedirectsForRepo(ctx context.Context, db DBTX, repoID int64) (int32, error)
- func (q *Queries) CountReposForOwnerUser(ctx context.Context, db DBTX, ownerUserID pgtype.Int8) (int64, error)
- func (q *Queries) CreateForkRepo(ctx context.Context, db DBTX, arg CreateForkRepoParams) (Repo, error)
- func (q *Queries) CreateRepo(ctx context.Context, db DBTX, arg CreateRepoParams) (Repo, error)
- func (q *Queries) DeclineTransferRequest(ctx context.Context, db DBTX, id int64) error
- func (q *Queries) DeleteBranchProtectionRule(ctx context.Context, db DBTX, id int64) error
- func (q *Queries) DeleteRedirectByUserOwnerOldName(ctx context.Context, db DBTX, arg DeleteRedirectByUserOwnerOldNameParams) error
- func (q *Queries) DeleteRedirectsForRepo(ctx context.Context, db DBTX, repoID int64) error
- func (q *Queries) ExistsRepoForOwnerOrg(ctx context.Context, db DBTX, arg ExistsRepoForOwnerOrgParams) (bool, error)
- func (q *Queries) ExistsRepoForOwnerUser(ctx context.Context, db DBTX, arg ExistsRepoForOwnerUserParams) (bool, error)
- func (q *Queries) ExpirePendingTransfers(ctx context.Context, db DBTX) (int64, error)
- func (q *Queries) GetBranchProtectionRule(ctx context.Context, db DBTX, id int64) (BranchProtectionRule, error)
- func (q *Queries) GetRepoByID(ctx context.Context, db DBTX, id int64) (Repo, error)
- func (q *Queries) GetRepoByOwnerOrgAndName(ctx context.Context, db DBTX, arg GetRepoByOwnerOrgAndNameParams) (Repo, error)
- func (q *Queries) GetRepoByOwnerUserAndName(ctx context.Context, db DBTX, arg GetRepoByOwnerUserAndNameParams) (Repo, error)
- func (q *Queries) GetRepoOwnerUsernameByID(ctx context.Context, db DBTX, id int64) (GetRepoOwnerUsernameByIDRow, error)
- func (q *Queries) GetTransferRequest(ctx context.Context, db DBTX, id int64) (RepoTransferRequest, error)
- func (q *Queries) HardDeleteRepo(ctx context.Context, db DBTX, id int64) error
- func (q *Queries) InsertRepoRedirect(ctx context.Context, db DBTX, arg InsertRepoRedirectParams) error
- func (q *Queries) InsertRepoTopic(ctx context.Context, db DBTX, arg InsertRepoTopicParams) error
- func (q *Queries) InsertTransferRequest(ctx context.Context, db DBTX, arg InsertTransferRequestParams) (RepoTransferRequest, error)
- func (q *Queries) ListAllRepoFullNames(ctx context.Context, db DBTX) ([]ListAllRepoFullNamesRow, error)
- func (q *Queries) ListBranchProtectionRules(ctx context.Context, db DBTX, repoID int64) ([]BranchProtectionRule, error)
- func (q *Queries) ListForksOfRepo(ctx context.Context, db DBTX, arg ListForksOfRepoParams) ([]ListForksOfRepoRow, error)
- func (q *Queries) ListForksOfRepoForRepack(ctx context.Context, db DBTX, forkOfRepoID pgtype.Int8) ([]ListForksOfRepoForRepackRow, error)
- func (q *Queries) ListPendingTransfersForUser(ctx context.Context, db DBTX, toPrincipalID int64) ([]RepoTransferRequest, error)
- func (q *Queries) ListRepoIDsPastSoftDeleteGrace(ctx context.Context, db DBTX) ([]int64, error)
- func (q *Queries) ListRepoTopics(ctx context.Context, db DBTX, repoID int64) ([]string, error)
- func (q *Queries) ListReposForOwnerOrg(ctx context.Context, db DBTX, ownerOrgID pgtype.Int8) ([]Repo, error)
- func (q *Queries) ListReposForOwnerUser(ctx context.Context, db DBTX, ownerUserID pgtype.Int8) ([]Repo, error)
- func (q *Queries) ListReposNeedingReindex(ctx context.Context, db DBTX, limit int32) ([]ListReposNeedingReindexRow, error)
- func (q *Queries) ListSoftDeletedReposForOwner(ctx context.Context, db DBTX, ownerUserID pgtype.Int8) ([]ListSoftDeletedReposForOwnerRow, error)
- func (q *Queries) ListTransfersForRepo(ctx context.Context, db DBTX, repoID int64) ([]RepoTransferRequest, error)
- func (q *Queries) LookupRedirectByUserOwner(ctx context.Context, db DBTX, arg LookupRedirectByUserOwnerParams) (int64, error)
- func (q *Queries) OrphanForksOf(ctx context.Context, db DBTX, forkOfRepoID pgtype.Int8) (int64, error)
- func (q *Queries) RenameRepo(ctx context.Context, db DBTX, arg RenameRepoParams) error
- func (q *Queries) ReplaceRepoTopics(ctx context.Context, db DBTX, repoID int64) error
- func (q *Queries) RestoreRepo(ctx context.Context, db DBTX, id int64) error
- func (q *Queries) SetLastIndexedOID(ctx context.Context, db DBTX, arg SetLastIndexedOIDParams) error
- func (q *Queries) SetRepoInitStatus(ctx context.Context, db DBTX, arg SetRepoInitStatusParams) error
- func (q *Queries) SetRepoVisibility(ctx context.Context, db DBTX, arg SetRepoVisibilityParams) error
- func (q *Queries) SoftDeleteRepo(ctx context.Context, db DBTX, id int64) error
- func (q *Queries) SoftDeleteRepoLifecycle(ctx context.Context, db DBTX, id int64) error
- func (q *Queries) TransferRepoOwner(ctx context.Context, db DBTX, arg TransferRepoOwnerParams) error
- func (q *Queries) UnarchiveRepo(ctx context.Context, db DBTX, id int64) error
- func (q *Queries) UpdateBranchProtectionCheckSettings(ctx context.Context, db DBTX, arg UpdateBranchProtectionCheckSettingsParams) error
- func (q *Queries) UpdateBranchProtectionReviewSettings(ctx context.Context, db DBTX, arg UpdateBranchProtectionReviewSettingsParams) error
- func (q *Queries) UpdateBranchProtectionRule(ctx context.Context, db DBTX, arg UpdateBranchProtectionRuleParams) error
- func (q *Queries) UpdateRepoDefaultBranch(ctx context.Context, db DBTX, arg UpdateRepoDefaultBranchParams) error
- func (q *Queries) UpdateRepoDefaultBranchOID(ctx context.Context, db DBTX, arg UpdateRepoDefaultBranchOIDParams) error
- func (q *Queries) UpdateRepoDiskUsed(ctx context.Context, db DBTX, arg UpdateRepoDiskUsedParams) error
- func (q *Queries) UpdateRepoGeneralSettings(ctx context.Context, db DBTX, arg UpdateRepoGeneralSettingsParams) error
- func (q *Queries) UpdateRepoMergeSettings(ctx context.Context, db DBTX, arg UpdateRepoMergeSettingsParams) error
- func (q *Queries) UpsertBranchProtectionRule(ctx context.Context, db DBTX, arg UpsertBranchProtectionRuleParams) (int64, error)
- type RateLimit
- type RenameRepoParams
- type Repo
- type RepoCollaborator
- type RepoInitStatus
- type RepoIssueCounter
- type RepoRedirect
- type RepoTopic
- type RepoTransferRequest
- type RepoVisibility
- type ReposSearch
- type SetLastIndexedOIDParams
- type SetRepoInitStatusParams
- type SetRepoVisibilityParams
- type SignupIpThrottle
- type Star
- type Team
- type TeamMember
- type TeamPrivacy
- type TeamRepoAccess
- type TeamRepoRole
- type TeamRole
- type TransactionalEmailLog
- type TransactionalEmailStatus
- type TransferPrincipalKind
- type TransferRepoOwnerParams
- type TransferStatus
- type UpdateBranchProtectionCheckSettingsParams
- type UpdateBranchProtectionReviewSettingsParams
- type UpdateBranchProtectionRuleParams
- type UpdateRepoDefaultBranchOIDParams
- type UpdateRepoDefaultBranchParams
- type UpdateRepoDiskUsedParams
- type UpdateRepoGeneralSettingsParams
- type UpdateRepoMergeSettingsParams
- type UpsertBranchProtectionRuleParams
- type User
- type UserEmail
- type UserNotificationPref
- type UserRecoveryCode
- type UserSshKey
- type UserToken
- type UserTotp
- type UsernameRedirect
- type UsersSearch
- type Watch
- type WatchLevel
- type Webhook
- type WebhookContentType
- type WebhookDelivery
- type WebhookDeliveryStatus
- type WebhookEventsPending
- type WebhookOwnerKind
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthAuditLog ¶
type AuthThrottle ¶
type BranchProtectionRule ¶
type BranchProtectionRule struct {
ID int64
RepoID int64
Pattern string
PreventForcePush bool
PreventDeletion bool
RequirePrForPush bool
AllowedPusherUserIds []int64
RequireSignedCommits bool
StatusChecksRequired []string
CreatedAt pgtype.Timestamptz
UpdatedAt pgtype.Timestamptz
CreatedByUserID pgtype.Int8
RequiredReviewCount int32
DismissStaleReviewsOnPush bool
RequireCodeOwnerReview bool
DismissStaleStatusChecksOnPush bool
}
type CheckConclusion ¶
type CheckConclusion string
const ( CheckConclusionSuccess CheckConclusion = "success" CheckConclusionFailure CheckConclusion = "failure" CheckConclusionNeutral CheckConclusion = "neutral" CheckConclusionCancelled CheckConclusion = "cancelled" CheckConclusionSkipped CheckConclusion = "skipped" CheckConclusionTimedOut CheckConclusion = "timed_out" CheckConclusionActionRequired CheckConclusion = "action_required" CheckConclusionStale CheckConclusion = "stale" )
func (*CheckConclusion) Scan ¶
func (e *CheckConclusion) Scan(src interface{}) error
type CheckRun ¶
type CheckRun struct {
ID int64
SuiteID int64
RepoID int64
HeadSha string
Name string
Status CheckStatus
Conclusion NullCheckConclusion
StartedAt pgtype.Timestamptz
CompletedAt pgtype.Timestamptz
DetailsUrl string
Output []byte
ExternalID pgtype.Text
CreatedAt pgtype.Timestamptz
UpdatedAt pgtype.Timestamptz
}
type CheckStatus ¶
type CheckStatus string
const ( CheckStatusQueued CheckStatus = "queued" CheckStatusInProgress CheckStatus = "in_progress" CheckStatusCompleted CheckStatus = "completed" CheckStatusPending CheckStatus = "pending" )
func (*CheckStatus) Scan ¶
func (e *CheckStatus) Scan(src interface{}) error
type CheckSuite ¶
type CheckSuite struct {
ID int64
RepoID int64
HeadSha string
AppSlug string
Status CheckStatus
Conclusion NullCheckConclusion
CreatedAt pgtype.Timestamptz
UpdatedAt pgtype.Timestamptz
}
type CodeSearchContent ¶
type CodeSearchPath ¶
type CollabRole ¶
type CollabRole string
const ( CollabRoleRead CollabRole = "read" CollabRoleTriage CollabRole = "triage" CollabRoleWrite CollabRole = "write" CollabRoleMaintain CollabRole = "maintain" CollabRoleAdmin CollabRole = "admin" )
func (*CollabRole) Scan ¶
func (e *CollabRole) Scan(src interface{}) error
type CreateForkRepoParams ¶
type CreateRepoParams ¶
type DomainEvent ¶
type DomainEventsProcessed ¶
type DomainEventsProcessed struct {
Consumer string
LastEventID int64
UpdatedAt pgtype.Timestamptz
}
type EmailVerification ¶
type EmailVerification struct {
ID int64
UserEmailID int64
TokenHash []byte
ExpiresAt pgtype.Timestamptz
UsedAt pgtype.Timestamptz
CreatedAt pgtype.Timestamptz
}
type InsertRepoTopicParams ¶
type InsertTransferRequestParams ¶
type InsertTransferRequestParams struct {
RepoID int64
FromUserID int64
ToPrincipalKind TransferPrincipalKind
ToPrincipalID int64
CreatedBy int64
ExpiresAt pgtype.Timestamptz
}
type Issue ¶
type Issue struct {
ID int64
RepoID int64
Number int64
Kind IssueKind
Title string
Body string
BodyHtmlCached pgtype.Text
MdPipelineVersion int32
AuthorUserID pgtype.Int8
State IssueState
StateReason NullIssueStateReason
Locked bool
LockReason pgtype.Text
MilestoneID pgtype.Int8
CreatedAt pgtype.Timestamptz
UpdatedAt pgtype.Timestamptz
EditedAt pgtype.Timestamptz
ClosedAt pgtype.Timestamptz
ClosedByUserID pgtype.Int8
}
type IssueAssignee ¶
type IssueComment ¶
type IssueComment struct {
ID int64
IssueID int64
AuthorUserID pgtype.Int8
Body string
BodyHtmlCached pgtype.Text
MdPipelineVersion int32
CreatedAt pgtype.Timestamptz
UpdatedAt pgtype.Timestamptz
EditedAt pgtype.Timestamptz
}
type IssueEvent ¶
type IssueLabel ¶
type IssueRefSource ¶
type IssueRefSource string
const ( IssueRefSourceCommentBody IssueRefSource = "comment_body" IssueRefSourceIssueBody IssueRefSource = "issue_body" IssueRefSourceCommitMessage IssueRefSource = "commit_message" )
func (*IssueRefSource) Scan ¶
func (e *IssueRefSource) Scan(src interface{}) error
type IssueReference ¶
type IssueReference struct {
ID int64
SourceIssueID pgtype.Int8
TargetIssueID int64
SourceKind IssueRefSource
SourceObjectID pgtype.Int8
CreatedAt pgtype.Timestamptz
}
type IssueState ¶
type IssueState string
const ( IssueStateOpen IssueState = "open" IssueStateClosed IssueState = "closed" )
func (*IssueState) Scan ¶
func (e *IssueState) Scan(src interface{}) error
type IssueStateReason ¶
type IssueStateReason string
const ( IssueStateReasonCompleted IssueStateReason = "completed" IssueStateReasonNotPlanned IssueStateReason = "not_planned" IssueStateReasonReopened IssueStateReason = "reopened" IssueStateReasonDuplicate IssueStateReason = "duplicate" )
func (*IssueStateReason) Scan ¶
func (e *IssueStateReason) Scan(src interface{}) error
type IssuesSearch ¶
type Job ¶
type Job struct {
ID int64
Kind string
Payload []byte
RunAt pgtype.Timestamptz
Attempts int32
MaxAttempts int32
LastError pgtype.Text
LockedBy pgtype.Text
LockedAt pgtype.Timestamptz
CompletedAt pgtype.Timestamptz
FailedAt pgtype.Timestamptz
CreatedAt pgtype.Timestamptz
}
type ListAllRepoFullNamesRow ¶
type ListForksOfRepoParams ¶
type ListForksOfRepoRow ¶
type ListForksOfRepoRow struct {
ID int64
Name string
Description string
Visibility RepoVisibility
CreatedAt pgtype.Timestamptz
StarCount int64
ForkCount int64
InitStatus RepoInitStatus
OwnerUsername string
OwnerDisplayName string
}
type Milestone ¶
type Milestone struct {
ID int64
RepoID int64
Title string
Description string
State MilestoneState
DueOn pgtype.Timestamptz
CreatedAt pgtype.Timestamptz
ClosedAt pgtype.Timestamptz
}
type MilestoneState ¶
type MilestoneState string
const ( MilestoneStateOpen MilestoneState = "open" MilestoneStateClosed MilestoneState = "closed" )
func (*MilestoneState) Scan ¶
func (e *MilestoneState) Scan(src interface{}) error
type Notification ¶
type Notification struct {
ID int64
RecipientUserID int64
Kind string
Reason string
RepoID pgtype.Int8
ThreadKind NullNotificationThreadKind
ThreadID pgtype.Int8
SourceEventID pgtype.Int8
Unread bool
LastEventAt pgtype.Timestamptz
LastActorUserID pgtype.Int8
Summary []byte
CreatedAt pgtype.Timestamptz
UpdatedAt pgtype.Timestamptz
}
type NotificationEmailLog ¶
type NotificationThread ¶
type NotificationThread struct {
RecipientUserID int64
ThreadKind NotificationThreadKind
ThreadID int64
Subscribed bool
Reason string
UpdatedAt pgtype.Timestamptz
}
type NotificationThreadKind ¶
type NotificationThreadKind string
const ( NotificationThreadKindIssue NotificationThreadKind = "issue" NotificationThreadKindPr NotificationThreadKind = "pr" )
func (*NotificationThreadKind) Scan ¶
func (e *NotificationThreadKind) Scan(src interface{}) error
type NullCheckConclusion ¶
type NullCheckConclusion struct {
CheckConclusion CheckConclusion
Valid bool // Valid is true if CheckConclusion is not NULL
}
func (*NullCheckConclusion) Scan ¶
func (ns *NullCheckConclusion) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullCheckStatus ¶
type NullCheckStatus struct {
CheckStatus CheckStatus
Valid bool // Valid is true if CheckStatus is not NULL
}
func (*NullCheckStatus) Scan ¶
func (ns *NullCheckStatus) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullCollabRole ¶
type NullCollabRole struct {
CollabRole CollabRole
Valid bool // Valid is true if CollabRole is not NULL
}
func (*NullCollabRole) Scan ¶
func (ns *NullCollabRole) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullIssueKind ¶
type NullIssueKind struct {
IssueKind IssueKind
Valid bool // Valid is true if IssueKind is not NULL
}
func (*NullIssueKind) Scan ¶
func (ns *NullIssueKind) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullIssueRefSource ¶
type NullIssueRefSource struct {
IssueRefSource IssueRefSource
Valid bool // Valid is true if IssueRefSource is not NULL
}
func (*NullIssueRefSource) Scan ¶
func (ns *NullIssueRefSource) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullIssueState ¶
type NullIssueState struct {
IssueState IssueState
Valid bool // Valid is true if IssueState is not NULL
}
func (*NullIssueState) Scan ¶
func (ns *NullIssueState) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullIssueStateReason ¶
type NullIssueStateReason struct {
IssueStateReason IssueStateReason
Valid bool // Valid is true if IssueStateReason is not NULL
}
func (*NullIssueStateReason) Scan ¶
func (ns *NullIssueStateReason) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullMilestoneState ¶
type NullMilestoneState struct {
MilestoneState MilestoneState
Valid bool // Valid is true if MilestoneState is not NULL
}
func (*NullMilestoneState) Scan ¶
func (ns *NullMilestoneState) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullNotificationThreadKind ¶
type NullNotificationThreadKind struct {
NotificationThreadKind NotificationThreadKind
Valid bool // Valid is true if NotificationThreadKind is not NULL
}
func (*NullNotificationThreadKind) Scan ¶
func (ns *NullNotificationThreadKind) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullOrgPlan ¶
func (*NullOrgPlan) Scan ¶
func (ns *NullOrgPlan) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullOrgRole ¶
func (*NullOrgRole) Scan ¶
func (ns *NullOrgRole) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullPrFileStatus ¶
type NullPrFileStatus struct {
PrFileStatus PrFileStatus
Valid bool // Valid is true if PrFileStatus is not NULL
}
func (*NullPrFileStatus) Scan ¶
func (ns *NullPrFileStatus) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullPrMergeMethod ¶
type NullPrMergeMethod struct {
PrMergeMethod PrMergeMethod
Valid bool // Valid is true if PrMergeMethod is not NULL
}
func (*NullPrMergeMethod) Scan ¶
func (ns *NullPrMergeMethod) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullPrMergeableState ¶
type NullPrMergeableState struct {
PrMergeableState PrMergeableState
Valid bool // Valid is true if PrMergeableState is not NULL
}
func (*NullPrMergeableState) Scan ¶
func (ns *NullPrMergeableState) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullPrReviewSide ¶
type NullPrReviewSide struct {
PrReviewSide PrReviewSide
Valid bool // Valid is true if PrReviewSide is not NULL
}
func (*NullPrReviewSide) Scan ¶
func (ns *NullPrReviewSide) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullPrReviewState ¶
type NullPrReviewState struct {
PrReviewState PrReviewState
Valid bool // Valid is true if PrReviewState is not NULL
}
func (*NullPrReviewState) Scan ¶
func (ns *NullPrReviewState) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullPrincipalKind ¶
type NullPrincipalKind struct {
PrincipalKind PrincipalKind
Valid bool // Valid is true if PrincipalKind is not NULL
}
func (*NullPrincipalKind) Scan ¶
func (ns *NullPrincipalKind) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullRepoInitStatus ¶
type NullRepoInitStatus struct {
RepoInitStatus RepoInitStatus
Valid bool // Valid is true if RepoInitStatus is not NULL
}
func (*NullRepoInitStatus) Scan ¶
func (ns *NullRepoInitStatus) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullRepoVisibility ¶
type NullRepoVisibility struct {
RepoVisibility RepoVisibility
Valid bool // Valid is true if RepoVisibility is not NULL
}
func (*NullRepoVisibility) Scan ¶
func (ns *NullRepoVisibility) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullTeamPrivacy ¶
type NullTeamPrivacy struct {
TeamPrivacy TeamPrivacy
Valid bool // Valid is true if TeamPrivacy is not NULL
}
func (*NullTeamPrivacy) Scan ¶
func (ns *NullTeamPrivacy) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullTeamRepoRole ¶
type NullTeamRepoRole struct {
TeamRepoRole TeamRepoRole
Valid bool // Valid is true if TeamRepoRole is not NULL
}
func (*NullTeamRepoRole) Scan ¶
func (ns *NullTeamRepoRole) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullTeamRole ¶
func (*NullTeamRole) Scan ¶
func (ns *NullTeamRole) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullTransactionalEmailStatus ¶
type NullTransactionalEmailStatus struct {
TransactionalEmailStatus TransactionalEmailStatus
Valid bool // Valid is true if TransactionalEmailStatus is not NULL
}
func (*NullTransactionalEmailStatus) Scan ¶
func (ns *NullTransactionalEmailStatus) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullTransferPrincipalKind ¶
type NullTransferPrincipalKind struct {
TransferPrincipalKind TransferPrincipalKind
Valid bool // Valid is true if TransferPrincipalKind is not NULL
}
func (*NullTransferPrincipalKind) Scan ¶
func (ns *NullTransferPrincipalKind) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullTransferStatus ¶
type NullTransferStatus struct {
TransferStatus TransferStatus
Valid bool // Valid is true if TransferStatus is not NULL
}
func (*NullTransferStatus) Scan ¶
func (ns *NullTransferStatus) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullWatchLevel ¶
type NullWatchLevel struct {
WatchLevel WatchLevel
Valid bool // Valid is true if WatchLevel is not NULL
}
func (*NullWatchLevel) Scan ¶
func (ns *NullWatchLevel) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullWebhookContentType ¶
type NullWebhookContentType struct {
WebhookContentType WebhookContentType
Valid bool // Valid is true if WebhookContentType is not NULL
}
func (*NullWebhookContentType) Scan ¶
func (ns *NullWebhookContentType) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullWebhookDeliveryStatus ¶
type NullWebhookDeliveryStatus struct {
WebhookDeliveryStatus WebhookDeliveryStatus
Valid bool // Valid is true if WebhookDeliveryStatus is not NULL
}
func (*NullWebhookDeliveryStatus) Scan ¶
func (ns *NullWebhookDeliveryStatus) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullWebhookOwnerKind ¶
type NullWebhookOwnerKind struct {
WebhookOwnerKind WebhookOwnerKind
Valid bool // Valid is true if WebhookOwnerKind is not NULL
}
func (*NullWebhookOwnerKind) Scan ¶
func (ns *NullWebhookOwnerKind) Scan(value interface{}) error
Scan implements the Scanner interface.
type Org ¶
type Org struct {
ID int64
Slug string
DisplayName string
Description string
AvatarObjectKey pgtype.Text
Location string
Website string
BillingEmail string
Plan OrgPlan
AllowMemberRepoCreate bool
CreatedByUserID pgtype.Int8
SuspendedAt pgtype.Timestamptz
SuspendedReason pgtype.Text
DeletedAt pgtype.Timestamptz
CreatedAt pgtype.Timestamptz
UpdatedAt pgtype.Timestamptz
}
type OrgInvitation ¶
type OrgInvitation struct {
ID int64
OrgID int64
InvitedByUserID pgtype.Int8
TargetUserID pgtype.Int8
TargetEmail pgtype.Text
Role OrgRole
TokenHash []byte
ExpiresAt pgtype.Timestamptz
AcceptedAt pgtype.Timestamptz
DeclinedAt pgtype.Timestamptz
CanceledAt pgtype.Timestamptz
CreatedAt pgtype.Timestamptz
}
type PasswordReset ¶
type PasswordReset struct {
ID int64
UserID int64
TokenHash []byte
ExpiresAt pgtype.Timestamptz
UsedAt pgtype.Timestamptz
CreatedAt pgtype.Timestamptz
}
type PrFileStatus ¶
type PrFileStatus string
const ( PrFileStatusAdded PrFileStatus = "added" PrFileStatusModified PrFileStatus = "modified" PrFileStatusDeleted PrFileStatus = "deleted" PrFileStatusRenamed PrFileStatus = "renamed" PrFileStatusCopied PrFileStatus = "copied" )
func (*PrFileStatus) Scan ¶
func (e *PrFileStatus) Scan(src interface{}) error
type PrMergeMethod ¶
type PrMergeMethod string
const ( PrMergeMethodMerge PrMergeMethod = "merge" PrMergeMethodSquash PrMergeMethod = "squash" PrMergeMethodRebase PrMergeMethod = "rebase" )
func (*PrMergeMethod) Scan ¶
func (e *PrMergeMethod) Scan(src interface{}) error
type PrMergeableState ¶
type PrMergeableState string
const ( PrMergeableStateUnknown PrMergeableState = "unknown" PrMergeableStateClean PrMergeableState = "clean" PrMergeableStateDirty PrMergeableState = "dirty" PrMergeableStateBlocked PrMergeableState = "blocked" PrMergeableStateBehind PrMergeableState = "behind" )
func (*PrMergeableState) Scan ¶
func (e *PrMergeableState) Scan(src interface{}) error
type PrReview ¶
type PrReview struct {
ID int64
PrIssueID int64
AuthorUserID pgtype.Int8
State PrReviewState
Body string
BodyHtmlCached pgtype.Text
SubmittedAt pgtype.Timestamptz
DismissedAt pgtype.Timestamptz
DismissedByUserID pgtype.Int8
DismissalReason string
}
type PrReviewComment ¶
type PrReviewComment struct {
ID int64
PrIssueID int64
ReviewID pgtype.Int8
AuthorUserID pgtype.Int8
FilePath string
Side PrReviewSide
OriginalCommitSha string
OriginalLine int32
OriginalPosition int32
CurrentPosition pgtype.Int4
Body string
BodyHtmlCached pgtype.Text
InReplyToID pgtype.Int8
Pending bool
ResolvedAt pgtype.Timestamptz
ResolvedByUserID pgtype.Int8
CreatedAt pgtype.Timestamptz
UpdatedAt pgtype.Timestamptz
EditedAt pgtype.Timestamptz
}
type PrReviewRequest ¶
type PrReviewSide ¶
type PrReviewSide string
const ( PrReviewSideLeft PrReviewSide = "left" PrReviewSideRight PrReviewSide = "right" )
func (*PrReviewSide) Scan ¶
func (e *PrReviewSide) Scan(src interface{}) error
type PrReviewState ¶
type PrReviewState string
const ( PrReviewStateComment PrReviewState = "comment" PrReviewStateApprove PrReviewState = "approve" PrReviewStateRequestChanges PrReviewState = "request_changes" )
func (*PrReviewState) Scan ¶
func (e *PrReviewState) Scan(src interface{}) error
type Principal ¶
type Principal struct {
Slug string
Kind PrincipalKind
ID int64
}
type PrincipalKind ¶
type PrincipalKind string
const ( PrincipalKindUser PrincipalKind = "user" PrincipalKindOrg PrincipalKind = "org" )
func (*PrincipalKind) Scan ¶
func (e *PrincipalKind) Scan(src interface{}) error
type PullRequest ¶
type PullRequest struct {
IssueID int64
BaseRef string
HeadRef string
HeadRepoID int64
BaseOid string
HeadOid string
Draft bool
Mergeable pgtype.Bool
MergeableState PrMergeableState
MergeCommitSha pgtype.Text
MergedAt pgtype.Timestamptz
MergedByUserID pgtype.Int8
MergeMethod NullPrMergeMethod
BaseOidAtMerge pgtype.Text
HeadOidAtMerge pgtype.Text
LastSynchronizedAt pgtype.Timestamptz
}
type PullRequestCommit ¶
type PullRequestFile ¶
type Querier ¶
type Querier interface {
AcceptTransferRequest(ctx context.Context, db DBTX, id int64) error
ArchiveRepo(ctx context.Context, db DBTX, id int64) error
CancelTransferRequest(ctx context.Context, db DBTX, id int64) error
CountForksOfRepo(ctx context.Context, db DBTX, forkOfRepoID pgtype.Int8) (int64, error)
// ─── rename rate limit support ─────────────────────────────────────────
// Used to enforce the 5-per-30-days rename rate limit. The redirect
// row is the audit trail for renames; counting them per repo gives a
// reliable cap.
CountRecentRedirectsForRepo(ctx context.Context, db DBTX, repoID int64) (int32, error)
CountReposForOwnerUser(ctx context.Context, db DBTX, ownerUserID pgtype.Int8) (int64, error)
// ─── S27 forks ─────────────────────────────────────────────────────
// Insert a fork shell. Distinct from CreateRepo because forks set
// `fork_of_repo_id` (which fires the fork_count trigger) and start
// at init_status='init_pending' so the worker job can flip them to
// 'initialized' once `git clone --bare --shared` finishes.
CreateForkRepo(ctx context.Context, db DBTX, arg CreateForkRepoParams) (Repo, error)
// SPDX-License-Identifier: AGPL-3.0-or-later
CreateRepo(ctx context.Context, db DBTX, arg CreateRepoParams) (Repo, error)
DeclineTransferRequest(ctx context.Context, db DBTX, id int64) error
DeleteBranchProtectionRule(ctx context.Context, db DBTX, id int64) error
// Used by the rename compensator: drop a single redirect row when
// the rename has to be rolled back due to a filesystem failure. We
// avoided raw SQL here at the audit's request (S00-S25, M).
DeleteRedirectByUserOwnerOldName(ctx context.Context, db DBTX, arg DeleteRedirectByUserOwnerOldNameParams) error
// Used by hard-delete: drop the redirect rows pointing at this repo
// (they would dangle once the repos row is gone; the FK ON DELETE
// CASCADE would handle it, but explicit is auditable).
DeleteRedirectsForRepo(ctx context.Context, db DBTX, repoID int64) error
ExistsRepoForOwnerOrg(ctx context.Context, db DBTX, arg ExistsRepoForOwnerOrgParams) (bool, error)
ExistsRepoForOwnerUser(ctx context.Context, db DBTX, arg ExistsRepoForOwnerUserParams) (bool, error)
// Called by the periodic worker (transfers:expire) — flips pending
// offers past their expires_at to the expired terminal state.
ExpirePendingTransfers(ctx context.Context, db DBTX) (int64, error)
GetBranchProtectionRule(ctx context.Context, db DBTX, id int64) (BranchProtectionRule, error)
GetRepoByID(ctx context.Context, db DBTX, id int64) (Repo, error)
// S30: org-owner mirror of GetRepoByOwnerUserAndName. The (owner_org_id,
// name) partial unique index from 0017 backs this lookup with the same
// O(1) cost the user-side path enjoys.
GetRepoByOwnerOrgAndName(ctx context.Context, db DBTX, arg GetRepoByOwnerOrgAndNameParams) (Repo, error)
GetRepoByOwnerUserAndName(ctx context.Context, db DBTX, arg GetRepoByOwnerUserAndNameParams) (Repo, error)
// Returns the owner_username for a repo. Used by size-recalc and other
// jobs that need to derive the bare-repo on-disk path without round-
// tripping through the full user row.
GetRepoOwnerUsernameByID(ctx context.Context, db DBTX, id int64) (GetRepoOwnerUsernameByIDRow, error)
GetTransferRequest(ctx context.Context, db DBTX, id int64) (RepoTransferRequest, error)
HardDeleteRepo(ctx context.Context, db DBTX, id int64) error
// ─── redirects ─────────────────────────────────────────────────────────
// Both old-owner FKs are nullable; pass exactly one. The CHECK
// constraint on the table enforces the xor shape.
InsertRepoRedirect(ctx context.Context, db DBTX, arg InsertRepoRedirectParams) error
InsertRepoTopic(ctx context.Context, db DBTX, arg InsertRepoTopicParams) error
// ─── transfer requests ─────────────────────────────────────────────────
InsertTransferRequest(ctx context.Context, db DBTX, arg InsertTransferRequestParams) (RepoTransferRequest, error)
// Used by `shithubd hooks reinstall --all` to enumerate every active
// bare repo on disk and re-link its hooks.
ListAllRepoFullNames(ctx context.Context, db DBTX) ([]ListAllRepoFullNamesRow, error)
// SPDX-License-Identifier: AGPL-3.0-or-later
ListBranchProtectionRules(ctx context.Context, db DBTX, repoID int64) ([]BranchProtectionRule, error)
// Forks of a given source repo, paginated, recency-sorted. Joined
// with users for the owner display name. Excludes soft-deleted.
ListForksOfRepo(ctx context.Context, db DBTX, arg ListForksOfRepoParams) ([]ListForksOfRepoRow, error)
// Used by S16's hard-delete cascade (S27 amendment): before deleting
// a source repo, every fork must `git repack -a -d --no-shared` so
// it has its own copy of the objects. Returns just enough to locate
// the bare repo on disk.
ListForksOfRepoForRepack(ctx context.Context, db DBTX, forkOfRepoID pgtype.Int8) ([]ListForksOfRepoForRepackRow, error)
// Inbox view: pending offers a user can act on.
ListPendingTransfersForUser(ctx context.Context, db DBTX, toPrincipalID int64) ([]RepoTransferRequest, error)
// ─── soft-delete sweep query ───────────────────────────────────────────
// The repo:hard_delete enqueuer queries this to find rows ready for
// destruction. The 7-day grace is hard-coded here; if we add a config
// knob later, change this to a parameter.
ListRepoIDsPastSoftDeleteGrace(ctx context.Context, db DBTX) ([]int64, error)
// ─── repo_topics (S32) ─────────────────────────────────────────────
ListRepoTopics(ctx context.Context, db DBTX, repoID int64) ([]string, error)
ListReposForOwnerOrg(ctx context.Context, db DBTX, ownerOrgID pgtype.Int8) ([]Repo, error)
ListReposForOwnerUser(ctx context.Context, db DBTX, ownerUserID pgtype.Int8) ([]Repo, error)
// S28 code-search reconciler: returns repos whose default_branch_oid
// has advanced past last_indexed_oid (or last_indexed_oid is NULL
// and a default exists). Limited so a single tick of the cron
// doesn't try to re-index the whole world.
ListReposNeedingReindex(ctx context.Context, db DBTX, limit int32) ([]ListReposNeedingReindexRow, error)
// /settings/repositories/restore page lists these.
ListSoftDeletedReposForOwner(ctx context.Context, db DBTX, ownerUserID pgtype.Int8) ([]ListSoftDeletedReposForOwnerRow, error)
// Sender / repo-settings view.
ListTransfersForRepo(ctx context.Context, db DBTX, repoID int64) ([]RepoTransferRequest, error)
// Returns the current repo_id when (old_owner_user_id, old_name) hits
// a redirect row.
LookupRedirectByUserOwner(ctx context.Context, db DBTX, arg LookupRedirectByUserOwnerParams) (int64, error)
// ─── fork-anchor cleanup on hard delete ────────────────────────────────
// Children pointing at this repo lose their fork-of pointer. Mirrors
// GitHub's behavior when an upstream is deleted.
OrphanForksOf(ctx context.Context, db DBTX, forkOfRepoID pgtype.Int8) (int64, error)
// SPDX-License-Identifier: AGPL-3.0-or-later
//
// S16 lifecycle queries. Kept in a separate file from repos.sql so the
// mainline CRUD stays easy to read.
// ─── repo mutations ────────────────────────────────────────────────────
// Same-owner rename. The handler validates the new name shape and the
// redirect row is INSERTed in the same tx.
RenameRepo(ctx context.Context, db DBTX, arg RenameRepoParams) error
// Atomic full-replace: callers compose the new topic set in Go,
// then replace the existing rows in one tx (DELETE + INSERT). The
// caller's tx wraps both calls for atomicity.
ReplaceRepoTopics(ctx context.Context, db DBTX, repoID int64) error
RestoreRepo(ctx context.Context, db DBTX, id int64) error
// S28 code-search: the worker writes the OID it finished indexing
// so the reconciler can detect drift (default_branch_oid moved but
// last_indexed_oid lagged).
SetLastIndexedOID(ctx context.Context, db DBTX, arg SetLastIndexedOIDParams) error
// Promotes a fork from init_pending to initialized (or init_failed).
// The DB row is created up-front so the URL resolves immediately and
// the user sees a "preparing your fork" placeholder while the worker
// runs `git clone --bare --shared`.
SetRepoInitStatus(ctx context.Context, db DBTX, arg SetRepoInitStatusParams) error
SetRepoVisibility(ctx context.Context, db DBTX, arg SetRepoVisibilityParams) error
SoftDeleteRepo(ctx context.Context, db DBTX, id int64) error
// Distinct name from S11's SoftDeleteRepo so future code that wants to
// preserve the lifecycle audit-emission shape can find this one.
SoftDeleteRepoLifecycle(ctx context.Context, db DBTX, id int64) error
// Sets owner_user_id (or owner_org_id post-S31) on accept. The xor
// check on the table enforces the shape. Also clears the other side
// so a user→org transfer flips both columns atomically.
TransferRepoOwner(ctx context.Context, db DBTX, arg TransferRepoOwnerParams) error
UnarchiveRepo(ctx context.Context, db DBTX, id int64) error
// S24 surface for the required-status-check knobs. Branch-protection
// edit handler calls this alongside UpdateBranchProtectionRule.
UpdateBranchProtectionCheckSettings(ctx context.Context, db DBTX, arg UpdateBranchProtectionCheckSettingsParams) error
// S23 surface for the review-related knobs. Branch-protection edit
// handler calls this alongside UpdateBranchProtectionRule.
UpdateBranchProtectionReviewSettings(ctx context.Context, db DBTX, arg UpdateBranchProtectionReviewSettingsParams) error
UpdateBranchProtectionRule(ctx context.Context, db DBTX, arg UpdateBranchProtectionRuleParams) error
// Used by the default-branch settings handler. The on-disk HEAD update
// is a separate step done via `git symbolic-ref` from the orchestrator.
UpdateRepoDefaultBranch(ctx context.Context, db DBTX, arg UpdateRepoDefaultBranchParams) error
// Set when push:process detects a commit on the repo's default branch.
// Pass NULL to clear (e.g. when the branch is force-deleted in a future
// sprint). The repo home view reads this to decide between empty and
// populated layouts.
UpdateRepoDefaultBranchOID(ctx context.Context, db DBTX, arg UpdateRepoDefaultBranchOIDParams) error
UpdateRepoDiskUsed(ctx context.Context, db DBTX, arg UpdateRepoDiskUsedParams) error
// S32: General-tab settings persist via this single query so each
// form post is one round-trip. The merge-method toggles are kept
// separate from the repo create flow because they're admin-only.
UpdateRepoGeneralSettings(ctx context.Context, db DBTX, arg UpdateRepoGeneralSettingsParams) error
UpdateRepoMergeSettings(ctx context.Context, db DBTX, arg UpdateRepoMergeSettingsParams) error
UpsertBranchProtectionRule(ctx context.Context, db DBTX, arg UpsertBranchProtectionRuleParams) (int64, error)
}
type Queries ¶
type Queries struct {
}
func (*Queries) AcceptTransferRequest ¶
func (*Queries) ArchiveRepo ¶
func (*Queries) CancelTransferRequest ¶
func (*Queries) CountForksOfRepo ¶
func (*Queries) CountRecentRedirectsForRepo ¶
func (q *Queries) CountRecentRedirectsForRepo(ctx context.Context, db DBTX, repoID int64) (int32, error)
─── rename rate limit support ───────────────────────────────────────── Used to enforce the 5-per-30-days rename rate limit. The redirect row is the audit trail for renames; counting them per repo gives a reliable cap.
func (*Queries) CountReposForOwnerUser ¶
func (*Queries) CreateForkRepo ¶
func (q *Queries) CreateForkRepo(ctx context.Context, db DBTX, arg CreateForkRepoParams) (Repo, error)
─── S27 forks ───────────────────────────────────────────────────── Insert a fork shell. Distinct from CreateRepo because forks set `fork_of_repo_id` (which fires the fork_count trigger) and start at init_status='init_pending' so the worker job can flip them to 'initialized' once `git clone --bare --shared` finishes.
func (*Queries) CreateRepo ¶
SPDX-License-Identifier: AGPL-3.0-or-later
func (*Queries) DeclineTransferRequest ¶
func (*Queries) DeleteBranchProtectionRule ¶
func (*Queries) DeleteRedirectByUserOwnerOldName ¶
func (q *Queries) DeleteRedirectByUserOwnerOldName(ctx context.Context, db DBTX, arg DeleteRedirectByUserOwnerOldNameParams) error
Used by the rename compensator: drop a single redirect row when the rename has to be rolled back due to a filesystem failure. We avoided raw SQL here at the audit's request (S00-S25, M).
func (*Queries) DeleteRedirectsForRepo ¶
Used by hard-delete: drop the redirect rows pointing at this repo (they would dangle once the repos row is gone; the FK ON DELETE CASCADE would handle it, but explicit is auditable).
func (*Queries) ExistsRepoForOwnerOrg ¶
func (*Queries) ExistsRepoForOwnerUser ¶
func (*Queries) ExpirePendingTransfers ¶
Called by the periodic worker (transfers:expire) — flips pending offers past their expires_at to the expired terminal state.
func (*Queries) GetBranchProtectionRule ¶
func (*Queries) GetRepoByID ¶
func (*Queries) GetRepoByOwnerOrgAndName ¶
func (q *Queries) GetRepoByOwnerOrgAndName(ctx context.Context, db DBTX, arg GetRepoByOwnerOrgAndNameParams) (Repo, error)
S30: org-owner mirror of GetRepoByOwnerUserAndName. The (owner_org_id, name) partial unique index from 0017 backs this lookup with the same O(1) cost the user-side path enjoys.
func (*Queries) GetRepoByOwnerUserAndName ¶
func (*Queries) GetRepoOwnerUsernameByID ¶
func (q *Queries) GetRepoOwnerUsernameByID(ctx context.Context, db DBTX, id int64) (GetRepoOwnerUsernameByIDRow, error)
Returns the owner_username for a repo. Used by size-recalc and other jobs that need to derive the bare-repo on-disk path without round- tripping through the full user row.
func (*Queries) GetTransferRequest ¶
func (*Queries) HardDeleteRepo ¶
func (*Queries) InsertRepoRedirect ¶
func (q *Queries) InsertRepoRedirect(ctx context.Context, db DBTX, arg InsertRepoRedirectParams) error
─── redirects ───────────────────────────────────────────────────────── Both old-owner FKs are nullable; pass exactly one. The CHECK constraint on the table enforces the xor shape.
func (*Queries) InsertRepoTopic ¶
func (*Queries) InsertTransferRequest ¶
func (q *Queries) InsertTransferRequest(ctx context.Context, db DBTX, arg InsertTransferRequestParams) (RepoTransferRequest, error)
─── transfer requests ─────────────────────────────────────────────────
func (*Queries) ListAllRepoFullNames ¶
func (q *Queries) ListAllRepoFullNames(ctx context.Context, db DBTX) ([]ListAllRepoFullNamesRow, error)
Used by `shithubd hooks reinstall --all` to enumerate every active bare repo on disk and re-link its hooks.
func (*Queries) ListBranchProtectionRules ¶
func (q *Queries) ListBranchProtectionRules(ctx context.Context, db DBTX, repoID int64) ([]BranchProtectionRule, error)
SPDX-License-Identifier: AGPL-3.0-or-later
func (*Queries) ListForksOfRepo ¶
func (q *Queries) ListForksOfRepo(ctx context.Context, db DBTX, arg ListForksOfRepoParams) ([]ListForksOfRepoRow, error)
Forks of a given source repo, paginated, recency-sorted. Joined with users for the owner display name. Excludes soft-deleted.
func (*Queries) ListForksOfRepoForRepack ¶
func (q *Queries) ListForksOfRepoForRepack(ctx context.Context, db DBTX, forkOfRepoID pgtype.Int8) ([]ListForksOfRepoForRepackRow, error)
Used by S16's hard-delete cascade (S27 amendment): before deleting a source repo, every fork must `git repack -a -d --no-shared` so it has its own copy of the objects. Returns just enough to locate the bare repo on disk.
func (*Queries) ListPendingTransfersForUser ¶
func (q *Queries) ListPendingTransfersForUser(ctx context.Context, db DBTX, toPrincipalID int64) ([]RepoTransferRequest, error)
Inbox view: pending offers a user can act on.
func (*Queries) ListRepoIDsPastSoftDeleteGrace ¶
─── soft-delete sweep query ─────────────────────────────────────────── The repo:hard_delete enqueuer queries this to find rows ready for destruction. The 7-day grace is hard-coded here; if we add a config knob later, change this to a parameter.
func (*Queries) ListRepoTopics ¶
─── repo_topics (S32) ─────────────────────────────────────────────
func (*Queries) ListReposForOwnerOrg ¶
func (*Queries) ListReposForOwnerUser ¶
func (*Queries) ListReposNeedingReindex ¶
func (q *Queries) ListReposNeedingReindex(ctx context.Context, db DBTX, limit int32) ([]ListReposNeedingReindexRow, error)
S28 code-search reconciler: returns repos whose default_branch_oid has advanced past last_indexed_oid (or last_indexed_oid is NULL and a default exists). Limited so a single tick of the cron doesn't try to re-index the whole world.
func (*Queries) ListSoftDeletedReposForOwner ¶
func (q *Queries) ListSoftDeletedReposForOwner(ctx context.Context, db DBTX, ownerUserID pgtype.Int8) ([]ListSoftDeletedReposForOwnerRow, error)
/settings/repositories/restore page lists these.
func (*Queries) ListTransfersForRepo ¶
func (q *Queries) ListTransfersForRepo(ctx context.Context, db DBTX, repoID int64) ([]RepoTransferRequest, error)
Sender / repo-settings view.
func (*Queries) LookupRedirectByUserOwner ¶
func (q *Queries) LookupRedirectByUserOwner(ctx context.Context, db DBTX, arg LookupRedirectByUserOwnerParams) (int64, error)
Returns the current repo_id when (old_owner_user_id, old_name) hits a redirect row.
func (*Queries) OrphanForksOf ¶
func (q *Queries) OrphanForksOf(ctx context.Context, db DBTX, forkOfRepoID pgtype.Int8) (int64, error)
─── fork-anchor cleanup on hard delete ──────────────────────────────── Children pointing at this repo lose their fork-of pointer. Mirrors GitHub's behavior when an upstream is deleted.
func (*Queries) RenameRepo ¶
SPDX-License-Identifier: AGPL-3.0-or-later
S16 lifecycle queries. Kept in a separate file from repos.sql so the mainline CRUD stays easy to read. ─── repo mutations ──────────────────────────────────────────────────── Same-owner rename. The handler validates the new name shape and the redirect row is INSERTed in the same tx.
func (*Queries) ReplaceRepoTopics ¶
Atomic full-replace: callers compose the new topic set in Go, then replace the existing rows in one tx (DELETE + INSERT). The caller's tx wraps both calls for atomicity.
func (*Queries) RestoreRepo ¶
func (*Queries) SetLastIndexedOID ¶
func (q *Queries) SetLastIndexedOID(ctx context.Context, db DBTX, arg SetLastIndexedOIDParams) error
S28 code-search: the worker writes the OID it finished indexing so the reconciler can detect drift (default_branch_oid moved but last_indexed_oid lagged).
func (*Queries) SetRepoInitStatus ¶
func (q *Queries) SetRepoInitStatus(ctx context.Context, db DBTX, arg SetRepoInitStatusParams) error
Promotes a fork from init_pending to initialized (or init_failed). The DB row is created up-front so the URL resolves immediately and the user sees a "preparing your fork" placeholder while the worker runs `git clone --bare --shared`.
func (*Queries) SetRepoVisibility ¶
func (*Queries) SoftDeleteRepo ¶
func (*Queries) SoftDeleteRepoLifecycle ¶
Distinct name from S11's SoftDeleteRepo so future code that wants to preserve the lifecycle audit-emission shape can find this one.
func (*Queries) TransferRepoOwner ¶
func (q *Queries) TransferRepoOwner(ctx context.Context, db DBTX, arg TransferRepoOwnerParams) error
Sets owner_user_id (or owner_org_id post-S31) on accept. The xor check on the table enforces the shape. Also clears the other side so a user→org transfer flips both columns atomically.
func (*Queries) UnarchiveRepo ¶
func (*Queries) UpdateBranchProtectionCheckSettings ¶
func (q *Queries) UpdateBranchProtectionCheckSettings(ctx context.Context, db DBTX, arg UpdateBranchProtectionCheckSettingsParams) error
S24 surface for the required-status-check knobs. Branch-protection edit handler calls this alongside UpdateBranchProtectionRule.
func (*Queries) UpdateBranchProtectionReviewSettings ¶
func (q *Queries) UpdateBranchProtectionReviewSettings(ctx context.Context, db DBTX, arg UpdateBranchProtectionReviewSettingsParams) error
S23 surface for the review-related knobs. Branch-protection edit handler calls this alongside UpdateBranchProtectionRule.
func (*Queries) UpdateBranchProtectionRule ¶
func (*Queries) UpdateRepoDefaultBranch ¶
func (q *Queries) UpdateRepoDefaultBranch(ctx context.Context, db DBTX, arg UpdateRepoDefaultBranchParams) error
Used by the default-branch settings handler. The on-disk HEAD update is a separate step done via `git symbolic-ref` from the orchestrator.
func (*Queries) UpdateRepoDefaultBranchOID ¶
func (q *Queries) UpdateRepoDefaultBranchOID(ctx context.Context, db DBTX, arg UpdateRepoDefaultBranchOIDParams) error
Set when push:process detects a commit on the repo's default branch. Pass NULL to clear (e.g. when the branch is force-deleted in a future sprint). The repo home view reads this to decide between empty and populated layouts.
func (*Queries) UpdateRepoDiskUsed ¶
func (*Queries) UpdateRepoGeneralSettings ¶
func (q *Queries) UpdateRepoGeneralSettings(ctx context.Context, db DBTX, arg UpdateRepoGeneralSettingsParams) error
S32: General-tab settings persist via this single query so each form post is one round-trip. The merge-method toggles are kept separate from the repo create flow because they're admin-only.
func (*Queries) UpdateRepoMergeSettings ¶
func (*Queries) UpsertBranchProtectionRule ¶
type RateLimit ¶
type RateLimit struct {
Scope string
Key string
Hits int32
WindowStartedAt pgtype.Timestamptz
}
type RenameRepoParams ¶
type Repo ¶
type Repo struct {
ID int64
OwnerUserID pgtype.Int8
OwnerOrgID pgtype.Int8
Name string
Description string
Visibility RepoVisibility
DefaultBranch string
IsArchived bool
ArchivedAt pgtype.Timestamptz
DeletedAt pgtype.Timestamptz
DiskUsedBytes int64
ForkOfRepoID pgtype.Int8
LicenseKey pgtype.Text
PrimaryLanguage pgtype.Text
HasIssues bool
HasPulls bool
CreatedAt pgtype.Timestamptz
UpdatedAt pgtype.Timestamptz
DefaultBranchOid pgtype.Text
AllowSquashMerge bool
AllowRebaseMerge bool
AllowMergeCommit bool
DefaultMergeMethod PrMergeMethod
StarCount int64
WatcherCount int64
ForkCount int64
InitStatus RepoInitStatus
LastIndexedOid pgtype.Text
}
type RepoCollaborator ¶
type RepoCollaborator struct {
RepoID int64
UserID int64
Role CollabRole
AddedAt pgtype.Timestamptz
AddedByUserID pgtype.Int8
}
type RepoInitStatus ¶
type RepoInitStatus string
const ( RepoInitStatusInitialized RepoInitStatus = "initialized" RepoInitStatusInitPending RepoInitStatus = "init_pending" RepoInitStatusInitFailed RepoInitStatus = "init_failed" )
func (*RepoInitStatus) Scan ¶
func (e *RepoInitStatus) Scan(src interface{}) error
type RepoIssueCounter ¶
type RepoRedirect ¶
type RepoTransferRequest ¶
type RepoTransferRequest struct {
ID int64
RepoID int64
FromUserID int64
ToPrincipalKind TransferPrincipalKind
ToPrincipalID int64
CreatedBy int64
CreatedAt pgtype.Timestamptz
ExpiresAt pgtype.Timestamptz
Status TransferStatus
AcceptedAt pgtype.Timestamptz
DeclinedAt pgtype.Timestamptz
CanceledAt pgtype.Timestamptz
}
type RepoVisibility ¶
type RepoVisibility string
const ( RepoVisibilityPublic RepoVisibility = "public" RepoVisibilityPrivate RepoVisibility = "private" )
func (*RepoVisibility) Scan ¶
func (e *RepoVisibility) Scan(src interface{}) error
type ReposSearch ¶
type ReposSearch struct {
RepoID int64
Tsv interface{}
}
type SetLastIndexedOIDParams ¶
type SetRepoInitStatusParams ¶
type SetRepoInitStatusParams struct {
ID int64
InitStatus RepoInitStatus
}
type SetRepoVisibilityParams ¶
type SetRepoVisibilityParams struct {
ID int64
Visibility RepoVisibility
}
type SignupIpThrottle ¶
type SignupIpThrottle struct {
Cidr netip.Addr
Hits int32
WindowStartedAt pgtype.Timestamptz
}
type Team ¶
type Team struct {
ID int64
OrgID int64
Slug string
DisplayName string
Description string
ParentTeamID pgtype.Int8
Privacy TeamPrivacy
CreatedByUserID pgtype.Int8
CreatedAt pgtype.Timestamptz
UpdatedAt pgtype.Timestamptz
}
type TeamMember ¶
type TeamPrivacy ¶
type TeamPrivacy string
const ( TeamPrivacyVisible TeamPrivacy = "visible" TeamPrivacySecret TeamPrivacy = "secret" )
func (*TeamPrivacy) Scan ¶
func (e *TeamPrivacy) Scan(src interface{}) error
type TeamRepoAccess ¶
type TeamRepoAccess struct {
TeamID int64
RepoID int64
Role TeamRepoRole
AddedByUserID pgtype.Int8
AddedAt pgtype.Timestamptz
}
type TeamRepoRole ¶
type TeamRepoRole string
const ( TeamRepoRoleRead TeamRepoRole = "read" TeamRepoRoleTriage TeamRepoRole = "triage" TeamRepoRoleWrite TeamRepoRole = "write" TeamRepoRoleMaintain TeamRepoRole = "maintain" TeamRepoRoleAdmin TeamRepoRole = "admin" )
func (*TeamRepoRole) Scan ¶
func (e *TeamRepoRole) Scan(src interface{}) error
type TransactionalEmailLog ¶
type TransactionalEmailLog struct {
ID int64
RecipientUserID pgtype.Int8
RecipientEmail string
Kind string
Subject string
ProviderID string
Status TransactionalEmailStatus
ErrorSummary pgtype.Text
SentAt pgtype.Timestamptz
DeliveredAt pgtype.Timestamptz
}
type TransactionalEmailStatus ¶
type TransactionalEmailStatus string
const ( TransactionalEmailStatusQueued TransactionalEmailStatus = "queued" TransactionalEmailStatusSent TransactionalEmailStatus = "sent" TransactionalEmailStatusSoftBounced TransactionalEmailStatus = "soft_bounced" TransactionalEmailStatusHardBounced TransactionalEmailStatus = "hard_bounced" TransactionalEmailStatusDropped TransactionalEmailStatus = "dropped" )
func (*TransactionalEmailStatus) Scan ¶
func (e *TransactionalEmailStatus) Scan(src interface{}) error
type TransferPrincipalKind ¶
type TransferPrincipalKind string
const ( TransferPrincipalKindUser TransferPrincipalKind = "user" TransferPrincipalKindOrg TransferPrincipalKind = "org" )
func (*TransferPrincipalKind) Scan ¶
func (e *TransferPrincipalKind) Scan(src interface{}) error
type TransferRepoOwnerParams ¶
type TransferStatus ¶
type TransferStatus string
const ( TransferStatusPending TransferStatus = "pending" TransferStatusAccepted TransferStatus = "accepted" TransferStatusDeclined TransferStatus = "declined" TransferStatusCanceled TransferStatus = "canceled" TransferStatusExpired TransferStatus = "expired" )
func (*TransferStatus) Scan ¶
func (e *TransferStatus) Scan(src interface{}) error
type UpdateRepoMergeSettingsParams ¶
type UpdateRepoMergeSettingsParams struct {
ID int64
AllowMergeCommit bool
AllowSquashMerge bool
AllowRebaseMerge bool
DefaultMergeMethod PrMergeMethod
}
type User ¶
type User struct {
ID int64
Username string
DisplayName string
PrimaryEmailID pgtype.Int8
PasswordHash string
PasswordAlgo string
PasswordUpdatedAt pgtype.Timestamptz
EmailVerified bool
LastLoginAt pgtype.Timestamptz
SuspendedAt pgtype.Timestamptz
SuspendedReason pgtype.Text
DeletedAt pgtype.Timestamptz
CreatedAt pgtype.Timestamptz
UpdatedAt pgtype.Timestamptz
Bio string
Location string
Website string
Company string
Pronouns string
AvatarObjectKey pgtype.Text
Theme string
SessionEpoch int32
IsSiteAdmin bool
}
type UserEmail ¶
type UserEmail struct {
ID int64
UserID int64
Email string
IsPrimary bool
Verified bool
VerificationTokenHash []byte
VerificationSentAt pgtype.Timestamptz
VerifiedAt pgtype.Timestamptz
CreatedAt pgtype.Timestamptz
}
type UserNotificationPref ¶
type UserNotificationPref struct {
UserID int64
Key string
Value []byte
UpdatedAt pgtype.Timestamptz
}
type UserRecoveryCode ¶
type UserRecoveryCode struct {
ID int64
UserID int64
CodeHash []byte
UsedAt pgtype.Timestamptz
GeneratedAt pgtype.Timestamptz
CreatedAt pgtype.Timestamptz
}
type UserSshKey ¶
type UserToken ¶
type UserToken struct {
ID int64
UserID int64
Name string
TokenHash []byte
TokenPrefix string
Scopes []string
ExpiresAt pgtype.Timestamptz
LastUsedAt pgtype.Timestamptz
LastUsedIp *netip.Addr
RevokedAt pgtype.Timestamptz
CreatedAt pgtype.Timestamptz
}
type UserTotp ¶
type UserTotp struct {
ID int64
UserID int64
SecretEncrypted []byte
SecretNonce []byte
ConfirmedAt pgtype.Timestamptz
LastUsedCounter int64
CreatedAt pgtype.Timestamptz
UpdatedAt pgtype.Timestamptz
}
type UsernameRedirect ¶
type UsernameRedirect struct {
OldUsername string
UserID int64
ChangedAt pgtype.Timestamptz
}
type UsersSearch ¶
type UsersSearch struct {
UserID int64
Tsv interface{}
}
type Watch ¶
type Watch struct {
UserID int64
RepoID int64
Level WatchLevel
UpdatedAt pgtype.Timestamptz
}
type WatchLevel ¶
type WatchLevel string
const ( WatchLevelAll WatchLevel = "all" WatchLevelParticipating WatchLevel = "participating" WatchLevelIgnore WatchLevel = "ignore" )
func (*WatchLevel) Scan ¶
func (e *WatchLevel) Scan(src interface{}) error
type Webhook ¶
type Webhook struct {
ID int64
OwnerKind WebhookOwnerKind
OwnerID int64
Url string
ContentType WebhookContentType
Events []string
SecretCiphertext []byte
SecretNonce []byte
Active bool
SslVerification bool
ConsecutiveFailures int32
AutoDisableThreshold int32
DisabledAt pgtype.Timestamptz
DisabledReason pgtype.Text
LastSuccessAt pgtype.Timestamptz
LastFailureAt pgtype.Timestamptz
CreatedByUserID pgtype.Int8
CreatedAt pgtype.Timestamptz
UpdatedAt pgtype.Timestamptz
}
type WebhookContentType ¶
type WebhookContentType string
const ( WebhookContentTypeJson WebhookContentType = "json" WebhookContentTypeForm WebhookContentType = "form" )
func (*WebhookContentType) Scan ¶
func (e *WebhookContentType) Scan(src interface{}) error
type WebhookDelivery ¶
type WebhookDelivery struct {
ID int64
WebhookID int64
EventKind string
EventID pgtype.Int8
DeliveryUuid pgtype.UUID
Payload []byte
RequestHeaders []byte
RequestBody []byte
ResponseStatus pgtype.Int4
ResponseHeaders []byte
ResponseBody []byte
ResponseTruncated bool
StartedAt pgtype.Timestamptz
CompletedAt pgtype.Timestamptz
Attempt int32
MaxAttempts int32
NextRetryAt pgtype.Timestamptz
Status WebhookDeliveryStatus
IdempotencyKey string
ErrorSummary pgtype.Text
RedeliverOf pgtype.Int8
}
type WebhookDeliveryStatus ¶
type WebhookDeliveryStatus string
const ( WebhookDeliveryStatusPending WebhookDeliveryStatus = "pending" WebhookDeliveryStatusSucceeded WebhookDeliveryStatus = "succeeded" WebhookDeliveryStatusFailedRetry WebhookDeliveryStatus = "failed_retry" WebhookDeliveryStatusFailedPermanent WebhookDeliveryStatus = "failed_permanent" )
func (*WebhookDeliveryStatus) Scan ¶
func (e *WebhookDeliveryStatus) Scan(src interface{}) error
type WebhookEventsPending ¶
type WebhookOwnerKind ¶
type WebhookOwnerKind string
const ( WebhookOwnerKindRepo WebhookOwnerKind = "repo" WebhookOwnerKindOrg WebhookOwnerKind = "org" )
func (*WebhookOwnerKind) Scan ¶
func (e *WebhookOwnerKind) Scan(src interface{}) error