Documentation
¶
Index ¶
- type ActivityOrmStore
- func (s *ActivityOrmStore) Count(ctx context.Context, prID int64, opts *types.PullReqActivityFilter) (int64, error)
- func (s *ActivityOrmStore) CountUnresolved(ctx context.Context, prID int64) (int, error)
- func (s *ActivityOrmStore) Create(ctx context.Context, act *types.PullReqActivity) error
- func (s *ActivityOrmStore) CreateWithPayload(ctx context.Context, pr *types.PullReq, principalID int64, ...) (*types.PullReqActivity, error)
- func (s *ActivityOrmStore) Find(ctx context.Context, id int64) (*types.PullReqActivity, error)
- func (s *ActivityOrmStore) List(ctx context.Context, prID int64, filter *types.PullReqActivityFilter) ([]*types.PullReqActivity, error)
- func (s *ActivityOrmStore) ListAuthorIDs(ctx context.Context, prID int64, order int64) ([]int64, error)
- func (s *ActivityOrmStore) Update(ctx context.Context, act *types.PullReqActivity) error
- func (s *ActivityOrmStore) UpdateOptLock(ctx context.Context, act *types.PullReqActivity, ...) (*types.PullReqActivity, error)
- type CodeCommentView
- func (s *CodeCommentView) ListNotAtMergeBaseSHA(ctx context.Context, prID int64, mergeBaseSHA string) ([]*types.CodeComment, error)
- func (s *CodeCommentView) ListNotAtSourceSHA(ctx context.Context, prID int64, sourceSHA string) ([]*types.CodeComment, error)
- func (s *CodeCommentView) UpdateAll(ctx context.Context, codeComments []*types.CodeComment) error
- type FileViewOrmStore
- func (s *FileViewOrmStore) DeleteByFileForPrincipal(ctx context.Context, prID int64, principalID int64, filePath string) error
- func (s *FileViewOrmStore) FindByFileForPrincipal(ctx context.Context, prID int64, principalID int64, filePath string) (*types.PullReqFileView, error)
- func (s *FileViewOrmStore) List(ctx context.Context, prID int64, principalID int64) ([]*types.PullReqFileView, error)
- func (s *FileViewOrmStore) MarkObsolete(ctx context.Context, prID int64, filePaths []string) error
- func (s *FileViewOrmStore) Upsert(ctx context.Context, view *types.PullReqFileView) error
- type OrmStore
- func (s *OrmStore) Count(ctx context.Context, opts *types.PullReqFilter) (int64, error)
- func (s *OrmStore) Create(ctx context.Context, pr *types.PullReq) error
- func (s *OrmStore) Delete(ctx context.Context, id int64) error
- func (s *OrmStore) Find(ctx context.Context, id int64) (*types.PullReq, error)
- func (s *OrmStore) FindByNumber(ctx context.Context, repoID, number int64) (*types.PullReq, error)
- func (s *OrmStore) FindByNumberWithLock(ctx context.Context, repoID, number int64) (*types.PullReq, error)
- func (s *OrmStore) GetUnmergedPullRequest(ctx context.Context, sourceRepo, targetRepo int64, ...) (*types.PullReq, bool, error)
- func (s *OrmStore) List(ctx context.Context, opts *types.PullReqFilter) ([]*types.PullReq, error)
- func (s *OrmStore) ListOpenByBranchName(ctx context.Context, repoID int64, branchNames []string) (map[string][]*types.PullReq, error)
- func (s *OrmStore) ResetMergeCheckStatus(ctx context.Context, targetRepo int64, targetBranch string) error
- func (s *OrmStore) Stream(ctx context.Context, opts *types.PullReqFilter) (<-chan *types.PullReq, <-chan error)
- func (s *OrmStore) SummaryCount(ctx context.Context, opts *types.PullReqSummaryFilter) (*types.PullReqSummary, error)
- func (s *OrmStore) Update(ctx context.Context, pr *types.PullReq) error
- func (s *OrmStore) UpdateActivitySeq(ctx context.Context, pr *types.PullReq) (*types.PullReq, error)
- func (s *OrmStore) UpdateOptLock(ctx context.Context, pr *types.PullReq, mutateFn func(pr *types.PullReq) error) (*types.PullReq, error)
- type ReviewOrmStore
- type ReviewerOrmStore
- func (s *ReviewerOrmStore) Create(ctx context.Context, v *types.PullReqReviewer) error
- func (s *ReviewerOrmStore) Delete(ctx context.Context, prID, reviewerID int64) error
- func (s *ReviewerOrmStore) Find(ctx context.Context, prID, principalID int64) (*types.PullReqReviewer, error)
- func (s *ReviewerOrmStore) List(ctx context.Context, prID int64) ([]*types.PullReqReviewer, error)
- func (s *ReviewerOrmStore) Update(ctx context.Context, v *types.PullReqReviewer) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActivityOrmStore ¶
type ActivityOrmStore struct {
// contains filtered or unexported fields
}
ActivityOrmStore implements store.PullReqActivityStore backed by a relational database.
func NewPullReqActivityOrmStore ¶
func NewPullReqActivityOrmStore( db *gorm.DB, pCache store.PrincipalInfoCache, ) *ActivityOrmStore
NewPullReqActivityOrmStore returns a new PullReqJournalStore.
func (*ActivityOrmStore) Count ¶
func (s *ActivityOrmStore) Count(ctx context.Context, prID int64, opts *types.PullReqActivityFilter, ) (int64, error)
Count of pull requests for a repo.
func (*ActivityOrmStore) CountUnresolved ¶
func (*ActivityOrmStore) Create ¶
func (s *ActivityOrmStore) Create(ctx context.Context, act *types.PullReqActivity) error
Create creates a new pull request.
func (*ActivityOrmStore) CreateWithPayload ¶
func (s *ActivityOrmStore) CreateWithPayload(ctx context.Context, pr *types.PullReq, principalID int64, payload types.PullReqActivityPayload, metadata *types.PullReqActivityMetadata, ) (*types.PullReqActivity, error)
func (*ActivityOrmStore) Find ¶
func (s *ActivityOrmStore) Find(ctx context.Context, id int64) (*types.PullReqActivity, error)
Find finds the pull request activity by id.
func (*ActivityOrmStore) List ¶
func (s *ActivityOrmStore) List(ctx context.Context, prID int64, filter *types.PullReqActivityFilter, ) ([]*types.PullReqActivity, error)
List returns a list of pull request activities for a PR.
func (*ActivityOrmStore) ListAuthorIDs ¶
func (s *ActivityOrmStore) ListAuthorIDs(ctx context.Context, prID int64, order int64) ([]int64, error)
ListAuthorIDs returns a list of pull request activity author ids in a thread for a PR.
func (*ActivityOrmStore) Update ¶
func (s *ActivityOrmStore) Update(ctx context.Context, act *types.PullReqActivity) error
Update updates the pull request.
func (*ActivityOrmStore) UpdateOptLock ¶
func (s *ActivityOrmStore) UpdateOptLock(ctx context.Context, act *types.PullReqActivity, mutateFn func(act *types.PullReqActivity) error, ) (*types.PullReqActivity, error)
UpdateOptLock updates the pull request using the optimistic locking mechanism.
type CodeCommentView ¶
type CodeCommentView struct {
// contains filtered or unexported fields
}
CodeCommentView implements store.CodeCommentView backed by a relational database.
func NewCodeCommentOrmView ¶
func NewCodeCommentOrmView(db *gorm.DB) *CodeCommentView
NewCodeCommentOrmView returns a new CodeCommentView.
func (*CodeCommentView) ListNotAtMergeBaseSHA ¶
func (s *CodeCommentView) ListNotAtMergeBaseSHA(ctx context.Context, prID int64, mergeBaseSHA string, ) ([]*types.CodeComment, error)
ListNotAtMergeBaseSHA lists all code comments not already at the provided merge base SHA.
func (*CodeCommentView) ListNotAtSourceSHA ¶
func (s *CodeCommentView) ListNotAtSourceSHA(ctx context.Context, prID int64, sourceSHA string, ) ([]*types.CodeComment, error)
ListNotAtSourceSHA lists all code comments not already at the provided source SHA.
func (*CodeCommentView) UpdateAll ¶
func (s *CodeCommentView) UpdateAll(ctx context.Context, codeComments []*types.CodeComment) error
UpdateAll updates all code comments provided in the slice.
type FileViewOrmStore ¶
type FileViewOrmStore struct {
// contains filtered or unexported fields
}
FileViewOrmStore implements store.PullReqFileViewStore backed by a relational database.
func NewPullReqFileViewOrmStore ¶
func NewPullReqFileViewOrmStore( db *gorm.DB, ) *FileViewOrmStore
NewPullReqFileViewOrmStore returns a new PullReqFileViewOrmStore.
func (*FileViewOrmStore) DeleteByFileForPrincipal ¶
func (s *FileViewOrmStore) DeleteByFileForPrincipal( ctx context.Context, prID int64, principalID int64, filePath string, ) error
DeleteByFileForPrincipal deletes the entry for the specified PR, principal, and file.
func (*FileViewOrmStore) FindByFileForPrincipal ¶
func (s *FileViewOrmStore) FindByFileForPrincipal( ctx context.Context, prID int64, principalID int64, filePath string, ) (*types.PullReqFileView, error)
FindByFileForPrincipal get the entry for the specified PR, principal, and file.
func (*FileViewOrmStore) List ¶
func (s *FileViewOrmStore) List( ctx context.Context, prID int64, principalID int64, ) ([]*types.PullReqFileView, error)
List lists all files marked as viewed by the user for the specified PR.
func (*FileViewOrmStore) MarkObsolete ¶
MarkObsolete updates all entries of the files as obsolete for the PR.
func (*FileViewOrmStore) Upsert ¶
func (s *FileViewOrmStore) Upsert(ctx context.Context, view *types.PullReqFileView) error
Upsert inserts or updates the latest viewed sha for a file in a PR.
type OrmStore ¶
type OrmStore struct {
// contains filtered or unexported fields
}
OrmStore implements store.PullReqStore backed by a relational database.
func NewPullReqOrmStore ¶
func NewPullReqOrmStore(db *gorm.DB, pCache store.PrincipalInfoCache) *OrmStore
NewPullReqOrmStore returns a new PullReqStore.
func (*OrmStore) FindByNumber ¶
FindByNumber finds the pull request by repo ID and pull request number.
func (*OrmStore) FindByNumberWithLock ¶
func (s *OrmStore) FindByNumberWithLock( ctx context.Context, repoID, number int64, ) (*types.PullReq, error)
FindByNumberWithLock finds the pull request by repo ID and pull request number and locks the pull request for the duration of the transaction.
func (*OrmStore) GetUnmergedPullRequest ¶
func (*OrmStore) ListOpenByBranchName ¶
func (*OrmStore) ResetMergeCheckStatus ¶
func (s *OrmStore) ResetMergeCheckStatus( ctx context.Context, targetRepo int64, targetBranch string, ) error
ResetMergeCheckStatus resets the pull request's mergeability status to unchecked for all pr which target branch points to targetBranch.
func (*OrmStore) Stream ¶
func (s *OrmStore) Stream(ctx context.Context, opts *types.PullReqFilter) (<-chan *types.PullReq, <-chan error)
Stream returns a list of pull requests for a repo.
func (*OrmStore) SummaryCount ¶
func (s *OrmStore) SummaryCount(ctx context.Context, opts *types.PullReqSummaryFilter) (*types.PullReqSummary, error)
type ReviewOrmStore ¶
type ReviewOrmStore struct {
// contains filtered or unexported fields
}
ReviewOrmStore implements store.PullReqReviewStore backed by a relational database.
func NewPullReqReviewOrmStore ¶
func NewPullReqReviewOrmStore(db *gorm.DB) *ReviewOrmStore
NewPullReqReviewOrmStore returns a new PullReqReviewOrmStore.
func (*ReviewOrmStore) Create ¶
func (s *ReviewOrmStore) Create(ctx context.Context, v *types.PullReqReview) error
Create creates a new pull request.
func (*ReviewOrmStore) Find ¶
func (s *ReviewOrmStore) Find(ctx context.Context, id int64) (*types.PullReqReview, error)
Find finds the pull request activity by id.
type ReviewerOrmStore ¶
type ReviewerOrmStore struct {
// contains filtered or unexported fields
}
ReviewerOrmStore implements store.PullReqReviewerStore backed by a relational database.
func NewPullReqReviewerOrmStore ¶
func NewPullReqReviewerOrmStore(db *gorm.DB, pCache store.PrincipalInfoCache) *ReviewerOrmStore
NewPullReqReviewerOrmStore returns a new PullReqReviewerOrmStore.
func (*ReviewerOrmStore) Create ¶
func (s *ReviewerOrmStore) Create(ctx context.Context, v *types.PullReqReviewer) error
Create creates a new pull request reviewer.
func (*ReviewerOrmStore) Delete ¶
func (s *ReviewerOrmStore) Delete(ctx context.Context, prID, reviewerID int64) error
Delete deletes the pull request reviewer.
func (*ReviewerOrmStore) Find ¶
func (s *ReviewerOrmStore) Find(ctx context.Context, prID, principalID int64) (*types.PullReqReviewer, error)
Find finds the pull request reviewer by pull request id and principal id.
func (*ReviewerOrmStore) List ¶
func (s *ReviewerOrmStore) List(ctx context.Context, prID int64) ([]*types.PullReqReviewer, error)
List returns a list of pull reviewers for a pull request.
func (*ReviewerOrmStore) Update ¶
func (s *ReviewerOrmStore) Update(ctx context.Context, v *types.PullReqReviewer) error
Update updates the pull request reviewer.