Documentation
¶
Index ¶
- type DBTX
- type DeleteRemovedReposParams
- type DequeueSyncJobRow
- type GetRepoIDsFromRepoImportParams
- type GitBlame
- type GitBranch
- type GitCommit
- type GitCommitStat
- type GitFile
- type GitRef
- type GitTag
- type GithubIssue
- type GithubPullRequest
- type GithubPullRequestCommit
- type GithubPullRequestReview
- type GithubRepoInfo
- type GithubStargazer
- type InsertGitHubRepoInfoParams
- type InsertNewDefaultSyncParams
- type InsertSyncJobLogParams
- type ListRepoImportsDueForImportRow
- type MergestatLatestRepoSync
- type MergestatRepoImport
- type MergestatRepoImportType
- type MergestatRepoSync
- type MergestatRepoSyncLog
- type MergestatRepoSyncLogType
- type MergestatRepoSyncQueue
- type MergestatRepoSyncQueueStatusType
- type MergestatRepoSyncType
- type MergestatServiceAuthCredential
- type MergestatServiceAuthCredentialType
- type Queries
- func (q *Queries) CleanOldRepoSyncQueue(ctx context.Context, dollar_1 int32) error
- func (q *Queries) DeleteGitHubRepoInfo(ctx context.Context, repoID uuid.UUID) error
- func (q *Queries) DeleteRemovedRepos(ctx context.Context, arg DeleteRemovedReposParams) error
- func (q *Queries) DequeueSyncJob(ctx context.Context) (DequeueSyncJobRow, error)
- func (q *Queries) EnqueueAllSyncs(ctx context.Context) error
- func (q *Queries) GetRepoIDsFromRepoImport(ctx context.Context, arg GetRepoIDsFromRepoImportParams) ([]uuid.UUID, error)
- func (q *Queries) GetRepoImportByID(ctx context.Context, id uuid.UUID) (MergestatRepoImport, error)
- func (q *Queries) GetRepoUrlFromImport(ctx context.Context, importid uuid.UUID) ([]string, error)
- func (q *Queries) InsertGitHubRepoInfo(ctx context.Context, arg InsertGitHubRepoInfoParams) error
- func (q *Queries) InsertNewDefaultSync(ctx context.Context, arg InsertNewDefaultSyncParams) error
- func (q *Queries) InsertSyncJobLog(ctx context.Context, arg InsertSyncJobLogParams) error
- func (q *Queries) ListRepoImportsDueForImport(ctx context.Context) ([]ListRepoImportsDueForImportRow, error)
- func (q *Queries) MarkRepoImportAsUpdated(ctx context.Context, id uuid.UUID) error
- func (q *Queries) MarkSyncsAsTimedOut(ctx context.Context) ([]int64, error)
- func (q *Queries) SetLatestKeepAliveForJob(ctx context.Context, id int64) error
- func (q *Queries) SetSyncJobStatus(ctx context.Context, arg SetSyncJobStatusParams) error
- func (q *Queries) UpsertRepo(ctx context.Context, arg UpsertRepoParams) error
- func (q *Queries) WithTx(tx pgx.Tx) *Queries
- type Repo
- type SetSyncJobStatusParams
- type TrivyRepoScan
- type TrivyRepoVulnerability
- type UpsertRepoParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DequeueSyncJobRow ¶
type GetRepoIDsFromRepoImportParams ¶ added in v0.1.0
type GitBlame ¶ added in v0.0.6
type GitBlame struct {
RepoID uuid.UUID
AuthorEmail sql.NullString
AuthorName sql.NullString
AuthorWhen sql.NullTime
CommitHash sql.NullString
LineNo int32
Line sql.NullString
Path string
MergestatSyncedAt time.Time
}
type GitBranch ¶
type GitBranch struct {
RepoID uuid.UUID
FullName string
Hash sql.NullString
Name sql.NullString
Remote sql.NullString
Target sql.NullString
Type sql.NullString
TagCommitHash sql.NullString
MergestatSyncedAt time.Time
}
type GitCommit ¶
type GitCommit struct {
RepoID uuid.UUID
Hash string
Message string
AuthorName string
AuthorEmail string
AuthorWhen time.Time
CommitterName string
CommitterEmail string
CommitterWhen time.Time
Parents int32
MergestatSyncedAt time.Time
}
Git repository commits
type GitCommitStat ¶
type GitCommitStat struct {
RepoID uuid.UUID
CommitHash string
FilePath string
Additions int32
Deletions int32
MergestatSyncedAt time.Time
OldFileMode string
NewFileMode string
}
Commit stats
type GitFile ¶
type GitFile struct {
RepoID uuid.UUID
Path string
Executable bool
Contents sql.NullString
MergestatSyncedAt time.Time
}
Git repository files
type GitRef ¶
type GitRef struct {
RepoID uuid.UUID
FullName string
Hash sql.NullString
Name sql.NullString
Remote sql.NullString
Target sql.NullString
Type sql.NullString
TagCommitHash sql.NullString
MergestatSyncedAt time.Time
}
Refs for a Git repo
type GitTag ¶
type GitTag struct {
RepoID uuid.UUID
FullName string
Hash sql.NullString
Name sql.NullString
Remote sql.NullString
Target sql.NullString
Type sql.NullString
TagCommitHash sql.NullString
MergestatSyncedAt time.Time
}
type GithubIssue ¶
type GithubIssue struct {
RepoID uuid.UUID
AuthorLogin sql.NullString
Body sql.NullString
Closed sql.NullBool
ClosedAt sql.NullTime
CommentCount sql.NullInt32
CreatedAt sql.NullTime
CreatedViaEmail sql.NullBool
DatabaseID int32
EditorLogin sql.NullString
IncludesCreatedEdit sql.NullBool
LabelCount sql.NullInt32
LastEditedAt sql.NullTime
Locked sql.NullBool
MilestoneCount sql.NullInt32
Number int32
ParticipantCount sql.NullInt32
PublishedAt sql.NullTime
ReactionCount sql.NullInt32
State sql.NullString
Title sql.NullString
UpdatedAt sql.NullTime
Url sql.NullString
Labels pgtype.JSONB
MergestatSyncedAt time.Time
}
GitHub issues
type GithubPullRequest ¶
type GithubPullRequest struct {
RepoID uuid.UUID
Additions sql.NullInt32
AuthorLogin sql.NullString
AuthorAssociation sql.NullString
AuthorAvatarUrl sql.NullString
AuthorName sql.NullString
BaseRefOid sql.NullString
BaseRefName sql.NullString
BaseRepositoryName sql.NullString
Body sql.NullString
ChangedFiles sql.NullInt32
Closed sql.NullBool
ClosedAt sql.NullTime
CommentCount sql.NullInt32
CommitCount sql.NullInt32
CreatedAt sql.NullTime
CreatedViaEmail sql.NullBool
DatabaseID int32
Deletions sql.NullInt32
EditorLogin sql.NullString
HeadRefName sql.NullString
HeadRefOid sql.NullString
HeadRepositoryName sql.NullString
IsDraft sql.NullBool
LabelCount sql.NullInt32
LastEditedAt sql.NullTime
Locked sql.NullBool
MaintainerCanModify sql.NullBool
MantainerCanModify sql.NullBool
Mergeable sql.NullString
Merged sql.NullBool
MergedAt sql.NullTime
MergedBy sql.NullString
Number sql.NullInt32
ParticipantCount sql.NullInt32
PublishedAt sql.NullTime
ReviewDecision sql.NullString
State sql.NullString
Title sql.NullString
UpdatedAt sql.NullTime
Url sql.NullString
Labels pgtype.JSONB
MergestatSyncedAt time.Time
}
GitHub pull requests
type GithubPullRequestCommit ¶
type GithubPullRequestCommit struct {
RepoID uuid.UUID
PrNumber int32
Hash sql.NullString
Message sql.NullString
AuthorName sql.NullString
AuthorEmail sql.NullString
AuthorWhen sql.NullTime
CommitterName sql.NullString
CommitterEmail sql.NullString
CommitterWhen sql.NullTime
Additions sql.NullInt32
Deletions sql.NullInt32
ChangedFiles sql.NullInt32
Url sql.NullString
MergestatSyncedAt time.Time
}
GitHub pull request commits
type GithubPullRequestReview ¶
type GithubPullRequestReview struct {
RepoID uuid.UUID
PrNumber int32
ID string
AuthorLogin sql.NullString
AuthorUrl sql.NullString
AuthorAssociation sql.NullString
AuthorCanPushToRepository sql.NullBool
Body sql.NullString
CommentCount sql.NullInt32
CreatedAt sql.NullTime
CreatedViaEmail sql.NullBool
EditorLogin sql.NullString
LastEditedAt sql.NullTime
PublishedAt sql.NullTime
State sql.NullString
SubmittedAt sql.NullTime
UpdatedAt sql.NullTime
MergestatSyncedAt time.Time
}
GitHub pull request reviews
type GithubRepoInfo ¶
type GithubRepoInfo struct {
RepoID uuid.UUID
Owner string
Name string
CreatedAt sql.NullTime
DefaultBranchName sql.NullString
Description sql.NullString
DiskUsage sql.NullInt32
ForkCount sql.NullInt32
HomepageUrl sql.NullString
IsArchived sql.NullBool
IsDisabled sql.NullBool
IsMirror sql.NullBool
IsPrivate sql.NullBool
TotalIssuesCount sql.NullInt32
LatestReleaseAuthor sql.NullString
LatestReleaseCreatedAt sql.NullTime
LatestReleaseName sql.NullString
LatestReleasePublishedAt sql.NullTime
LicenseKey sql.NullString
LicenseName sql.NullString
LicenseNickname sql.NullString
OpenGraphImageUrl sql.NullString
PrimaryLanguage sql.NullString
PushedAt sql.NullTime
ReleasesCount sql.NullInt32
StargazersCount sql.NullInt32
UpdatedAt sql.NullTime
WatchersCount sql.NullInt32
MergestatSyncedAt time.Time
}
GitHub metadata about a repo
type GithubStargazer ¶
type GithubStargazer struct {
RepoID uuid.UUID
Login string
Email sql.NullString
Name sql.NullString
Bio sql.NullString
Company sql.NullString
AvatarUrl sql.NullString
CreatedAt sql.NullTime
UpdatedAt sql.NullTime
Twitter sql.NullString
Website sql.NullString
Location sql.NullString
StarredAt sql.NullTime
MergestatSyncedAt time.Time
}
GitHub stargazers for a repo
type InsertGitHubRepoInfoParams ¶
type InsertGitHubRepoInfoParams struct {
RepoID uuid.UUID
Owner string
Name string
CreatedAt sql.NullTime
DefaultBranchName sql.NullString
Description sql.NullString
DiskUsage sql.NullInt32
ForkCount sql.NullInt32
HomepageUrl sql.NullString
IsArchived sql.NullBool
IsDisabled sql.NullBool
IsMirror sql.NullBool
IsPrivate sql.NullBool
TotalIssuesCount sql.NullInt32
LatestReleaseAuthor sql.NullString
LatestReleaseCreatedAt sql.NullTime
LatestReleaseName sql.NullString
LatestReleasePublishedAt sql.NullTime
LicenseKey sql.NullString
LicenseName sql.NullString
LicenseNickname sql.NullString
OpenGraphImageUrl sql.NullString
PrimaryLanguage sql.NullString
PushedAt sql.NullTime
ReleasesCount sql.NullInt32
StargazersCount sql.NullInt32
UpdatedAt sql.NullTime
WatchersCount sql.NullInt32
}
type InsertNewDefaultSyncParams ¶ added in v0.1.0
type InsertSyncJobLogParams ¶
type MergestatLatestRepoSync ¶
type MergestatRepoImport ¶
type MergestatRepoImport struct {
ID uuid.UUID
CreatedAt time.Time
UpdatedAt time.Time
Type string
Settings pgtype.JSONB
LastImport sql.NullTime
ImportInterval sql.NullString
LastImportStartedAt sql.NullTime
}
Table for "dynamic" repo imports - regularly loading from a GitHub org for example
type MergestatRepoImportType ¶
Types of repo imports
type MergestatRepoSync ¶
type MergestatRepoSyncLog ¶
type MergestatRepoSyncLogType ¶
type MergestatRepoSyncLogType struct {
Type string
Description sql.NullString
}
type MergestatRepoSyncQueue ¶
type MergestatRepoSyncQueueStatusType ¶
type MergestatRepoSyncQueueStatusType struct {
Type string
Description sql.NullString
}
type MergestatRepoSyncType ¶
type MergestatRepoSyncType struct {
Type string
Description sql.NullString
ShortName string
}
type MergestatServiceAuthCredential ¶ added in v0.0.6
type MergestatServiceAuthCredentialType ¶ added in v0.0.6
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func (*Queries) CleanOldRepoSyncQueue ¶ added in v0.0.3
func (*Queries) DeleteGitHubRepoInfo ¶
func (*Queries) DeleteRemovedRepos ¶
func (q *Queries) DeleteRemovedRepos(ctx context.Context, arg DeleteRemovedReposParams) error
func (*Queries) DequeueSyncJob ¶
func (q *Queries) DequeueSyncJob(ctx context.Context) (DequeueSyncJobRow, error)
func (*Queries) EnqueueAllSyncs ¶
We use a CTE here to retrieve all the repo_sync_jobs that were previously enqueued, to make sure that we *do not* re-enqueue anything new until the previously enqueued jobs are *completed*. This allows us to make sure all repo syncs complete before we reschedule a new batch.
func (*Queries) GetRepoIDsFromRepoImport ¶ added in v0.1.0
func (*Queries) GetRepoImportByID ¶
func (*Queries) GetRepoUrlFromImport ¶ added in v0.1.0
func (*Queries) InsertGitHubRepoInfo ¶
func (q *Queries) InsertGitHubRepoInfo(ctx context.Context, arg InsertGitHubRepoInfoParams) error
func (*Queries) InsertNewDefaultSync ¶ added in v0.1.0
func (q *Queries) InsertNewDefaultSync(ctx context.Context, arg InsertNewDefaultSyncParams) error
func (*Queries) InsertSyncJobLog ¶
func (q *Queries) InsertSyncJobLog(ctx context.Context, arg InsertSyncJobLogParams) error
func (*Queries) ListRepoImportsDueForImport ¶
func (q *Queries) ListRepoImportsDueForImport(ctx context.Context) ([]ListRepoImportsDueForImportRow, error)
func (*Queries) MarkRepoImportAsUpdated ¶
func (*Queries) MarkSyncsAsTimedOut ¶
func (*Queries) SetLatestKeepAliveForJob ¶
func (*Queries) SetSyncJobStatus ¶
func (q *Queries) SetSyncJobStatus(ctx context.Context, arg SetSyncJobStatusParams) error
func (*Queries) UpsertRepo ¶
func (q *Queries) UpsertRepo(ctx context.Context, arg UpsertRepoParams) error
type Repo ¶
type Repo struct {
ID uuid.UUID
Repo string
Ref sql.NullString
IsGithub sql.NullBool
CreatedAt time.Time
Settings pgtype.JSONB
Tags pgtype.JSONB
RepoImportID uuid.NullUUID
MergestatSyncedAt time.Time
}
Git repositories to track
type SetSyncJobStatusParams ¶
type TrivyRepoScan ¶ added in v0.0.6
type TrivyRepoVulnerability ¶ added in v0.0.6
type TrivyRepoVulnerability struct {
RepoID uuid.UUID
Vulnerability pgtype.JSONB
Target interface{}
Class interface{}
Type interface{}
VulnerabilityID interface{}
VulnerabilityPkgName interface{}
VulnerabilityInstalledVersion interface{}
VulnerabilitySeverity interface{}
VulnerabilityTitle interface{}
VulnerabilityDescription interface{}
MergestatSyncedAt time.Time
}