package
1.24.0-dev
Repository: https://github.com/go-gitea/gitea.git
Documentation: pkg.go.dev

# Functions

AddDeletePRBranchComment adds delete branch comment for pull request issue.
AddReviewRequest add a review request from one reviewer.
AddTeamReviewRequest add a review request from one team.
AddTime will add the given time (in seconds) to the issue.
BuildLabelNamesIssueIDsCondition returns a builder where get issue ids match label names.
CancelStopwatch removes the given stopwatch and logs it into issue's timeline.
CanMaintainerWriteToBranch check whether user is a maintainer and could write to the branch.
CanMarkConversation Add or remove Conversation mark for a code comment permission check the PR writer , offfcial reviewer and poster can do it.
ChangeIssueContent changes issue content, as the given user.
ChangeIssueRef changes the branch of this issue, as the given user.
ChangeIssueStatus changes issue status to open or closed.
ChangeIssueTimeEstimate changes the plan time of this issue, as the given user.
ChangeIssueTitle changes the title of this issue, as the given user.
ChangeMilestoneStatus changes the milestone open/closed status.
ChangeMilestoneStatusByRepoIDAndID changes a milestone open/closed status if the milestone ID is in the repo.
CheckIssueWatch check if an user is watching an issue it takes participants and repo watch into account.
ClearIssueLabels removes all issue labels as the given user.
CommentHashTag returns unique hash tag for comment id.
CommentTypeIsRef returns true if CommentType is a reference from another issue.
CountComments count all comments according options by ignoring pagination.
CountCommentTypeLabelWithEmptyLabel count label comments with empty label.
CountCommentTypeLabelWithOutsideLabels count label comments with outside label.
CountIssueLabelWithOutsideLabels count label comments with outside label.
CountIssues number return of issues by given conditions.
CountIssuesByRepo map from repoID to number of issues matching the options.
CountIssueWatchers count watchers/unwatchers of a given issue.
CountLabelsByOrgID count all labels that belong to given organization by ID.
CountLabelsByRepoID count number of all labels that belong to given repository by ID.
CountMilestonesByRepoCondAndKw map from repo conditions and the keyword of milestones' name to number of milestones matching the options`.
CountOrphanedIssueLabels return count of IssueLabels witch have no label behind anymore.
CountOrphanedIssues count issues without a repo.
CountOrphanedLabels return count of labels witch are broken and not accessible via ui anymore.
CountReviews returns count of reviews passing FindReviewOptions.
CountTrackedTimes returns count of tracked times that fit to the given options.
CountUserStopwatches return count of all stopwatches of a user.
CreateAutoMergeComment is a internal function, only use it for CommentTypePRScheduledToAutoMerge and CommentTypePRUnScheduledToAutoMerge CommentTypes.
CreateComment creates comment with context.
CreateIssueDependency creates a new dependency for an issue.
CreateIssueStopwatch creates a stopwatch if not exist, otherwise return an error.
CreateOrStopIssueStopwatch create an issue stopwatch if it's not exist, otherwise finish it.
CreateOrUpdateIssueWatch set watching for a user and issue.
CreateReaction creates reaction for issue or comment.
CreateReview creates a new review based on opts.
DeleteComment deletes the comment.
DeleteCommentReaction deletes a reaction on comment.
DeleteIssueLabel deletes issue-label relation.
DeleteIssueReaction deletes a reaction on issue.
DeleteIssuesByRepoID deletes issues by repositories id.
DeleteIssueUserTimes deletes times for issue.
DeleteLabel delete a label.
DeleteLabelsByRepoID deletes labels of some repository.
DeleteMilestoneByRepoID deletes a milestone from a repository.
DeleteOrphanedIssueLabels delete IssueLabels witch have no label behind anymore.
DeleteOrphanedIssues delete issues without a repo.
DeleteOrphanedLabels delete labels witch are broken and not accessible via ui anymore.
DeletePullsByBaseRepoID deletes all pull requests by the base repository ID.
DeleteReaction deletes reaction for issue or comment.
DeleteReview delete a review and it's code comments.
DeleteTime delete a specific Time.
DismissReview change the dismiss status of a review.
FetchCodeComments will return a 2d-map: ["Path"]["Line"] = Comments at line.
FetchCodeCommentsByLine fetches the code comments for a given treePath and line number.
FetchIssueContentHistoryList fetch list.
FindAndUpdateIssueMentions finds users mentioned in the given content string, and saves them in the database.
FindCommentReactions returns a ReactionList of all reactions from an comment.
FindComments returns all comments according options.
FindIssueReactions returns a ReactionList of all reactions from an issue.
FindLatestReviews returns only latest reviews per user, passing FindReviewOptions.
FindReactions returns a ReactionList of all reactions from an issue or a comment.
FindReviews returns reviews passing FindReviewOptions.
FinishIssueStopwatch if stopwatch exist then finish it otherwise return an error.
FinishIssueStopwatchIfPossible if stopwatch exist then finish it otherwise ignore.
FixCommentTypeLabelWithEmptyLabel count label comments with empty label.
FixCommentTypeLabelWithOutsideLabels count label comments with outside label.
FixIssueLabelWithOutsideLabels fix label comments with outside label.
GetAllUnmergedAgitPullRequestByPoster get all unmerged agit flow pull request By poster id.
GetAssigneeIDsByIssue returns the IDs of users assigned to an issue but skips joining with `user` for performance reasons.
GetCodeOwnersFromContent returns the code owners configuration Return empty slice if files missing Return warning messages on parsing errors We're trying to do the best we can when parsing a file.
GetCommentByID returns the comment by given ID.
GetCurrentReview returns the current pending review of reviewer for given issue.
GetGrantedApprovalsCount returns the number of granted approvals for pr.
GetIssueByID returns an issue by given ID.
GetIssueByIndex returns raw issue without loading attributes by index in a repository.
GetIssueContentHistoryAndPrev get a history and the previous non-deleted history (to compare).
GetIssueContentHistoryByID get issue content history.
GetIssueIDsByRepoID returns all issue ids by repo id.
GetIssueMentionIDs returns all mentioned user IDs of an issue.
GetIssuesByIDs return issues with the given IDs.
GetIssueStats returns issue statistic information by given conditions.
GetIssueTotalTrackedTime returns the total tracked time for issues by given conditions.
GetIssueWatch returns all IssueWatch objects from db by user and issue the current Web-UI need iw object for watchers AND explicit non-watchers.
GetIssueWatchers returns watchers/unwatchers of a given issue.
GetIssueWatchersIDs returns IDs of subscribers or explicit unsubscribers to a given issue id but avoids joining with `user` for performance reasons User permissions must be verified elsewhere if required.
GetIssueWithAttrsByIndex returns issue by index in a repository.
GetLabelByID returns a label by given ID.
GetLabelIDsByNames returns a list of labelIDs by names.
GetLabelIDsInRepoByNames returns a list of labelIDs by names in a given repository.
GetLabelInOrgByID returns a label by ID in given organization.
GetLabelInOrgByName returns a label by name in given organization.
GetLabelInRepoByID returns a label by ID in given repository.
GetLabelInRepoByName returns a label by name in given repository.
GetLabelsByIDs returns a list of labels by IDs.
GetLabelsByIssueID returns all labels that belong to given issue by ID.
GetLabelsByOrgID returns all labels that belong to given organization by ID.
GetLabelsByRepoID returns all labels that belong to given repository by ID.
GetLabelsInOrgByIDs returns a list of labels by IDs in given organization, it silently ignores label IDs that do not belong to the organization.
GetLabelsInRepoByIDs returns a list of labels by IDs in given repository, it silently ignores label IDs that do not belong to the repository.
GetLatestPullRequestByHeadInfo returns the latest pull request (regardless of its status) by given head information (repo and branch).
GetMilestoneByRepoID returns the milestone in a repository.
GetMilestoneByRepoIDANDName return a milestone if one exist by name and repo.
GetMilestoneIDsByNames returns a list of milestone ids by given names.
GetMilestonesStatsByRepoCondAndKw returns milestone statistic information for dashboard by given repo conditions and name keyword.
GetParticipantsIDsByIssueID returns the IDs of all users who participated in comments of an issue, but skips joining with `user` for performance reasons.
GetPinnedIssues returns the pinned Issues for the given Repo and type.
GetPullRequestByBaseHeadInfo returns the pull request by given base and head.
GetPullRequestByID returns a pull request by given ID.
GetPullRequestByIndex returns a pull request by the given index.
GetPullRequestByIssueID returns pull request by given issue ID.
GetPullRequestByIssueIDs returns all pull requests by issue ids.
GetPullRequestByIssueIDWithNoAttributes returns pull request with no attributes loaded by given issue ID.
GetPullRequestByMergedCommit returns a merged pull request by the given commit.
GetPullRequestIDsByCheckStatus returns all pull requests according the special checking status.
GetReviewByID returns the review by the given ID.
GetReviewByIssueIDAndUserID get the latest review of reviewer for a pull request.
GetReviewersFromOriginalAuthorsByIssueID gets the latest review of each original authors for a pull request.
GetReviewsByIssueID gets the latest review of each reviewer for a pull request.
GetTeamReviewerByIssueIDAndTeamID get the latest review request of reviewer team for a pull request.
GetTrackedSeconds return sum of seconds.
GetTrackedTimeByID returns raw TrackedTime without loading attributes by id.
GetTrackedTimes returns all tracked times that fit to the given options.
GetUIDsAndNotificationCounts between the two provided times.
GetUnmergedPullRequest returns a pull request that is open and has not been merged by given head/base and repo/branch.
GetUnmergedPullRequestsByBaseInfo returns all pull requests that are open and has not been merged by given base information (repo and branch).
GetUnmergedPullRequestsByHeadInfo returns all pull requests that are open and has not been merged.
GetUserStopwatches return list of all stopwatches of a user.
HasEnoughApprovals returns true if pr has enough granted approvals.
HasIssueContentHistory check if a ContentHistory entry exists.
HasIssueLabel returns true if issue has been labeled.
HasMergedPullRequestInRepo returns whether the user(poster) has merged pull-request in the repo.
HasMilestoneByRepoID returns if the milestone exists in the repository.
HasUnmergedPullRequestsByHeadInfo checks if there are open and not merged pull request by given head information (repo and branch).
HasUserStopwatch returns true if the user has a stopwatch.
HasWorkInProgressPrefix determines if the given PR title has a Work In Progress prefix.
InsertIssueComments inserts many comments of issues.
InsertIssues insert issues to database.
InsertMilestones creates milestones of repository.
InsertPullRequests inserted pull requests.
InsertReviews inserts review and review comments.
IsContentEmptyErr returns true if err is a ContentEmptyErr.
IsErrCircularDependency checks if an error is a ErrCircularDependency.
IsErrCommentNotExist checks if an error is a ErrCommentNotExist.
IsErrDependenciesLeft checks if an error is a ErrDependenciesLeft.
IsErrDependencyExists checks if an error is a ErrDependencyExists.
IsErrDependencyNotExists checks if an error is a ErrDependencyExists.
IsErrForbiddenIssueReaction checks if an error is a ErrForbiddenIssueReaction.
IsErrIssueIsClosed checks if an error is a ErrIssueNotExist.
IsErrIssueMaxPinReached returns if the error is, that the User can't pin more Issues.
IsErrIssueNotExist checks if an error is a ErrIssueNotExist.
IsErrIssueWasClosed checks if an error is a ErrIssueWasClosed.
IsErrLabelNotExist checks if an error is a ErrLabelNotExist.
IsErrMilestoneNotExist checks if an error is a ErrMilestoneNotExist.
IsErrNewIssueInsert checks if an error is a ErrNewIssueInsert.
IsErrNotValidReviewRequest checks if an error is a ErrNotValidReviewRequest.
IsErrOrgLabelNotExist checks if an error is a OrgErrLabelNotExist.
IsErrPullRequestAlreadyExists checks if an error is a ErrPullRequestAlreadyExists.
IsErrPullRequestNotExist checks if an error is a ErrPullRequestNotExist.
IsErrPullWasClosed checks if an error is a ErrErrPullWasClosed.
IsErrReactionAlreadyExist checks if an error is a ErrReactionAlreadyExist.
IsErrRepoLabelNotExist checks if an error is a RepoErrLabelNotExist.
IsErrReviewNotExist checks if an error is a ErrReviewNotExist.
IsErrReviewRequestOnClosedPR checks if an error is an ErrReviewRequestOnClosedPR.
IsErrUnknownDependencyType checks if an error is ErrUnknownDependencyType.
IsNewPinAllowed returns if a new Issue or Pull request can be pinned.
IsOfficialReviewer check if at least one of the provided reviewers can make official reviews in issue (counts towards required approvals).
IsOfficialReviewerTeam check if reviewer in this team can make official reviews in issue (counts towards required approvals).
IssueAssignOrRemoveProject changes the project associated with an issue If newProjectID is 0, the issue is removed from the project.
IssueIDs returns a list of issue ids by given conditions.
IssueNoDependenciesLeft checks if issue can be closed.
Issues returns a list of issues by given conditions.
IsUserAssignedToIssue returns true when the user is assigned to the issue.
IsUserParticipantsOfIssue return true if user is participants of an issue.
KeepLimitedContentHistory keeps at most `limit` history revisions, it will hard delete out-dated revisions, sorting by revision interval we can ignore all errors in this function, so we just log them.
LoadIssuesFromColumn load issues assigned to this column.
LoadIssuesFromColumnList load issues assigned to the columns.
LockIssue locks an issue.
MakeIDsFromAPIAssigneesToAdd returns an array with all assignee IDs.
MarkConversation Add or remove Conversation mark for a code comment.
MarkReviewsAsNotStale marks existing reviews as not stale for a giving commit SHA.
MarkReviewsAsStale marks existing reviews as stale.
MergeBlockedByOfficialReviewRequests block merge because of some review request to official reviewer of from official review.
MergeBlockedByOutdatedBranch returns true if merge is blocked by an outdated head branch.
MergeBlockedByRejectedReview returns true if merge is blocked by rejected reviews.
NewIssue creates new issue with labels for repository.
NewIssueLabel creates a new issue-label relation.
NewIssueLabels creates a list of issue-label relations.
NewIssueUsers inserts an issue related users.
NewIssueWithIndex creates issue with given index.
NewLabel creates a new label.
NewLabels creates new labels.
NewMilestone creates new milestone of repository.
NewPullRequest creates new pull request with labels for repository.
PullRequests returns all pull requests for a base Repo by the given conditions.
QueryIssueContentHistoryEditedCountMap query related history count of each comment (comment_id = 0 means the main issue) only return the count map for "edited" (history revision count > 1) issues or comments.
RecalculateIssueIndexForRepo create issue_index for repo if not exist and update it based on highest index of existing issues assigned to a repo.
Remove all issue labels in the given exclusive scope.
Ensure only one label of a given scope exists, with labels at the end of the array getting preference over earlier ones.
RemoveIssueDependency removes a dependency from an issue.
RemoveIssueWatchersByRepoID remove issue watchers by repoID.
RemoveReviewRequest remove a review request from one reviewer.
RemoveTeamReviewRequest remove a review request from one team.
ReplaceIssueLabels removes all current labels and add new labels to the issue.
ResolveIssueMentionsByVisibility returns the users mentioned in an issue, removing those that don't have access to reading it.
ReviewExists returns whether a review exists for a particular line of code in the PR.
SaveIssueContentHistory save history.
SoftDeleteIssueContentHistory soft delete.
StopwatchExists returns true if the stopwatch exists.
SubmitReview creates a review out of the existing pending review or creates a new one if no pending review exist.
ToggleIssueAssignee changes a user between assigned and not assigned for this issue, and make issue comment for it.
TotalTimesForEachUser returns the spent time in seconds for each user by an issue.
UnlockIssue unlocks a previously locked issue.
UpdateAllowEdits update if PR can be edited from maintainers.
UpdateComment updates information of comment.
UpdateCommentInvalidate updates comment invalidated column.
UpdateCommentsMigrationsByType updates comments' migrations information via given git service type and original id and poster id.
UpdateIssueAttachments update attachments by UUIDs for the issue.
UpdateIssueCols updates cols of issue.
UpdateIssueDeadline updates an issue deadline and adds comments.
UpdateIssueMentions updates issue-user relations for mentioned users.
UpdateIssuesMigrationsByType updates all migrated repositories' issues from gitServiceType to replace originalAuthorID to posterID.
UpdateIssueUserByRead updates issue-user relation for reading.
UpdateIssueUsersByMentions updates issue-user pairs by mentioning.
UpdateLabel updates label information.
UpdateMilestone updates information of given milestone.
UpdateMilestoneCounters calculates NumIssues, NumClosesIssues and Completeness.
UpdateReactionsMigrationsByType updates all migrated repositories' reactions from gitServiceType to replace originalAuthorID to posterID.
UpdateReviewsMigrationsByType updates reviews' migrations information via given git service type and original id and poster id.

# Constants

19 Dependency added.
16 Added a due date.
14 Add time manual for time tracking.
9 Assignees changed.
15 Cancel a stopwatch for time tracking.
33 Change issue ref.
25 Change pull request's target branch.
38 Change time estimate.
10 Change Title.
2.
21 Comment a line of code.
0 Plain comment, can be associated with a commit (CommitID > 0) and a line (LineNum > 0).
5 Reference from a comment.
4 Reference from a commit (not part of a pull request).
11 Delete Branch.
26 Delete time manual for time tracking.
32 Dismiss Review.
3 References.
7 Labels changed.
23 Lock an issue, giving only collaborators access.
28 merge pull request.
8 Milestone changed.
17 Modified the due date.
36 pin Issue.
30 Project changed.
31 Project column changed.
34 pr was scheduled to auto merge when checks succeed.
35 pr was un scheduled to auto merge when checks succeed.
6 Reference from a pull request.
29 push to PR head branch.
18 Removed a due date.
20 Dependency removed.
1.
22 Reviews a pull request by giving general feedback.
27 add or remove Request from one.
12 Start a stopwatch for time tracking.
13 Stop a stopwatch for time tracking.
CommentTypeUndefined is used to search for comments of any type.
24 Unlocks a previously locked issue.
37 unpin Issue.
Define Dependency Types.
Define Dependency Types.
Filter modes.
Filter modes.
Filter modes.
Filter modes.
Filter modes.
Filter modes.
Filter modes.
MaxQueryParameters represents the max query parameters When queries are broken down in parts because of the number of parameters, attempt to break by this amount.
PullRequestFlowAGit Agit flow pull request, head branch is not exist.
PullRequestFlowGithub github flow from head branch to base branch.
Enumerate all the pull request types.
Enumerate all the pull request types.
Enumerate all the pull request status.
Enumerate all the pull request status.
Enumerate all the pull request status.
Enumerate all the pull request status.
Enumerate all the pull request status.
Enumerate all the pull request status.
Enumerate all the pull request status.
ReviewTypeApprove approves changes.
ReviewTypeComment gives general feedback.
ReviewTypePending is a review which is not published yet.
ReviewTypeReject gives feedback blocking merge.
ReviewTypeRequest request review from others.
ReviewTypeUnknown unknown review type.
Enumerate all the role tags.
Enumerate all the role tags.
Enumerate all the role tags.
Enumerate all the role tags.
Enumerate all the role tags.

# Variables

# Structs

Comment represents a comment in commit and issue page.
CommentMetaData stores metadata for a comment, these data will not be changed once inserted into database.
ContentEmptyErr represents an content empty error.
ContentHistory save issue/comment content history revisions.
CreateCommentOptions defines options for creating comment.
CreateReviewOptions represent the options to create a review.
DependencyInfo represents high level information about an issue which is a dependency of another issue.
ErrCircularDependency represents a "DependencyCircular" kind of error.
ErrCommentNotExist represents a "CommentNotExist" kind of error.
ErrDependenciesLeft represents an error where the issue you're trying to close still has dependencies left.
ErrDependencyExists represents a "DependencyAlreadyExists" kind of error.
ErrDependencyNotExists represents a "DependencyAlreadyExists" kind of error.
ErrForbiddenIssueReaction is used when a forbidden reaction was try to created.
ErrIssueContentHistoryNotExist not exist error.
ErrIssueIsClosed represents a "IssueIsClosed" kind of error.
ErrIssueNotExist represents a "IssueNotExist" kind of error.
ErrIssueStopwatchNotExist represents an error that stopwatch is not exist.
ErrIssueWasClosed is used when close a closed issue.
ErrLabelNotExist represents a "LabelNotExist" kind of error.
ErrMilestoneNotExist represents a "MilestoneNotExist" kind of error.
ErrNewIssueInsert is used when the INSERT statement in newIssue fails.
ErrNotValidReviewRequest an not allowed review request modify.
ErrOrgLabelNotExist represents a "OrgLabelNotExist" kind of error.
ErrPullRequestAlreadyExists represents a "PullRequestAlreadyExists"-error.
ErrPullRequestNotExist represents a "PullRequestNotExist" kind of error.
ErrPullWasClosed is used close a closed pull request.
ErrReactionAlreadyExist is used when a existing reaction was try to created.
ErrRepoLabelNotExist represents a "RepoLabelNotExist" kind of error.
ErrReviewNotExist represents a "ReviewNotExist" kind of error.
ErrReviewRequestOnClosedPR represents an error when an user tries to request a re-review on a closed or merged PR.
ErrUnknownDependencyType represents an error where an unknown dependency type was passed.
ErrUserMustCollaborator represents an error that the user must be a collaborator to a given repo.
FindCommentsOptions describes the conditions to Find comments.
FindMilestoneOptions contain options to get milestones.
FindReactionsOptions describes the conditions to Find reactions.
FindReviewOptions represent possible filters to find reviews.
FindTrackedTimesOptions represent the filters for tracked times.
Issue represents an issue or pull request of repository.
IssueAssignees saves all issue assignees.
IssueContentListItem the list for web ui.
IssueDependency represents an issue dependency.
IssueLabel represents an issue-label relation.
IssueLockOptions defines options for locking and/or unlocking an issue/PR.
IssuesOptions represents options of an issue.
IssueStats represents issue statistic information.
IssueUser represents an issue-user relation.
IssueWatch is connection request for receiving issue notification.
Label represents a label of repository for issues.
Milestone represents a milestone of repository.
MilestonesStats represents milestone statistic information.
NewIssueOptions represents the options of a new issue.
PullRequest represents relation between pull request and repositories.
PullRequestsOptions holds the options for PRs.
PushActionContent is content of push pull comment.
Reaction represents a reactions on issues and comments.
ReactionOptions defines options for creating or deleting reactions.
Review represents collection of code comments giving feedback for a PR.
ReviewCount represents a count of Reviews.
RoleDescriptor defines comment "role" tags.
Stopwatch represents a stopwatch for time tracking.
TrackedTime represents a time that was spent for a specific issue.
UserIDCount is a simple coalition of UserID and Count.

# Type aliases

CodeComments represents comments on code by using this structure: FILENAME -> LINE (+ == proposed; - == previous) -> COMMENTS.
CommentList defines a list of comments.
CommentType defines whether a comment is just a simple comment, an action (like close) or a reference.
DependencyType Defines Dependency Type Constants.
IssueIndex represents the issue index table.
IssueList defines a list of issues.
IssueWatchList contains IssueWatch.
MilestoneList is a list of milestones offering additional functionality.
PullRequestFlow the flow of pull request.
PullRequestList defines a list of pull requests.
PullRequestStatus defines pull request status.
PullRequestType defines pull request type.
ReactionList represents list of reactions.
ReviewType defines the sort of feedback a review gives.
RoleInRepo presents the user's participation in the repo.
TrackedTimeList is a List of TrackedTime's.