Documentation ¶
Index ¶
- Constants
- Variables
- func AccessLevel(user *user_model.User, repo *repo_model.Repository) (perm_model.AccessMode, error)
- func AccessLevelUnit(user *user_model.User, repo *repo_model.Repository, unitType unit.Type) (perm_model.AccessMode, error)
- func AccessTokenByNameExists(token *AccessToken) (bool, error)
- func AccessibleRepoIDsQuery(user *user_model.User) *builder.Builder
- func AddCollaborator(repo *repo_model.Repository, u *user_model.User) error
- func AddDeletePRBranchComment(doer *user_model.User, repo *repo_model.Repository, issueID int64, ...) error
- func AddDeletedBranch(repoID int64, branchName, commit string, deletedByID int64) error
- func AddOrgUser(orgID, uid int64) error
- func AddReleaseAttachments(ctx context.Context, releaseID int64, attachmentUUIDs []string) (err error)
- func AddTeamMember(team *Team, userID int64) error
- func BuildLabelNamesIssueIDsCondition(labelNames []string) *builder.Builder
- func CanBeAssigned(user *user_model.User, repo *repo_model.Repository, isPull bool) (bool, error)
- func CanCreateOrgRepo(orgID, uid int64) (bool, error)
- func CanMarkConversation(issue *Issue, doer *user_model.User) (permResult bool, err error)
- func CanUserDelete(repo *repo_model.Repository, user *user_model.User) (bool, error)
- func CanUserForkRepo(user *user_model.User, repo *repo_model.Repository) (bool, error)
- func CancelRepositoryTransfer(repo *repo_model.Repository) error
- func CancelStopwatch(user *user_model.User, issue *Issue) error
- func ChangeCollaborationAccessMode(repo *repo_model.Repository, uid int64, mode perm.AccessMode) error
- func ChangeMilestoneAssign(issue *Issue, doer *user_model.User, oldMilestoneID int64) (err error)
- func ChangeMilestoneStatus(m *Milestone, isClosed bool) (err error)
- func ChangeMilestoneStatusByRepoIDAndID(repoID, milestoneID int64, isClosed bool) error
- func ChangeOrgUserStatus(orgID, uid int64, public bool) error
- func ChangeProjectAssign(issue *Issue, doer *user_model.User, newProjectID int64) error
- func ChangeProjectStatus(p *Project, isClosed bool) error
- func ChangeProjectStatusByRepoIDAndID(repoID, projectID int64, isClosed bool) error
- func CheckDaemonExportOK(ctx context.Context, repo *repo_model.Repository) error
- func CheckIssueWatch(user *user_model.User, issue *Issue) (bool, error)
- func CheckLFSAccessForRepo(ownerID int64, repo *repo_model.Repository, mode perm.AccessMode) error
- func CheckRepoStats(ctx context.Context) error
- func CheckRepoUnitUser(repo *repo_model.Repository, user *user_model.User, unitType unit.Type) bool
- func CommentHashTag(id int64) string
- func CommentTypeIsRef(t CommentType) bool
- func CopyLFS(ctx context.Context, newRepo, oldRepo *repo_model.Repository) error
- func CountAccessTokens(opts ListAccessTokensOptions) (int64, error)
- func CountCollaborators(repoID int64) (int64, error)
- func CountCommentTypeLabelWithEmptyLabel() (int64, error)
- func CountCommentTypeLabelWithOutsideLabels() (int64, error)
- func CountComments(opts *FindCommentsOptions) (int64, error)
- func CountIssueLabelWithOutsideLabels() (int64, error)
- func CountIssueWatchers(issueID int64) (int64, error)
- func CountIssues(opts *IssuesOptions) (int64, error)
- func CountIssuesByRepo(opts *IssuesOptions) (map[int64]int64, error)
- func CountLFSLockByRepoID(repoID int64) (int64, error)
- func CountLFSMetaObjects(repoID int64) (int64, error)
- func CountLabelsByOrgID(orgID int64) (int64, error)
- func CountLabelsByRepoID(repoID int64) (int64, error)
- func CountMilestonesByRepoCond(repoCond builder.Cond, isClosed bool) (map[int64]int64, error)
- func CountMilestonesByRepoCondAndKw(repoCond builder.Cond, keyword string, isClosed bool) (map[int64]int64, error)
- func CountNotifications(opts *FindNotificationOptions) (int64, error)
- func CountNullArchivedRepository() (int64, error)
- func CountOrgMembers(opts *FindOrgMembersOpts) (int64, error)
- func CountOrganizations() int64
- func CountOrgs(opts FindOrgOptions) (int64, error)
- func CountOrphanedIssueLabels() (int64, error)
- func CountOrphanedIssues() (int64, error)
- func CountOrphanedLabels() (int64, error)
- func CountOrphanedObjects(subject, refobject, joinCond string) (int64, error)
- func CountReleasesByRepoID(repoID int64, opts FindReleasesOptions) (int64, error)
- func CountRepoClosedMilestones(repoID int64) (int64, error)
- func CountReviews(opts FindReviewOptions) (int64, error)
- func CountTrackedTimes(opts *FindTrackedTimesOptions) (int64, error)
- func CountUnread(user *user_model.User) int64
- func CountUserStopwatches(userID int64) (int64, error)
- func CountWrongUserType() (int64, error)
- func CreateIssueDependency(user *user_model.User, issue, dep *Issue) error
- func CreateIssueStopwatch(ctx context.Context, user *user_model.User, issue *Issue) error
- func CreateOrStopIssueStopwatch(user *user_model.User, issue *Issue) error
- func CreateOrUpdateIssueNotifications(issueID, commentID, notificationAuthorID, receiverID int64) error
- func CreateOrUpdateIssueWatch(userID, issueID int64, isWatching bool) error
- func CreateOrganization(org *Organization, owner *user_model.User) (err error)
- func CreatePendingRepositoryTransfer(doer, newOwner *user_model.User, repoID int64, teams []*Team) error
- func CreateRefComment(doer *user_model.User, repo *repo_model.Repository, issue *Issue, ...) error
- func CreateRepoTransferNotification(doer, newOwner *user_model.User, repo *repo_model.Repository) error
- func CreateRepository(ctx context.Context, doer, u *user_model.User, repo *repo_model.Repository, ...) (err error)
- func CreateTask(task *Task) error
- func CreateTemporaryPath(prefix string) (string, error)
- func DecrementRepoForkNum(ctx context.Context, repoID int64) error
- func DeleteAccessTokenByID(id, userID int64) error
- func DeleteCollaboration(repo *repo_model.Repository, uid int64) (err error)
- func DeleteComment(comment *Comment) error
- func DeleteCommentReaction(doer *user_model.User, issue *Issue, comment *Comment, content string) error
- func DeleteDeployKey(ctx context.Context, doer *user_model.User, id int64) error
- func DeleteIssueLabel(issue *Issue, label *Label, doer *user_model.User) (err error)
- func DeleteIssueReaction(doer *user_model.User, issue *Issue, content string) error
- func DeleteIssueUserTimes(issue *Issue, user *user_model.User) error
- func DeleteLabel(id, labelID int64) error
- func DeleteMilestoneByRepoID(repoID, id int64) error
- func DeleteOldActions(olderThan time.Duration) (err error)
- func DeleteOrganization(ctx context.Context, org *Organization) error
- func DeleteOrphanedIssueLabels() error
- func DeleteOrphanedIssues() error
- func DeleteOrphanedLabels() error
- func DeleteOrphanedObjects(subject, refobject, joinCond string) error
- func DeleteProjectBoardByID(boardID int64) error
- func DeleteProjectByID(id int64) error
- func DeleteProtectedBranch(repoID, id int64) (err error)
- func DeleteProtectedTag(pt *ProtectedTag) error
- func DeleteReaction(opts *ReactionOptions) error
- func DeleteReleaseByID(id int64) error
- func DeleteRepository(doer *user_model.User, uid, repoID int64) error
- func DeleteReview(r *Review) error
- func DeleteTeam(t *Team) error
- func DeleteTime(t *TrackedTime) error
- func DeleteUploadByUUID(uuid string) error
- func DeleteUploads(uploads ...*Upload) (err error)
- func DeleteUser(ctx context.Context, u *user_model.User) (err error)
- func DismissReview(review *Review, isDismiss bool) (err error)
- func DoctorUserStarNum() (err error)
- func FindOrgMembers(opts *FindOrgMembersOpts) (user_model.UserList, map[int64]bool, error)
- func FindRepoRecentCommitStatusContexts(repoID int64, before time.Duration) ([]string, error)
- func FindUserAccessibleRepoIDs(user *user_model.User) ([]int64, error)
- func FindUserOrgForks(repoID, userID int64) ([]*repo_model.Repository, error)
- func FinishIssueStopwatch(ctx context.Context, user *user_model.User, issue *Issue) error
- func FinishIssueStopwatchIfPossible(ctx context.Context, user *user_model.User, issue *Issue) error
- func FinishMigrateTask(task *Task) error
- func FixCommentTypeLabelWithEmptyLabel() (int64, error)
- func FixCommentTypeLabelWithOutsideLabels() (int64, error)
- func FixIssueLabelWithOutsideLabels() (int64, error)
- func FixNullArchivedRepository() (int64, error)
- func FixWrongUserType() (int64, error)
- func FullPushingEnvironment(author, committer *user_model.User, repo *repo_model.Repository, ...) []string
- func GenerateIssueLabels(ctx context.Context, templateRepo, generateRepo *repo_model.Repository) error
- func GenerateWebhooks(ctx context.Context, templateRepo, generateRepo *repo_model.Repository) error
- func GetAssigneeIDsByIssue(issueID int64) ([]int64, error)
- func GetAssigneesByIssue(issue *Issue) (assignees []*user_model.User, err error)
- func GetForksByUserAndOrgs(user *user_model.User, repo *repo_model.Repository) ([]*repo_model.Repository, error)
- func GetIssueIDsByRepoID(repoID int64) ([]int64, error)
- func GetIssueWatchersIDs(issueID int64, watching bool) ([]int64, error)
- func GetLabelIDsInOrgByNames(orgID int64, labelNames []string) ([]int64, error)
- func GetLabelIDsInRepoByNames(repoID int64, labelNames []string) ([]int64, error)
- func GetLabelTemplateFile(name string) ([][3]string, error)
- func GetNextCommitStatusIndex(repoID int64, sha string) (int64, error)
- func GetNotificationCount(user *user_model.User, status NotificationStatus) (int64, error)
- func GetOrganizationCount(ctx context.Context, u *user_model.User) (int64, error)
- func GetParticipantsIDsByIssueID(issueID int64) ([]int64, error)
- func GetPullRequestIDsByCheckStatus(status PullRequestStatus) ([]int64, error)
- func GetReleaseAttachments(rels ...*Release) (err error)
- func GetReleaseCountByRepoID(repoID int64, opts FindReleasesOptions) (int64, error)
- func GetRepoAssignees(repo *repo_model.Repository) (_ []*user_model.User, err error)
- func GetRepoIDsForIssuesOptions(opts *IssuesOptions, user *user_model.User) ([]int64, error)
- func GetRepoInitFile(tp, name string) ([]byte, error)
- func GetRepoIssueStats(repoID, uid int64, filterMode int, isPull bool) (numOpen, numClosed int64)
- func GetRepoReaders(repo *repo_model.Repository) (_ []*user_model.User, err error)
- func GetRepoWriters(repo *repo_model.Repository) (_ []*user_model.User, err error)
- func GetRepositoryFromMatch(ownerName, repoName string) (*repo_model.Repository, error)
- func GetReviewers(repo *repo_model.Repository, doerID, posterID int64) ([]*user_model.User, error)
- func GetStarredRepos(userID int64, private bool, listOptions db.ListOptions) ([]*repo_model.Repository, error)
- func GetTeamIDsByNames(orgID int64, names []string, ignoreNonExistent bool) ([]int64, error)
- func GetTeamMembers(teamID int64) ([]*user_model.User, error)
- func GetTeamNamesByID(teamIDs []int64) ([]string, error)
- func GetTrackedSeconds(opts FindTrackedTimesOptions) (int64, error)
- func GetUserRepositories(opts *SearchRepoOptions) ([]*repo_model.Repository, int64, error)
- func GetUsersWhoCanCreateOrgRepo(orgID int64) ([]*user_model.User, error)
- func GetWatchedRepos(userID int64, private bool, listOptions db.ListOptions) ([]*repo_model.Repository, int64, error)
- func GetYamlFixturesAccess() (string, error)
- func HasAccess(userID int64, repo *repo_model.Repository) (bool, error)
- func HasAccessUnit(user *user_model.User, repo *repo_model.Repository, unitType unit.Type, ...) (bool, error)
- func HasIssueLabel(issueID, labelID int64) bool
- func HasOrgOrUserVisible(org, user *user_model.User) bool
- func HasOrgsVisible(orgs []*Organization, user *user_model.User) bool
- func HasTeamRepo(orgID, teamID, repoID int64) bool
- func HasUnmergedPullRequestsByHeadInfo(repoID int64, branch string) (bool, error)
- func HasWorkInProgressPrefix(title string) bool
- func IncrementRepoForkNum(ctx context.Context, repoID int64) error
- func InitializeLabels(ctx context.Context, repoID int64, labelTemplate string, isOrg bool) error
- func InsertIssueComments(comments []*Comment) error
- func InsertIssues(issues ...*Issue) error
- func InsertMilestones(ms ...*Milestone) (err error)
- func InsertProtectedTag(pt *ProtectedTag) error
- func InsertPullRequests(prs ...*PullRequest) error
- func InsertRelease(rel *Release) error
- func InsertReleases(rels ...*Release) error
- func InsertReleasesContext(ctx context.Context, rels []*Release) error
- func InsertReviews(reviews []*Review) error
- func InternalPushingEnvironment(doer *user_model.User, repo *repo_model.Repository) []string
- func IsCollaborator(repoID, userID int64) (bool, error)
- func IsContentEmptyErr(err error) bool
- func IsErrAccessTokenEmpty(err error) bool
- func IsErrAccessTokenNotExist(err error) bool
- func IsErrBranchAlreadyExists(err error) bool
- func IsErrBranchDoesNotExist(err error) bool
- func IsErrBranchNameConflict(err error) bool
- func IsErrBranchesEqual(err error) bool
- func IsErrCircularDependency(err error) bool
- func IsErrCommentNotExist(err error) bool
- func IsErrCommitIDDoesNotMatch(err error) bool
- func IsErrDependenciesLeft(err error) bool
- func IsErrDependencyExists(err error) bool
- func IsErrDependencyNotExists(err error) bool
- func IsErrErrPullRequestHeadRepoMissing(err error) bool
- func IsErrFilePathInvalid(err error) bool
- func IsErrFilePathProtected(err error) bool
- func IsErrFilenameInvalid(err error) bool
- func IsErrForbiddenIssueReaction(err error) bool
- func IsErrForkAlreadyExist(err error) bool
- func IsErrInvalidCloneAddr(err error) bool
- func IsErrInvalidMergeStyle(err error) bool
- func IsErrInvalidTagName(err error) bool
- func IsErrIssueIsClosed(err error) bool
- func IsErrIssueLabelTemplateLoad(err error) bool
- func IsErrIssueNotExist(err error) bool
- func IsErrIssueWasClosed(err error) bool
- func IsErrLFSFileLocked(err error) bool
- func IsErrLFSLockAlreadyExist(err error) bool
- func IsErrLFSLockNotExist(err error) bool
- func IsErrLFSUnauthorizedAction(err error) bool
- func IsErrLabelNotExist(err error) bool
- func IsErrLastOrgOwner(err error) bool
- func IsErrMergeConflicts(err error) bool
- func IsErrMergeUnrelatedHistories(err error) bool
- func IsErrMilestoneNotExist(err error) bool
- func IsErrNewIssueInsert(err error) bool
- func IsErrNoPendingTransfer(err error) bool
- func IsErrNotAllowedToMerge(err error) bool
- func IsErrNotExist(err error) bool
- func IsErrNotValidReviewRequest(err error) bool
- func IsErrOrgLabelNotExist(err error) bool
- func IsErrOrgNotExist(err error) bool
- func IsErrProjectBoardNotExist(err error) bool
- func IsErrProjectNotExist(err error) bool
- func IsErrProtectedTagName(err error) bool
- func IsErrPullRequestAlreadyExists(err error) bool
- func IsErrPullRequestHasMerged(err error) bool
- func IsErrPullRequestNotExist(err error) bool
- func IsErrPullWasClosed(err error) bool
- func IsErrReactionAlreadyExist(err error) bool
- func IsErrRebaseConflicts(err error) bool
- func IsErrReleaseAlreadyExist(err error) bool
- func IsErrReleaseNotExist(err error) bool
- func IsErrRepoFileAlreadyExists(err error) bool
- func IsErrRepoFileDoesNotExist(err error) bool
- func IsErrRepoLabelNotExist(err error) bool
- func IsErrRepoTransferInProgress(err error) bool
- func IsErrReviewNotExist(err error) bool
- func IsErrSHADoesNotMatch(err error) bool
- func IsErrSHANotFound(err error) bool
- func IsErrSHAOrCommitIDNotProvided(err error) bool
- func IsErrStopwatchNotExist(err error) bool
- func IsErrTagAlreadyExists(err error) bool
- func IsErrTaskDoesNotExist(err error) bool
- func IsErrTeamAlreadyExist(err error) bool
- func IsErrTeamNotExist(err error) bool
- func IsErrTrackedTimeNotExist(err error) bool
- func IsErrUnknownDependencyType(err error) bool
- func IsErrUpdateTaskNotExist(err error) bool
- func IsErrUploadNotExist(err error) bool
- func IsErrUserCannotCommit(err error) bool
- func IsErrUserDoesNotHaveAccessToRepo(err error) bool
- func IsErrUserHasOrgs(err error) bool
- func IsErrUserNotAllowedCreateOrg(err error) bool
- func IsErrUserOwnRepos(err error) bool
- func IsErrWikiAlreadyExist(err error) bool
- func IsErrWikiInvalidFileName(err error) bool
- func IsErrWikiReservedName(err error) bool
- func IsOfficialReviewer(issue *Issue, reviewers ...*user_model.User) (bool, error)
- func IsOfficialReviewerTeam(issue *Issue, team *Team) (bool, error)
- func IsOrganizationMember(orgID, uid int64) (bool, error)
- func IsOrganizationOwner(orgID, uid int64) (bool, error)
- func IsOwnerMemberCollaborator(repo *repo_model.Repository, userID int64) (bool, error)
- func IsProjectBoardTypeValid(p ProjectBoardType) bool
- func IsProjectTypeValid(p ProjectType) bool
- func IsProtectedBranch(repoID int64, branchName string) (bool, error)
- func IsPublicMembership(orgID, uid int64) (bool, error)
- func IsReleaseExist(repoID int64, tagName string) (bool, error)
- func IsRepoReader(repo *repo_model.Repository, userID int64) (bool, error)
- func IsTeamMember(orgID, teamID, userID int64) (bool, error)
- func IsUsableTeamName(name string) error
- func IsUserAllowedModifyTag(pt *ProtectedTag, userID int64) (bool, error)
- func IsUserAllowedToControlTag(tags []*ProtectedTag, tagName string, userID int64) (bool, error)
- func IsUserAssignedToIssue(issue *Issue, user *user_model.User) (isAssigned bool, err error)
- func IsUserInTeams(userID int64, teamIDs []int64) (bool, error)
- func IsUserMergeWhitelisted(protectBranch *ProtectedBranch, userID int64, permissionInRepo Permission) bool
- func IsUserOfficialReviewer(protectBranch *ProtectedBranch, user *user_model.User) (bool, error)
- func IsUserOrgOwner(users user_model.UserList, orgID int64) map[int64]bool
- func IsUserParticipantsOfIssue(user *user_model.User, issue *Issue) bool
- func IsUserRealRepoAdmin(repo *repo_model.Repository, user *user_model.User) (bool, error)
- func IsUserRepoAdmin(repo *repo_model.Repository, user *user_model.User) (bool, error)
- func IsUserVisibleToViewer(u, viewer *user_model.User) bool
- func IssueNoDependenciesLeft(issue *Issue) (bool, error)
- func IterateLFS(f func(mo *LFSMetaObject) error) error
- func LFSAutoAssociate(metas []*LFSMetaObject, user *user_model.User, repoID int64) error
- func LFSObjectAccessible(user *user_model.User, oid string) (bool, error)
- func LFSObjectIsAssociated(oid string) (bool, error)
- func LinkedRepository(a *repo_model.Attachment) (*repo_model.Repository, unit.Type, error)
- func LoadLabelsFormatted(labelTemplate string) (string, error)
- func LocalCopyPath() string
- func LockIssue(opts *IssueLockOptions) error
- func Luminance(color uint32) float64
- func MakeIDsFromAPIAssigneesToAdd(oneAssignee string, multipleAssignees []string) (assigneeIDs []int64, err error)
- func MarkConversation(comment *Comment, doer *user_model.User, isResolve bool) (err error)
- func MarkReviewsAsNotStale(issueID int64, commitID string) (err error)
- func MarkReviewsAsStale(issueID int64) (err error)
- func MoveIssuesOnProjectBoard(board *ProjectBoard, sortedIssueIDs map[int64]int64) error
- func NewAccessToken(t *AccessToken) error
- func NewCommitStatus(opts NewCommitStatusOptions) error
- func NewIssue(repo *repo_model.Repository, issue *Issue, labelIDs []int64, uuids []string) (err error)
- func NewIssueLabel(issue *Issue, label *Label, doer *user_model.User) (err error)
- func NewIssueLabels(issue *Issue, labels []*Label, doer *user_model.User) (err error)
- func NewLabel(label *Label) error
- func NewLabels(labels ...*Label) error
- func NewMilestone(m *Milestone) (err error)
- func NewProject(p *Project) error
- func NewProjectBoard(board *ProjectBoard) error
- func NewPullRequest(repo *repo_model.Repository, issue *Issue, labelIDs []int64, uuids []string, ...) (err error)
- func NewRepoContext()
- func NewTeam(t *Team) (err error)
- func NotifyWatchers(actions ...*Action) error
- func NotifyWatchersActions(acts []*Action) error
- func PushUpdateDeleteTag(repo *repo_model.Repository, tagName string) error
- func PushUpdateDeleteTagsContext(ctx context.Context, repo *repo_model.Repository, tags []string) error
- func PushingEnvironment(doer *user_model.User, repo *repo_model.Repository) []string
- func RecalculateAccesses(repo *repo_model.Repository) error
- func RecalculateIssueIndexForRepo(repoID int64) error
- func RemoveDeletedBranchByID(repoID, id int64) (err error)
- func RemoveDeletedBranchByName(repoID int64, branch string) error
- func RemoveIssueDependency(user *user_model.User, issue, dep *Issue, depType DependencyType) (err error)
- func RemoveLFSMetaObjectByOid(repoID int64, oid string) (int64, error)
- func RemoveOldDeletedBranches(ctx context.Context, olderThan time.Duration)
- func RemoveOrgUser(orgID, userID int64) error
- func RemoveTeamMember(team *Team, userID int64) error
- func RemoveTemporaryPath(basePath string) error
- func RenameBranch(repo *repo_model.Repository, from, to string, ...) (err error)
- func ReviewExists(issue *Issue, treePath string, line int64) (bool, error)
- func SaveOrUpdateTag(repo *repo_model.Repository, newRel *Release) error
- func SearchIssueIDsByKeyword(kw string, repoIDs []int64, limit, start int) (int64, []int64, error)
- func SearchRepositoryCondition(opts *SearchRepoOptions) builder.Cond
- func SearchRepositoryIDs(opts *SearchRepoOptions) ([]int64, int64, error)
- func SecToTime(duration int64) string
- func SetDefaultBoard(projectID, boardID int64) error
- func SetRepoReadBy(repoID, userID int64) error
- func SortReleases(rels []*Release)
- func SrgbToLinear(color uint8) float64
- func StatsCorrectSQL(ctx context.Context, sql string, id int64) error
- func StopwatchExists(userID, issueID int64) bool
- func SubmitReview(doer *user_model.User, issue *Issue, reviewType ReviewType, ...) (*Review, *Comment, error)
- func TestRepositoryReadyForTransfer(status repo_model.RepositoryStatus) error
- func TotalTimes(options *FindTrackedTimesOptions) (map[*user_model.User]string, error)
- func TransferOwnership(doer *user_model.User, newOwnerName string, repo *repo_model.Repository) (err error)
- func UnlockIssue(opts *IssueLockOptions) error
- func UpdateAccessToken(t *AccessToken) error
- func UpdateComment(c *Comment, doer *user_model.User) error
- func UpdateCommentsMigrationsByType(tp structs.GitServiceType, originalAuthorID string, posterID int64) error
- func UpdateIssueDeadline(issue *Issue, deadlineUnix timeutil.TimeStamp, doer *user_model.User) (err error)
- func UpdateIssueMentions(ctx context.Context, issueID int64, mentions []*user_model.User) error
- func UpdateIssueUserByRead(uid, issueID int64) error
- func UpdateIssueUsersByMentions(ctx context.Context, issueID int64, uids []int64) error
- func UpdateIssuesMigrationsByType(gitServiceType api.GitServiceType, originalAuthorID string, posterID int64) error
- func UpdateLabel(l *Label) error
- func UpdateMigrationsByType(tp structs.GitServiceType, externalUserID string, userID int64) error
- func UpdateMilestone(m *Milestone, oldIsClosed bool) error
- func UpdateNotificationStatuses(user *user_model.User, currentStatus, desiredStatus NotificationStatus) error
- func UpdateProject(p *Project) error
- func UpdateProjectBoard(board *ProjectBoard) error
- func UpdateProjectBoardSorting(bs ProjectBoardList) error
- func UpdateProtectBranch(repo *repo_model.Repository, protectBranch *ProtectedBranch, ...) (err error)
- func UpdateProtectedTag(pt *ProtectedTag) error
- func UpdateReactionsMigrationsByType(gitServiceType api.GitServiceType, originalAuthorID string, userID int64) error
- func UpdateRelease(ctx context.Context, rel *Release) error
- func UpdateReleasesMigrationsByType(gitServiceType structs.GitServiceType, originalAuthorID string, posterID int64) error
- func UpdateRepoSize(ctx context.Context, repo *repo_model.Repository) error
- func UpdateRepoStats(ctx context.Context, id int64) error
- func UpdateRepository(repo *repo_model.Repository, visibilityChanged bool) (err error)
- func UpdateRepositoryCtx(ctx context.Context, repo *repo_model.Repository, visibilityChanged bool) error
- func UpdateReviewsMigrationsByType(tp structs.GitServiceType, originalAuthorID string, posterID int64) error
- func UpdateTeam(t *Team, authChanged, includeAllChanged bool) (err error)
- func UpdateTeamUnits(team *Team, units []TeamUnit) (err error)
- func UploadLocalPath(uuid string) string
- func UsersInTeamsCount(userIDs, teamIDs []int64) (int64, error)
- type Access
- type AccessToken
- type AccessibleReposEnvironment
- type Action
- func (a *Action) GetActFullName() string
- func (a *Action) GetActUserName() string
- func (a *Action) GetBranch() string
- func (a *Action) GetCommentLink() string
- func (a *Action) GetContent() string
- func (a *Action) GetCreate() time.Time
- func (a *Action) GetDisplayName() string
- func (a *Action) GetDisplayNameTitle() string
- func (a *Action) GetIssueContent() string
- func (a *Action) GetIssueInfos() []string
- func (a *Action) GetIssueTitle() string
- func (a *Action) GetOpType() ActionType
- func (a *Action) GetRefLink() string
- func (a *Action) GetRepoLink() string
- func (a *Action) GetRepoName() string
- func (a *Action) GetRepoPath() string
- func (a *Action) GetRepoUserName() string
- func (a *Action) GetTag() string
- func (a *Action) LoadActUser()
- func (a *Action) ShortActUserName() string
- func (a *Action) ShortRepoName() string
- func (a *Action) ShortRepoPath() string
- func (a *Action) ShortRepoUserName() string
- type ActionList
- type ActionType
- type ActivityAuthorData
- type ActivityStats
- func (stats *ActivityStats) ActiveIssueCount() int
- func (stats *ActivityStats) ActivePRCount() int
- func (stats *ActivityStats) ClosedIssueCount() int
- func (stats *ActivityStats) ClosedIssuePerc() int
- func (stats *ActivityStats) FillIssues(repoID int64, fromTime time.Time) error
- func (stats *ActivityStats) FillPullRequests(repoID int64, fromTime time.Time) error
- func (stats *ActivityStats) FillReleases(repoID int64, fromTime time.Time) error
- func (stats *ActivityStats) FillUnresolvedIssues(repoID int64, fromTime time.Time, issues, prs bool) error
- func (stats *ActivityStats) MergedPRCount() int
- func (stats *ActivityStats) MergedPRPerc() int
- func (stats *ActivityStats) OpenedIssueCount() int
- func (stats *ActivityStats) OpenedIssuePerc() int
- func (stats *ActivityStats) OpenedPRCount() int
- func (stats *ActivityStats) OpenedPRPerc() int
- func (stats *ActivityStats) PublishedReleaseCount() int
- func (stats *ActivityStats) UnresolvedIssueCount() int
- type CodeComments
- type Collaboration
- type Collaborator
- type Comment
- func AddReviewRequest(issue *Issue, reviewer, doer *user_model.User) (*Comment, error)
- func AddTeamReviewRequest(issue *Issue, reviewer *Team, doer *user_model.User) (*Comment, error)
- func CreateComment(opts *CreateCommentOptions) (comment *Comment, err error)
- func CreatePushPullComment(pusher *user_model.User, pr *PullRequest, oldCommitID, newCommitID string) (comment *Comment, err error)
- func FetchCodeCommentsByLine(issue *Issue, currentUser *user_model.User, treePath string, line int64) ([]*Comment, error)
- func FindComments(opts *FindCommentsOptions) ([]*Comment, error)
- func GetCommentByID(id int64) (*Comment, error)
- func RemoveReviewRequest(issue *Issue, reviewer, doer *user_model.User) (*Comment, error)
- func RemoveTeamReviewRequest(issue *Issue, reviewer *Team, doer *user_model.User) (*Comment, error)
- func UpdateIssueByAPI(issue *Issue, doer *user_model.User) (statusChangeComment *Comment, titleChanged bool, err error)
- func (c *Comment) APIURL() string
- func (c *Comment) AfterDelete()
- func (c *Comment) AfterLoad(session *xorm.Session)
- func (c *Comment) BeforeInsert()
- func (c *Comment) BeforeUpdate()
- func (c *Comment) CheckInvalidation(repo *git.Repository, doer *user_model.User, branch string) error
- func (c *Comment) CodeCommentURL() string
- func (c *Comment) DiffSide() string
- func (c *Comment) EventTag() string
- func (c *Comment) HTMLURL() string
- func (c *Comment) HashTag() string
- func (c *Comment) IsResolved() bool
- func (c *Comment) IssueURL() string
- func (c *Comment) LoadAssigneeUserAndTeam() error
- func (c *Comment) LoadAttachments() error
- func (c *Comment) LoadDepIssueDetails() (err error)
- func (c *Comment) LoadIssue() (err error)
- func (c *Comment) LoadLabel() error
- func (c *Comment) LoadMilestone() error
- func (c *Comment) LoadPoster() error
- func (c *Comment) LoadProject() error
- func (c *Comment) LoadPushCommits() (err error)
- func (c *Comment) LoadReactions(repo *repo_model.Repository) error
- func (comment *Comment) LoadRefComment() (err error)
- func (comment *Comment) LoadRefIssue() (err error)
- func (c *Comment) LoadResolveDoer() (err error)
- func (c *Comment) LoadReview() error
- func (c *Comment) LoadTime() error
- func (c *Comment) PRURL() string
- func (comment *Comment) RefCommentHTMLURL() string
- func (comment *Comment) RefIssueHTMLURL() string
- func (comment *Comment) RefIssueIdent() string
- func (comment *Comment) RefIssueTitle() string
- func (c *Comment) UnsignedLine() uint64
- func (c *Comment) UpdateAttachments(uuids []string) error
- type CommentList
- type CommentType
- type CommitStatus
- type CommitStatusIndex
- type CommitStatusOptions
- type ContentEmptyErr
- type CreateCommentOptions
- type CreateRepoOptions
- type CreateReviewOptions
- type DeletedBranch
- type DependencyInfo
- type DependencyType
- type ErrAccessTokenEmpty
- type ErrAccessTokenNotExist
- type ErrBranchAlreadyExists
- type ErrBranchDoesNotExist
- type ErrBranchNameConflict
- type ErrBranchesEqual
- type ErrCircularDependency
- type ErrCommentNotExist
- type ErrCommitIDDoesNotMatch
- type ErrDependenciesLeft
- type ErrDependencyExists
- type ErrDependencyNotExists
- type ErrFilePathInvalid
- type ErrFilePathProtected
- type ErrFilenameInvalid
- type ErrForbiddenIssueReaction
- type ErrForkAlreadyExist
- type ErrInvalidCloneAddr
- type ErrInvalidMergeStyle
- type ErrInvalidTagName
- type ErrIssueIsClosed
- type ErrIssueLabelTemplateLoad
- type ErrIssueNotExist
- type ErrIssueStopwatchAlreadyExist
- type ErrIssueStopwatchNotExist
- type ErrIssueWasClosed
- type ErrLFSFileLocked
- type ErrLFSLockAlreadyExist
- type ErrLFSLockNotExist
- type ErrLFSUnauthorizedAction
- type ErrLabelNotExist
- type ErrLastOrgOwner
- type ErrMergeConflicts
- type ErrMergeUnrelatedHistories
- type ErrMilestoneNotExist
- type ErrNewIssueInsert
- type ErrNoPendingRepoTransfer
- type ErrNotAllowedToMerge
- type ErrNotExist
- type ErrNotValidReviewRequest
- type ErrOrgLabelNotExist
- type ErrOrgNotExist
- type ErrProjectBoardNotExist
- type ErrProjectNotExist
- type ErrProtectedTagName
- type ErrPullRequestAlreadyExists
- type ErrPullRequestHasMerged
- type ErrPullRequestHeadRepoMissing
- type ErrPullRequestNotExist
- type ErrPullWasClosed
- type ErrReactionAlreadyExist
- type ErrRebaseConflicts
- type ErrReleaseAlreadyExist
- type ErrReleaseNotExist
- type ErrRepoFileAlreadyExists
- type ErrRepoFileDoesNotExist
- type ErrRepoLabelNotExist
- type ErrRepoTransferInProgress
- type ErrReviewNotExist
- type ErrSHADoesNotMatch
- type ErrSHANotFound
- type ErrSHAOrCommitIDNotProvided
- type ErrStopwatchNotExist
- type ErrTagAlreadyExists
- type ErrTaskDoesNotExist
- type ErrTeamAlreadyExist
- type ErrTeamNotExist
- type ErrTrackedTimeNotExist
- type ErrUnknownDependencyType
- type ErrUpdateTaskNotExist
- type ErrUploadNotExist
- type ErrUserCannotCommit
- type ErrUserDoesNotHaveAccessToRepo
- type ErrUserHasOrgs
- type ErrUserNotAllowedCreateOrg
- type ErrUserOwnRepos
- type ErrWikiAlreadyExist
- type ErrWikiInvalidFileName
- type ErrWikiReservedName
- type FindCommentsOptions
- type FindNotificationOptions
- type FindOrgMembersOpts
- type FindOrgOptions
- type FindReactionsOptions
- type FindReleasesOptions
- type FindReviewOptions
- type FindTaskOptions
- type FindTrackedTimesOptions
- type GenerateRepoOptions
- type GetFeedsOptions
- type GetMilestonesOption
- type GetUserTeamOptions
- type GiteaTemplate
- type Issue
- func GetIssueByID(id int64) (*Issue, error)
- func GetIssueByIndex(repoID, index int64) (*Issue, error)
- func GetIssueWithAttrsByID(id int64) (*Issue, error)
- func GetIssueWithAttrsByIndex(repoID, index int64) (*Issue, error)
- func GetIssuesByIDs(issueIDs []int64) ([]*Issue, error)
- func Issues(opts *IssuesOptions) ([]*Issue, error)
- func (issue *Issue) APIURL() string
- func (issue *Issue) BlockedByDependencies() ([]*DependencyInfo, error)
- func (issue *Issue) BlockingDependencies() ([]*DependencyInfo, error)
- func (issue *Issue) ChangeContent(doer *user_model.User, content string) (err error)
- func (issue *Issue) ChangeRef(doer *user_model.User, oldRef string) (err error)
- func (issue *Issue) ChangeStatus(doer *user_model.User, isClosed bool) (*Comment, error)
- func (issue *Issue) ChangeTitle(doer *user_model.User, oldTitle string) (err error)
- func (issue *Issue) ClearLabels(doer *user_model.User) (err error)
- func (issue *Issue) DiffURL() string
- func (issue *Issue) FindAndUpdateIssueMentions(ctx context.Context, doer *user_model.User, content string) (mentions []*user_model.User, err error)
- func (issue *Issue) GetIsRead(userID int64) error
- func (issue *Issue) GetLastComment() (*Comment, error)
- func (issue *Issue) GetLastEventLabel() string
- func (issue *Issue) GetLastEventLabelFake() string
- func (issue *Issue) GetLastEventTimestamp() timeutil.TimeStamp
- func (issue *Issue) GetPullRequest() (pr *PullRequest, err error)
- func (issue *Issue) GetTasks() int
- func (issue *Issue) GetTasksDone() int
- func (issue *Issue) HTMLURL() string
- func (issue *Issue) HasLabel(labelID int64) bool
- func (issue *Issue) HashTag() string
- func (issue *Issue) IsOverdue() bool
- func (issue *Issue) IsPoster(uid int64) bool
- func (issue *Issue) IsTimetrackerEnabled() bool
- func (issue *Issue) Link() string
- func (issue *Issue) LoadAssignees() error
- func (issue *Issue) LoadAttributes() error
- func (issue *Issue) LoadDiscussComments() error
- func (issue *Issue) LoadLabels() error
- func (issue *Issue) LoadMilestone() error
- func (issue *Issue) LoadPoster() error
- func (i *Issue) LoadProject() (err error)
- func (issue *Issue) LoadPullRequest() error
- func (issue *Issue) LoadRepo() error
- func (issue *Issue) PatchURL() string
- func (i *Issue) ProjectBoardID() int64
- func (i *Issue) ProjectID() int64
- func (issue *Issue) ReadBy(userID int64) error
- func (issue *Issue) ReplaceLabels(labels []*Label, doer *user_model.User) (err error)
- func (issue *Issue) ResolveMentionsByVisibility(ctx context.Context, doer *user_model.User, mentions []string) (users []*user_model.User, err error)
- func (issue *Issue) State() api.StateType
- func (issue *Issue) ToggleAssignee(doer *user_model.User, assigneeID int64) (removed bool, comment *Comment, err error)
- func (issue *Issue) UpdateAttachments(uuids []string) (err error)
- type IssueAssignees
- type IssueByLabelCount
- type IssueByRepositoryCount
- type IssueDependency
- type IssueIndex
- type IssueLabel
- type IssueList
- func (issues IssueList) GetApprovalCounts() (map[int64][]*ReviewCount, error)
- func (issues IssueList) LoadAttachments() error
- func (issues IssueList) LoadAttributes() error
- func (issues IssueList) LoadComments() error
- func (issues IssueList) LoadDiscussComments() error
- func (issues IssueList) LoadPullRequests() error
- func (issues IssueList) LoadRepositories() ([]*repo_model.Repository, error)
- type IssueLockOptions
- type IssueStats
- type IssueStatsOptions
- type IssueUser
- type IssueWatch
- type IssueWatchList
- type IssuesOptions
- type LFSLock
- func CreateLFSLock(repo *repo_model.Repository, lock *LFSLock) (*LFSLock, error)
- func DeleteLFSLockByID(id int64, repo *repo_model.Repository, u *user_model.User, force bool) (*LFSLock, error)
- func GetLFSLock(repo *repo_model.Repository, path string) (*LFSLock, error)
- func GetLFSLockByID(id int64) (*LFSLock, error)
- func GetLFSLockByRepoID(repoID int64, page, pageSize int) ([]*LFSLock, error)
- func GetTreePathLock(repoID int64, treePath string) (*LFSLock, error)
- type LFSMetaObject
- type LFSTokenResponse
- type Label
- func GetLabelByID(id int64) (*Label, error)
- func GetLabelInOrgByID(orgID, labelID int64) (*Label, error)
- func GetLabelInOrgByName(orgID int64, labelName string) (*Label, error)
- func GetLabelInRepoByID(repoID, labelID int64) (*Label, error)
- func GetLabelInRepoByName(repoID int64, labelName string) (*Label, error)
- func GetLabelsByIDs(labelIDs []int64) ([]*Label, error)
- func GetLabelsByIssueID(issueID int64) ([]*Label, error)
- func GetLabelsByOrgID(orgID int64, sortType string, listOptions db.ListOptions) ([]*Label, error)
- func GetLabelsByRepoID(repoID int64, sortType string, listOptions db.ListOptions) ([]*Label, error)
- func GetLabelsInOrgByIDs(orgID int64, labelIDs []int64) ([]*Label, error)
- func GetLabelsInRepoByIDs(repoID int64, labelIDs []int64) ([]*Label, error)
- func (label *Label) BelongsToOrg() bool
- func (label *Label) BelongsToRepo() bool
- func (label *Label) CalOpenIssues()
- func (label *Label) CalOpenOrgIssues(repoID, labelID int64)
- func (label *Label) ForegroundColor() template.CSS
- func (label *Label) LoadSelectedLabelsAfterClick(currentSelectedLabels []int64)
- type ListAccessTokensOptions
- type Milestone
- type MilestoneList
- func GetMilestones(opts GetMilestonesOption) (MilestoneList, int64, error)
- func GetMilestonesByRepoIDs(repoIDs []int64, page int, isClosed bool, sortType string) (MilestoneList, error)
- func SearchMilestones(repoCond builder.Cond, page int, isClosed bool, sortType, keyword string) (MilestoneList, error)
- type MilestonesStats
- type MinimalOrg
- type NewCommitStatusOptions
- type NewIssueOptions
- type Notification
- type NotificationList
- func (nl NotificationList) LoadAttributes() (err error)
- func (nl NotificationList) LoadComments() ([]int, error)
- func (nl NotificationList) LoadIssues() ([]int, error)
- func (nl NotificationList) LoadRepos() (RepositoryList, []int, error)
- func (nl NotificationList) Without(failures []int) NotificationList
- type NotificationSource
- type NotificationStatus
- type OrgUser
- type Organization
- func FindOrgs(opts FindOrgOptions) ([]*Organization, error)
- func GetOrgByID(id int64) (*Organization, error)
- func GetOrgByIDCtx(ctx context.Context, id int64) (*Organization, error)
- func GetOrgByName(name string) (*Organization, error)
- func GetOrgsCanCreateRepoByUserID(userID int64) ([]*Organization, error)
- func GetOwnedOrgsByUserID(userID int64) ([]*Organization, error)
- func GetOwnedOrgsByUserIDDesc(userID int64, desc string) ([]*Organization, error)
- func OrgFromUser(user *user_model.User) *Organization
- func (org *Organization) AccessibleReposEnv(userID int64) (AccessibleReposEnvironment, error)
- func (org *Organization) AccessibleTeamReposEnv(team *Team) AccessibleReposEnvironment
- func (org *Organization) AddMember(uid int64) error
- func (org *Organization) AsUser() *user_model.User
- func (org *Organization) AvatarLink() string
- func (org *Organization) CanCreateOrgRepo(uid int64) (bool, error)
- func (org *Organization) CanCreateRepo() bool
- func (org *Organization) CustomAvatarRelativePath() string
- func (org *Organization) DisplayName() string
- func (org *Organization) GetMembers() (user_model.UserList, map[int64]bool, error)
- func (org *Organization) GetOrgUserMaxAuthorizeLevel(uid int64) (perm.AccessMode, error)
- func (org *Organization) GetOwnerTeam() (*Team, error)
- func (org *Organization) GetTeam(name string) (*Team, error)
- func (org *Organization) GetUserTeamIDs(userID int64) ([]int64, error)
- func (org *Organization) GetUserTeams(userID int64) ([]*Team, error)
- func (org *Organization) HTMLURL() string
- func (org *Organization) HasMemberWithUserID(userID int64) bool
- func (org *Organization) HomeLink() string
- func (org *Organization) IsOrgMember(uid int64) (bool, error)
- func (org *Organization) IsOwnedBy(uid int64) (bool, error)
- func (org *Organization) LoadTeams() ([]*Team, error)
- func (org *Organization) OrganisationLink() string
- func (org *Organization) RemoveMember(uid int64) error
- func (org *Organization) RemoveOrgRepo(repoID int64) error
- func (org *Organization) ShortName(length int) string
- func (Organization) TableName() string
- func (org *Organization) TeamsWithAccessToRepo(repoID int64, mode perm.AccessMode) ([]*Team, error)
- type Permission
- func (p *Permission) CanAccess(mode perm_model.AccessMode, unitType unit.Type) bool
- func (p *Permission) CanAccessAny(mode perm_model.AccessMode, unitTypes ...unit.Type) bool
- func (p *Permission) CanRead(unitType unit.Type) bool
- func (p *Permission) CanReadAny(unitTypes ...unit.Type) bool
- func (p *Permission) CanReadIssuesOrPulls(isPull bool) bool
- func (p *Permission) CanWrite(unitType unit.Type) bool
- func (p *Permission) CanWriteIssuesOrPulls(isPull bool) bool
- func (p *Permission) ColorFormat(s fmt.State)
- func (p *Permission) HasAccess() bool
- func (p *Permission) IsAdmin() bool
- func (p *Permission) IsOwner() bool
- func (p *Permission) UnitAccessMode(unitType unit.Type) perm_model.AccessMode
- type Project
- type ProjectBoard
- type ProjectBoardList
- type ProjectBoardType
- type ProjectIssue
- type ProjectSearchOptions
- type ProjectType
- type ProjectsConfig
- type ProtectedBranch
- func (protectBranch *ProtectedBranch) CanUserPush(userID int64) bool
- func (protectBranch *ProtectedBranch) GetGrantedApprovalsCount(pr *PullRequest) int64
- func (protectBranch *ProtectedBranch) GetProtectedFilePatterns() []glob.Glob
- func (protectBranch *ProtectedBranch) GetUnprotectedFilePatterns() []glob.Glob
- func (protectBranch *ProtectedBranch) HasEnoughApprovals(pr *PullRequest) bool
- func (protectBranch *ProtectedBranch) IsProtected() bool
- func (protectBranch *ProtectedBranch) IsProtectedFile(patterns []glob.Glob, path string) bool
- func (protectBranch *ProtectedBranch) IsUnprotectedFile(patterns []glob.Glob, path string) bool
- func (protectBranch *ProtectedBranch) MergeBlockedByOfficialReviewRequests(pr *PullRequest) bool
- func (protectBranch *ProtectedBranch) MergeBlockedByOutdatedBranch(pr *PullRequest) bool
- func (protectBranch *ProtectedBranch) MergeBlockedByProtectedFiles(pr *PullRequest) bool
- func (protectBranch *ProtectedBranch) MergeBlockedByRejectedReview(pr *PullRequest) bool
- type ProtectedTag
- type PullRequest
- func GetAllUnmergedAgitPullRequestByPoster(uid int64) ([]*PullRequest, error)
- func GetLatestPullRequestByHeadInfo(repoID int64, branch string) (*PullRequest, error)
- func GetPullRequestByID(id int64) (*PullRequest, error)
- func GetPullRequestByIndex(repoID, index int64) (*PullRequest, error)
- func GetPullRequestByIssueID(issueID int64) (*PullRequest, error)
- func GetPullRequestByIssueIDWithNoAttributes(issueID int64) (*PullRequest, error)
- func GetUnmergedPullRequest(headRepoID, baseRepoID int64, headBranch, baseBranch string, ...) (*PullRequest, error)
- func GetUnmergedPullRequestsByBaseInfo(repoID int64, branch string) ([]*PullRequest, error)
- func GetUnmergedPullRequestsByHeadInfo(repoID int64, branch string) ([]*PullRequest, error)
- func PullRequests(baseRepoID int64, opts *PullRequestsOptions) ([]*PullRequest, int64, error)
- func (pr *PullRequest) CanAutoMerge() bool
- func (pr *PullRequest) GetApprovalCounts() ([]*ReviewCount, error)
- func (pr *PullRequest) GetApprovers() string
- func (pr *PullRequest) GetBaseBranchHTMLURL() string
- func (pr *PullRequest) GetDefaultMergeMessage() string
- func (pr *PullRequest) GetDefaultSquashMessage() string
- func (pr *PullRequest) GetGitRefName() string
- func (pr *PullRequest) GetHeadBranchHTMLURL() string
- func (pr *PullRequest) GetWorkInProgressPrefix() string
- func (pr *PullRequest) IsChecking() bool
- func (pr *PullRequest) IsEmpty() bool
- func (pr *PullRequest) IsFilesConflicted() bool
- func (pr *PullRequest) IsSameRepo() bool
- func (pr *PullRequest) IsWorkInProgress() bool
- func (pr *PullRequest) LoadAttributes() error
- func (pr *PullRequest) LoadBaseRepo() error
- func (pr *PullRequest) LoadHeadRepo() error
- func (pr *PullRequest) LoadIssue() (err error)
- func (pr *PullRequest) LoadProtectedBranch() (err error)
- func (pr *PullRequest) MustHeadUserName() string
- func (pr *PullRequest) ResolveCrossReferences() ([]*Comment, error)
- func (pr *PullRequest) SetMerged() (bool, error)
- func (pr *PullRequest) Update() error
- func (pr *PullRequest) UpdateCols(cols ...string) error
- func (pr *PullRequest) UpdateColsIfNotMerged(cols ...string) error
- func (pr *PullRequest) UpdateCommitDivergence(ahead, behind int) error
- type PullRequestFlow
- type PullRequestList
- type PullRequestStatus
- type PullRequestType
- type PullRequestsOptions
- type PushActionContent
- type Reaction
- type ReactionList
- func (list ReactionList) GetFirstUsers() string
- func (list ReactionList) GetMoreUserCount() int
- func (list ReactionList) GroupByType() map[string]ReactionList
- func (list ReactionList) HasUser(userID int64) bool
- func (list ReactionList) LoadUsers(repo *repo_model.Repository) ([]*user_model.User, error)
- type ReactionOptions
- type Release
- func GetLatestReleaseByRepoID(repoID int64) (*Release, error)
- func GetRelease(repoID int64, tagName string) (*Release, error)
- func GetReleaseByID(id int64) (*Release, error)
- func GetReleasesByRepoID(repoID int64, opts FindReleasesOptions) ([]*Release, error)
- func GetReleasesByRepoIDAndNames(ctx context.Context, repoID int64, tagNames []string) (rels []*Release, err error)
- type RenamedBranch
- type RepoTransfer
- type RepositoryList
- func RepositoryListOfMap(repoMap map[int64]*repo_model.Repository) RepositoryList
- func SearchRepository(opts *SearchRepoOptions) (RepositoryList, int64, error)
- func SearchRepositoryByCondition(opts *SearchRepoOptions, cond builder.Cond, loadAttributes bool) (RepositoryList, int64, error)
- func SearchRepositoryByName(opts *SearchRepoOptions) (RepositoryList, int64, error)
- type Review
- func CreateReview(opts CreateReviewOptions) (*Review, error)
- func FindReviews(opts FindReviewOptions) ([]*Review, error)
- func GetCurrentReview(reviewer *user_model.User, issue *Issue) (*Review, error)
- func GetReviewByID(id int64) (*Review, error)
- func GetReviewByIssueIDAndUserID(issueID, userID int64) (*Review, error)
- func GetReviewersByIssueID(issueID int64) ([]*Review, error)
- func GetReviewersFromOriginalAuthorsByIssueID(issueID int64) ([]*Review, error)
- func GetTeamReviewerByIssueIDAndTeamID(issueID, teamID int64) (review *Review, err error)
- type ReviewCount
- type ReviewType
- type RoleDescriptor
- type SearchMembersOptions
- type SearchOrderBy
- type SearchOrgTeamOptions
- type SearchOrganizationsOptions
- type SearchRepoOptions
- type SignCommitWithStatuses
- type Statistic
- type Stopwatch
- type Task
- type Team
- func GetRepoTeams(repo *repo_model.Repository) ([]*Team, error)
- func GetReviewerTeams(repo *repo_model.Repository) ([]*Team, error)
- func GetTeam(orgID int64, name string) (*Team, error)
- func GetTeamByID(teamID int64) (*Team, error)
- func GetTeamsWithAccessToRepo(orgID, repoID int64, mode perm.AccessMode) ([]*Team, error)
- func GetUserOrgTeams(orgID, userID int64) ([]*Team, error)
- func GetUserTeams(opts *GetUserTeamOptions) ([]*Team, int64, error)
- func SearchOrgTeams(opts *SearchOrgTeamOptions) ([]*Team, int64, error)
- func (t *Team) AddAllRepositories() (err error)
- func (t *Team) AddMember(userID int64) error
- func (t *Team) AddRepository(repo *repo_model.Repository) (err error)
- func (t *Team) ColorFormat(s fmt.State)
- func (t *Team) GetMembers(opts *SearchMembersOptions) (err error)
- func (t *Team) GetRepositories(opts *SearchOrgTeamOptions) error
- func (t *Team) GetUnitNames() (res []string)
- func (t *Team) GetUnits() error
- func (t *Team) GetUnitsMap() map[string]string
- func (t *Team) HasRepository(repoID int64) bool
- func (t *Team) IsMember(userID int64) bool
- func (t *Team) IsOwnerTeam() bool
- func (t *Team) RemoveAllRepositories() (err error)
- func (t *Team) RemoveMember(userID int64) error
- func (t *Team) RemoveRepository(repoID int64) error
- func (t *Team) UnitAccessMode(tp unit.Type) perm.AccessMode
- func (t *Team) UnitEnabled(tp unit.Type) bool
- type TeamRepo
- type TeamUnit
- type TeamUser
- type TrackedTime
- type TrackedTimeList
- type TranslatableMessage
- type Upload
- type UserHeatmapData
- type UserIDCount
- type UserIssueStatsOptions
- type WhitelistOptions
Constants ¶
const ( EnvRepoName = "GITEA_REPO_NAME" EnvRepoUsername = "GITEA_REPO_USER_NAME" EnvRepoID = "GITEA_REPO_ID" EnvRepoIsWiki = "GITEA_REPO_IS_WIKI" EnvPusherName = "GITEA_PUSHER_NAME" EnvPusherEmail = "GITEA_PUSHER_EMAIL" EnvPusherID = "GITEA_PUSHER_ID" EnvKeyID = "GITEA_KEY_ID" EnvIsDeployKey = "GITEA_IS_DEPLOY_KEY" EnvPRID = "GITEA_PR_ID" EnvIsInternal = "GITEA_INTERNAL_PUSH" EnvAppURL = "GITEA_ROOT_URL" )
env keys for git hooks need
const ( FilterModeAll = iota FilterModeAssign FilterModeCreate FilterModeMention FilterModeReviewRequested )
Filter modes.
const LuminanceThreshold float64 = 0.179
LuminanceThreshold is the luminance at which white and black appear to have the same contrast i.e. x such that 1.05 / (x + 0.05) = (x + 0.05) / 0.05 i.e. math.Sqrt(1.05*0.05) - 0.05
const RepositoryListDefaultPageSize = 64
RepositoryListDefaultPageSize is the default number of repositories to load in memory when running administrative tasks on all (or almost all) of them. The number should be low enough to avoid filling up all RAM with repository data...
Variables ¶
var ( // Gitignores contains the gitiginore files Gitignores []string // Licenses contains the license files Licenses []string // Readmes contains the readme files Readmes []string // LabelTemplates contains the label template files and the list of labels for each file LabelTemplates map[string]string // ItemsPerPage maximum items per page in forks, watchers and stars of a repo ItemsPerPage = 40 )
var BoardColorPattern = regexp.MustCompile("^#[0-9a-fA-F]{6}$")
BoardColorPattern is a regexp witch can validate BoardColor
var ErrLFSObjectNotExist = errors.New("LFS Meta object does not exist")
ErrLFSObjectNotExist is returned from lfs models functions in order to differentiate between database and missing object errors.
var LabelColorPattern = regexp.MustCompile("^#[0-9a-fA-F]{6}$")
LabelColorPattern is a regexp witch can validate LabelColor
Functions ¶
func AccessLevel ¶
func AccessLevel(user *user_model.User, repo *repo_model.Repository) (perm_model.AccessMode, error)
AccessLevel returns the Access a user has to a repository. Will return NoneAccess if the user does not have access.
func AccessLevelUnit ¶ added in v1.11.0
func AccessLevelUnit(user *user_model.User, repo *repo_model.Repository, unitType unit.Type) (perm_model.AccessMode, error)
AccessLevelUnit returns the Access a user has to a repository's. Will return NoneAccess if the user does not have access.
func AccessTokenByNameExists ¶ added in v1.12.0
func AccessTokenByNameExists(token *AccessToken) (bool, error)
AccessTokenByNameExists checks if a token name has been used already by a user.
func AccessibleRepoIDsQuery ¶ added in v1.11.0
func AccessibleRepoIDsQuery(user *user_model.User) *builder.Builder
AccessibleRepoIDsQuery queries accessible repository ids. Usable as a subquery wherever repo ids need to be filtered.
func AddCollaborator ¶ added in v1.16.0
func AddCollaborator(repo *repo_model.Repository, u *user_model.User) error
AddCollaborator adds new collaboration to a repository with default access mode.
func AddDeletePRBranchComment ¶ added in v1.1.0
func AddDeletePRBranchComment(doer *user_model.User, repo *repo_model.Repository, issueID int64, branchName string) error
AddDeletePRBranchComment adds delete branch comment for pull request issue
func AddDeletedBranch ¶ added in v1.16.0
AddDeletedBranch adds a deleted branch to the database
func AddOrgUser ¶
AddOrgUser adds new user to given organization.
func AddReleaseAttachments ¶ added in v1.10.0
func AddReleaseAttachments(ctx context.Context, releaseID int64, attachmentUUIDs []string) (err error)
AddReleaseAttachments adds a release attachments
func AddTeamMember ¶
AddTeamMember adds new membership of given team to given organization, the user will have membership to given organization automatically when needed.
func BuildLabelNamesIssueIDsCondition ¶ added in v1.12.0
BuildLabelNamesIssueIDsCondition returns a builder where get issue ids match label names
func CanBeAssigned ¶ added in v1.11.0
func CanBeAssigned(user *user_model.User, repo *repo_model.Repository, isPull bool) (bool, error)
CanBeAssigned return true if user can be assigned to issue or pull requests in repo Currently any write access (code, issues or pr's) is assignable, to match assignee list in user interface. FIXME: user could send PullRequest also could be assigned???
func CanCreateOrgRepo ¶ added in v1.11.0
CanCreateOrgRepo returns true if user can create repo in organization
func CanMarkConversation ¶ added in v1.12.0
func CanMarkConversation(issue *Issue, doer *user_model.User) (permResult bool, err error)
CanMarkConversation Add or remove Conversation mark for a code comment permission check the PR writer , offfcial reviewer and poster can do it
func CanUserDelete ¶ added in v1.16.0
func CanUserDelete(repo *repo_model.Repository, user *user_model.User) (bool, error)
CanUserDelete returns true if user could delete the repository
func CanUserForkRepo ¶ added in v1.16.0
func CanUserForkRepo(user *user_model.User, repo *repo_model.Repository) (bool, error)
CanUserForkRepo returns true if specified user can fork repository.
func CancelRepositoryTransfer ¶ added in v1.14.0
func CancelRepositoryTransfer(repo *repo_model.Repository) error
CancelRepositoryTransfer marks the repository as ready and remove pending transfer entry, thus cancel the transfer process.
func CancelStopwatch ¶ added in v1.3.0
func CancelStopwatch(user *user_model.User, issue *Issue) error
CancelStopwatch removes the given stopwatch and logs it into issue's timeline.
func ChangeCollaborationAccessMode ¶ added in v1.16.0
func ChangeCollaborationAccessMode(repo *repo_model.Repository, uid int64, mode perm.AccessMode) error
ChangeCollaborationAccessMode sets new access mode for the collaboration.
func ChangeMilestoneAssign ¶
func ChangeMilestoneAssign(issue *Issue, doer *user_model.User, oldMilestoneID int64) (err error)
ChangeMilestoneAssign changes assignment of milestone for issue.
func ChangeMilestoneStatus ¶
ChangeMilestoneStatus changes the milestone open/closed status.
func ChangeMilestoneStatusByRepoIDAndID ¶ added in v1.13.0
ChangeMilestoneStatusByRepoIDAndID changes a milestone open/closed status if the milestone ID is in the repo.
func ChangeOrgUserStatus ¶
ChangeOrgUserStatus changes public or private membership status.
func ChangeProjectAssign ¶ added in v1.13.0
func ChangeProjectAssign(issue *Issue, doer *user_model.User, newProjectID int64) error
ChangeProjectAssign changes the project associated with an issue
func ChangeProjectStatus ¶ added in v1.13.0
ChangeProjectStatus toggle a project between opened and closed
func ChangeProjectStatusByRepoIDAndID ¶ added in v1.13.0
ChangeProjectStatusByRepoIDAndID toggles a project between opened and closed
func CheckDaemonExportOK ¶ added in v1.16.0
func CheckDaemonExportOK(ctx context.Context, repo *repo_model.Repository) error
CheckDaemonExportOK creates/removes git-daemon-export-ok for git-daemon...
func CheckIssueWatch ¶ added in v1.12.0
func CheckIssueWatch(user *user_model.User, issue *Issue) (bool, error)
CheckIssueWatch check if an user is watching an issue it takes participants and repo watch into account
func CheckLFSAccessForRepo ¶ added in v1.4.0
func CheckLFSAccessForRepo(ownerID int64, repo *repo_model.Repository, mode perm.AccessMode) error
CheckLFSAccessForRepo check needed access mode base on action
func CheckRepoStats ¶
CheckRepoStats checks the repository stats
func CheckRepoUnitUser ¶ added in v1.16.0
func CheckRepoUnitUser(repo *repo_model.Repository, user *user_model.User, unitType unit.Type) bool
CheckRepoUnitUser check whether user could visit the unit of this repository
func CommentHashTag ¶ added in v1.5.0
CommentHashTag returns unique hash tag for comment id.
func CommentTypeIsRef ¶ added in v1.10.0
func CommentTypeIsRef(t CommentType) bool
CommentTypeIsRef returns true if CommentType is a reference from another issue
func CopyLFS ¶ added in v1.11.0
func CopyLFS(ctx context.Context, newRepo, oldRepo *repo_model.Repository) error
CopyLFS copies LFS data from one repo to another
func CountAccessTokens ¶ added in v1.16.0
func CountAccessTokens(opts ListAccessTokensOptions) (int64, error)
CountAccessTokens count access tokens belongs to given user by options
func CountCollaborators ¶ added in v1.16.0
CountCollaborators returns total number of collaborators for a repository
func CountCommentTypeLabelWithEmptyLabel ¶ added in v1.14.0
CountCommentTypeLabelWithEmptyLabel count label comments with empty label
func CountCommentTypeLabelWithOutsideLabels ¶ added in v1.14.0
CountCommentTypeLabelWithOutsideLabels count label comments with outside label
func CountComments ¶ added in v1.16.0
func CountComments(opts *FindCommentsOptions) (int64, error)
CountComments count all comments according options by ignoring pagination
func CountIssueLabelWithOutsideLabels ¶ added in v1.14.0
CountIssueLabelWithOutsideLabels count label comments with outside label
func CountIssueWatchers ¶ added in v1.16.0
CountIssueWatchers count watchers/unwatchers of a given issue
func CountIssues ¶ added in v1.13.0
func CountIssues(opts *IssuesOptions) (int64, error)
CountIssues number return of issues by given conditions.
func CountIssuesByRepo ¶ added in v1.2.0
func CountIssuesByRepo(opts *IssuesOptions) (map[int64]int64, error)
CountIssuesByRepo map from repoID to number of issues matching the options
func CountLFSLockByRepoID ¶ added in v1.11.0
CountLFSLockByRepoID returns a count of all LFSLocks associated with a repository.
func CountLFSMetaObjects ¶ added in v1.16.0
CountLFSMetaObjects returns a count of all LFSMetaObjects associated with a repository
func CountLabelsByOrgID ¶ added in v1.16.0
CountLabelsByOrgID count all labels that belong to given organization by ID.
func CountLabelsByRepoID ¶ added in v1.16.0
CountLabelsByRepoID count number of all labels that belong to given repository by ID.
func CountMilestonesByRepoCond ¶ added in v1.12.0
CountMilestonesByRepoCond map from repo conditions to number of milestones matching the options`
func CountMilestonesByRepoCondAndKw ¶ added in v1.15.0
func CountMilestonesByRepoCondAndKw(repoCond builder.Cond, keyword string, isClosed bool) (map[int64]int64, error)
CountMilestonesByRepoCondAndKw map from repo conditions and the keyword of milestones' name to number of milestones matching the options`
func CountNotifications ¶ added in v1.16.0
func CountNotifications(opts *FindNotificationOptions) (int64, error)
CountNotifications count all notifications that fit to the given options and ignore pagination.
func CountNullArchivedRepository ¶ added in v1.12.0
CountNullArchivedRepository counts the number of repositories with is_archived is null
func CountOrgMembers ¶ added in v1.11.0
func CountOrgMembers(opts *FindOrgMembersOpts) (int64, error)
CountOrgMembers counts the organization's members
func CountOrganizations ¶
func CountOrganizations() int64
CountOrganizations returns number of organizations.
func CountOrgs ¶ added in v1.16.0
func CountOrgs(opts FindOrgOptions) (int64, error)
CountOrgs returns total count organizations according options
func CountOrphanedIssueLabels ¶ added in v1.13.5
CountOrphanedIssueLabels return count of IssueLabels witch have no label behind anymore
func CountOrphanedIssues ¶ added in v1.12.0
CountOrphanedIssues count issues without a repo
func CountOrphanedLabels ¶ added in v1.12.0
CountOrphanedLabels return count of labels witch are broken and not accessible via ui anymore
func CountOrphanedObjects ¶ added in v1.11.7
CountOrphanedObjects count subjects with have no existing refobject anymore
func CountReleasesByRepoID ¶ added in v1.15.0
func CountReleasesByRepoID(repoID int64, opts FindReleasesOptions) (int64, error)
CountReleasesByRepoID returns a number of releases matching FindReleaseOptions and RepoID.
func CountRepoClosedMilestones ¶
CountRepoClosedMilestones returns number of closed milestones in given repository.
func CountReviews ¶ added in v1.16.0
func CountReviews(opts FindReviewOptions) (int64, error)
CountReviews returns count of reviews passing FindReviewOptions
func CountTrackedTimes ¶ added in v1.16.0
func CountTrackedTimes(opts *FindTrackedTimesOptions) (int64, error)
CountTrackedTimes returns count of tracked times that fit to the given options.
func CountUnread ¶ added in v1.12.0
func CountUnread(user *user_model.User) int64
CountUnread count unread notifications for a user
func CountUserStopwatches ¶ added in v1.16.0
CountUserStopwatches return count of all stopwatches of a user
func CountWrongUserType ¶ added in v1.14.0
CountWrongUserType count OrgUser who have wrong type
func CreateIssueDependency ¶ added in v1.6.0
func CreateIssueDependency(user *user_model.User, issue, dep *Issue) error
CreateIssueDependency creates a new dependency for an issue
func CreateIssueStopwatch ¶ added in v1.15.7
CreateIssueStopwatch creates a stopwatch if not exist, otherwise return an error
func CreateOrStopIssueStopwatch ¶ added in v1.3.0
func CreateOrStopIssueStopwatch(user *user_model.User, issue *Issue) error
CreateOrStopIssueStopwatch create an issue stopwatch if it's not exist, otherwise finish it
func CreateOrUpdateIssueNotifications ¶ added in v1.1.0
func CreateOrUpdateIssueNotifications(issueID, commentID, notificationAuthorID, receiverID int64) error
CreateOrUpdateIssueNotifications creates an issue notification for each watcher, or updates it if already exists receiverID > 0 just send to receiver, else send to all watcher
func CreateOrUpdateIssueWatch ¶ added in v1.2.0
CreateOrUpdateIssueWatch set watching for a user and issue
func CreateOrganization ¶
func CreateOrganization(org *Organization, owner *user_model.User) (err error)
CreateOrganization creates record of a new organization.
func CreatePendingRepositoryTransfer ¶ added in v1.14.0
func CreatePendingRepositoryTransfer(doer, newOwner *user_model.User, repoID int64, teams []*Team) error
CreatePendingRepositoryTransfer transfer a repo from one owner to a new one. it marks the repository transfer as "pending"
func CreateRefComment ¶
func CreateRefComment(doer *user_model.User, repo *repo_model.Repository, issue *Issue, content, commitSHA string) error
CreateRefComment creates a commit reference comment to issue.
func CreateRepoTransferNotification ¶ added in v1.14.0
func CreateRepoTransferNotification(doer, newOwner *user_model.User, repo *repo_model.Repository) error
CreateRepoTransferNotification creates notification for the user a repository was transferred to
func CreateRepository ¶
func CreateRepository(ctx context.Context, doer, u *user_model.User, repo *repo_model.Repository, overwriteOrAdopt bool) (err error)
CreateRepository creates a repository for the user/organization.
func CreateTask ¶ added in v1.12.0
CreateTask creates a task on database
func CreateTemporaryPath ¶ added in v1.9.0
CreateTemporaryPath creates a temporary path
func DecrementRepoForkNum ¶ added in v1.15.3
DecrementRepoForkNum decrement repository fork number
func DeleteAccessTokenByID ¶
DeleteAccessTokenByID deletes access token by given ID.
func DeleteCollaboration ¶ added in v1.16.0
func DeleteCollaboration(repo *repo_model.Repository, uid int64) (err error)
DeleteCollaboration removes collaboration relation between the user and repository.
func DeleteComment ¶ added in v1.1.0
DeleteComment deletes the comment
func DeleteCommentReaction ¶ added in v1.4.0
func DeleteCommentReaction(doer *user_model.User, issue *Issue, comment *Comment, content string) error
DeleteCommentReaction deletes a reaction on comment.
func DeleteDeployKey ¶
DeleteDeployKey delete deploy keys
func DeleteIssueLabel ¶
func DeleteIssueLabel(issue *Issue, label *Label, doer *user_model.User) (err error)
DeleteIssueLabel deletes issue-label relation.
func DeleteIssueReaction ¶ added in v1.4.0
func DeleteIssueReaction(doer *user_model.User, issue *Issue, content string) error
DeleteIssueReaction deletes a reaction on issue.
func DeleteIssueUserTimes ¶ added in v1.11.0
func DeleteIssueUserTimes(issue *Issue, user *user_model.User) error
DeleteIssueUserTimes deletes times for issue
func DeleteMilestoneByRepoID ¶
DeleteMilestoneByRepoID deletes a milestone from a repository.
func DeleteOldActions ¶ added in v1.15.0
DeleteOldActions deletes all old actions from database.
func DeleteOrganization ¶
func DeleteOrganization(ctx context.Context, org *Organization) error
DeleteOrganization deletes models associated to an organization.
func DeleteOrphanedIssueLabels ¶ added in v1.13.5
func DeleteOrphanedIssueLabels() error
DeleteOrphanedIssueLabels delete IssueLabels witch have no label behind anymore
func DeleteOrphanedIssues ¶ added in v1.12.0
func DeleteOrphanedIssues() error
DeleteOrphanedIssues delete issues without a repo
func DeleteOrphanedLabels ¶ added in v1.12.0
func DeleteOrphanedLabels() error
DeleteOrphanedLabels delete labels witch are broken and not accessible via ui anymore
func DeleteOrphanedObjects ¶ added in v1.11.7
DeleteOrphanedObjects delete subjects with have no existing refobject anymore
func DeleteProjectBoardByID ¶ added in v1.13.0
DeleteProjectBoardByID removes all issues references to the project board.
func DeleteProjectByID ¶ added in v1.13.0
DeleteProjectByID deletes a project from a repository.
func DeleteProtectedBranch ¶ added in v1.16.0
DeleteProtectedBranch removes ProtectedBranch relation between the user and repository.
func DeleteProtectedTag ¶ added in v1.15.0
func DeleteProtectedTag(pt *ProtectedTag) error
DeleteProtectedTag deletes a protected tag by ID
func DeleteReaction ¶ added in v1.4.0
func DeleteReaction(opts *ReactionOptions) error
DeleteReaction deletes reaction for issue or comment.
func DeleteReleaseByID ¶
DeleteReleaseByID deletes a release from database by given ID.
func DeleteRepository ¶
func DeleteRepository(doer *user_model.User, uid, repoID int64) error
DeleteRepository deletes a repository for a user or organization. make sure if you call this func to close open sessions (sqlite will otherwise get a deadlock)
func DeleteReview ¶ added in v1.12.0
DeleteReview delete a review and it's code comments
func DeleteTeam ¶
DeleteTeam deletes given team. It's caller's responsibility to assign organization ID.
func DeleteTime ¶ added in v1.11.0
func DeleteTime(t *TrackedTime) error
DeleteTime delete a specific Time
func DeleteUploadByUUID ¶
DeleteUploadByUUID deletes a upload by UUID
func DeleteUploads ¶
DeleteUploads deletes multiple uploads
func DeleteUser ¶
func DeleteUser(ctx context.Context, u *user_model.User) (err error)
DeleteUser deletes models associated to an user.
func DismissReview ¶ added in v1.14.0
DismissReview change the dismiss status of a review
func DoctorUserStarNum ¶ added in v1.12.2
func DoctorUserStarNum() (err error)
DoctorUserStarNum recalculate Stars number for all user
func FindOrgMembers ¶ added in v1.11.0
func FindOrgMembers(opts *FindOrgMembersOpts) (user_model.UserList, map[int64]bool, error)
FindOrgMembers loads organization members according conditions
func FindRepoRecentCommitStatusContexts ¶ added in v1.10.0
FindRepoRecentCommitStatusContexts returns repository's recent commit status contexts
func FindUserAccessibleRepoIDs ¶ added in v1.5.0
func FindUserAccessibleRepoIDs(user *user_model.User) ([]int64, error)
FindUserAccessibleRepoIDs find all accessible repositories' ID by user's id
func FindUserOrgForks ¶ added in v1.16.0
func FindUserOrgForks(repoID, userID int64) ([]*repo_model.Repository, error)
FindUserOrgForks returns the forked repositories for one user from a repository
func FinishIssueStopwatch ¶ added in v1.15.7
FinishIssueStopwatch if stopwatch exist then finish it otherwise return an error
func FinishIssueStopwatchIfPossible ¶ added in v1.15.7
FinishIssueStopwatchIfPossible if stopwatch exist then finish it otherwise ignore
func FinishMigrateTask ¶ added in v1.10.0
FinishMigrateTask updates database when migrate task finished
func FixCommentTypeLabelWithEmptyLabel ¶ added in v1.14.0
FixCommentTypeLabelWithEmptyLabel count label comments with empty label
func FixCommentTypeLabelWithOutsideLabels ¶ added in v1.14.0
FixCommentTypeLabelWithOutsideLabels count label comments with outside label
func FixIssueLabelWithOutsideLabels ¶ added in v1.14.0
FixIssueLabelWithOutsideLabels fix label comments with outside label
func FixNullArchivedRepository ¶ added in v1.12.0
FixNullArchivedRepository sets is_archived to false where it is null
func FixWrongUserType ¶ added in v1.14.0
FixWrongUserType fix OrgUser who have wrong type
func FullPushingEnvironment ¶ added in v1.9.0
func FullPushingEnvironment(author, committer *user_model.User, repo *repo_model.Repository, repoName string, prID int64) []string
FullPushingEnvironment returns an os environment to allow hooks to work on push
func GenerateIssueLabels ¶ added in v1.11.0
func GenerateIssueLabels(ctx context.Context, templateRepo, generateRepo *repo_model.Repository) error
GenerateIssueLabels generates issue labels from a template repository
func GenerateWebhooks ¶ added in v1.11.0
func GenerateWebhooks(ctx context.Context, templateRepo, generateRepo *repo_model.Repository) error
GenerateWebhooks generates webhooks from a template repository
func GetAssigneeIDsByIssue ¶ added in v1.11.0
GetAssigneeIDsByIssue returns the IDs of users assigned to an issue but skips joining with `user` for performance reasons. User permissions must be verified elsewhere if required.
func GetAssigneesByIssue ¶ added in v1.5.0
func GetAssigneesByIssue(issue *Issue) (assignees []*user_model.User, err error)
GetAssigneesByIssue returns everyone assigned to that issue
func GetForksByUserAndOrgs ¶ added in v1.16.0
func GetForksByUserAndOrgs(user *user_model.User, repo *repo_model.Repository) ([]*repo_model.Repository, error)
GetForksByUserAndOrgs return forked repos of the user and owned orgs
func GetIssueIDsByRepoID ¶ added in v1.8.0
GetIssueIDsByRepoID returns all issue ids by repo id
func GetIssueWatchersIDs ¶ added in v1.11.0
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
func GetLabelIDsInOrgByNames ¶ added in v1.12.0
GetLabelIDsInOrgByNames returns a list of labelIDs by names in a given organization.
func GetLabelIDsInRepoByNames ¶ added in v1.8.0
GetLabelIDsInRepoByNames returns a list of labelIDs by names in a given repository. it silently ignores label names that do not belong to the repository.
func GetLabelTemplateFile ¶
GetLabelTemplateFile loads the label template file by given name, then parses and returns a list of name-color pairs and optionally description.
func GetNextCommitStatusIndex ¶ added in v1.16.0
GetNextCommitStatusIndex retried 3 times to generate a resource index
func GetNotificationCount ¶ added in v1.1.0
func GetNotificationCount(user *user_model.User, status NotificationStatus) (int64, error)
GetNotificationCount returns the notification count for user
func GetOrganizationCount ¶ added in v1.16.0
GetOrganizationCount returns count of membership of organization of the user.
func GetParticipantsIDsByIssueID ¶ added in v1.11.0
GetParticipantsIDsByIssueID returns the IDs of all users who participated in comments of an issue, but skips joining with `user` for performance reasons. User permissions must be verified elsewhere if required.
func GetPullRequestIDsByCheckStatus ¶ added in v1.11.0
func GetPullRequestIDsByCheckStatus(status PullRequestStatus) ([]int64, error)
GetPullRequestIDsByCheckStatus returns all pull requests according the special checking status.
func GetReleaseAttachments ¶ added in v1.1.0
GetReleaseAttachments retrieves the attachments for releases
func GetReleaseCountByRepoID ¶ added in v1.2.0
func GetReleaseCountByRepoID(repoID int64, opts FindReleasesOptions) (int64, error)
GetReleaseCountByRepoID returns the count of releases of repository
func GetRepoAssignees ¶ added in v1.16.0
func GetRepoAssignees(repo *repo_model.Repository) (_ []*user_model.User, err error)
GetRepoAssignees returns all users that have write access and can be assigned to issues of the repository,
func GetRepoIDsForIssuesOptions ¶ added in v1.12.0
func GetRepoIDsForIssuesOptions(opts *IssuesOptions, user *user_model.User) ([]int64, error)
GetRepoIDsForIssuesOptions find all repo ids for the given options
func GetRepoInitFile ¶ added in v1.12.0
GetRepoInitFile returns repository init files
func GetRepoIssueStats ¶
GetRepoIssueStats returns number of open and closed repository issues by given filter mode.
func GetRepoReaders ¶ added in v1.16.0
func GetRepoReaders(repo *repo_model.Repository) (_ []*user_model.User, err error)
GetRepoReaders returns all users that have explicit read access or higher to the repository.
func GetRepoWriters ¶ added in v1.16.0
func GetRepoWriters(repo *repo_model.Repository) (_ []*user_model.User, err error)
GetRepoWriters returns all users that have write access to the repository.
func GetRepositoryFromMatch ¶ added in v1.9.0
func GetRepositoryFromMatch(ownerName, repoName string) (*repo_model.Repository, error)
GetRepositoryFromMatch returns a *repo_model.Repository from a username and repo strings
func GetReviewers ¶ added in v1.16.0
func GetReviewers(repo *repo_model.Repository, doerID, posterID int64) ([]*user_model.User, error)
GetReviewers get all users can be requested to review: * for private repositories this returns all users that have read access or higher to the repository. * for public repositories this returns all users that have read access or higher to the repository, all repo watchers and all organization members. TODO: may be we should have a busy choice for users to block review request to them.
func GetStarredRepos ¶ added in v1.0.0
func GetStarredRepos(userID int64, private bool, listOptions db.ListOptions) ([]*repo_model.Repository, error)
GetStarredRepos returns the repos starred by a particular user
func GetTeamIDsByNames ¶ added in v1.12.0
GetTeamIDsByNames returns a slice of team ids corresponds to names.
func GetTeamMembers ¶
func GetTeamMembers(teamID int64) ([]*user_model.User, error)
GetTeamMembers returns all members in given team of organization.
func GetTeamNamesByID ¶ added in v1.12.0
GetTeamNamesByID returns team's lower name from a list of team ids.
func GetTrackedSeconds ¶ added in v1.11.0
func GetTrackedSeconds(opts FindTrackedTimesOptions) (int64, error)
GetTrackedSeconds return sum of seconds
func GetUserRepositories ¶
func GetUserRepositories(opts *SearchRepoOptions) ([]*repo_model.Repository, int64, error)
GetUserRepositories returns a list of repositories of given user.
func GetUsersWhoCanCreateOrgRepo ¶ added in v1.14.0
func GetUsersWhoCanCreateOrgRepo(orgID int64) ([]*user_model.User, error)
GetUsersWhoCanCreateOrgRepo returns users which are able to create repo in organization
func GetWatchedRepos ¶ added in v1.1.0
func GetWatchedRepos(userID int64, private bool, listOptions db.ListOptions) ([]*repo_model.Repository, int64, error)
GetWatchedRepos returns the repos watched by a particular user
func GetYamlFixturesAccess ¶ added in v1.12.0
GetYamlFixturesAccess returns a string containing the contents for the access table, as recalculated using repo.RecalculateAccesses()
func HasAccess ¶
func HasAccess(userID int64, repo *repo_model.Repository) (bool, error)
HasAccess returns true if user has access to repo
func HasAccessUnit ¶ added in v1.7.0
func HasAccessUnit(user *user_model.User, repo *repo_model.Repository, unitType unit.Type, testMode perm_model.AccessMode) (bool, error)
HasAccessUnit returns true if user has testMode to the unit of the repository
func HasIssueLabel ¶
HasIssueLabel returns true if issue has been labeled.
func HasOrgOrUserVisible ¶ added in v1.15.0
func HasOrgOrUserVisible(org, user *user_model.User) bool
HasOrgOrUserVisible tells if the given user can see the given org or user
func HasOrgsVisible ¶ added in v1.8.0
func HasOrgsVisible(orgs []*Organization, user *user_model.User) bool
HasOrgsVisible tells if the given user can see at least one of the orgs provided
func HasTeamRepo ¶
HasTeamRepo returns true if given repository belongs to team.
func HasUnmergedPullRequestsByHeadInfo ¶ added in v1.16.0
HasUnmergedPullRequestsByHeadInfo checks if there are open and not merged pull request by given head information (repo and branch)
func HasWorkInProgressPrefix ¶ added in v1.15.0
HasWorkInProgressPrefix determines if the given PR title has a Work In Progress prefix
func IncrementRepoForkNum ¶ added in v1.12.0
IncrementRepoForkNum increment repository fork number
func InitializeLabels ¶ added in v1.12.0
InitializeLabels adds a label set to a repository using a template
func InsertIssueComments ¶ added in v1.9.0
InsertIssueComments inserts many comments of issues.
func InsertIssues ¶ added in v1.9.0
InsertIssues insert issues to database
func InsertMilestones ¶ added in v1.9.0
InsertMilestones creates milestones of repository.
func InsertProtectedTag ¶ added in v1.15.0
func InsertProtectedTag(pt *ProtectedTag) error
InsertProtectedTag inserts a protected tag to database
func InsertPullRequests ¶ added in v1.9.0
func InsertPullRequests(prs ...*PullRequest) error
InsertPullRequests inserted pull requests
func InsertRelease ¶ added in v1.10.0
InsertRelease inserts a release
func InsertReleases ¶ added in v1.9.0
InsertReleases migrates release
func InsertReleasesContext ¶ added in v1.12.0
InsertReleasesContext insert releases
func InsertReviews ¶ added in v1.12.0
InsertReviews inserts review and review comments
func InternalPushingEnvironment ¶ added in v1.11.0
func InternalPushingEnvironment(doer *user_model.User, repo *repo_model.Repository) []string
InternalPushingEnvironment returns an os environment to switch off hooks on push It is recommended to avoid using this unless you are pushing within a transaction or if you absolutely are sure that post-receive and pre-receive will do nothing We provide the full pushing-environment for other hook providers
func IsCollaborator ¶ added in v1.16.0
IsCollaborator check if a user is a collaborator of a repository
func IsContentEmptyErr ¶ added in v1.11.0
IsContentEmptyErr returns true if err is a ContentEmptyErr
func IsErrAccessTokenEmpty ¶
IsErrAccessTokenEmpty checks if an error is a ErrAccessTokenEmpty.
func IsErrAccessTokenNotExist ¶
IsErrAccessTokenNotExist checks if an error is a ErrAccessTokenNotExist.
func IsErrBranchAlreadyExists ¶ added in v1.3.0
IsErrBranchAlreadyExists checks if an error is an ErrBranchAlreadyExists.
func IsErrBranchDoesNotExist ¶ added in v1.13.0
IsErrBranchDoesNotExist checks if an error is an ErrBranchDoesNotExist.
func IsErrBranchNameConflict ¶ added in v1.3.0
IsErrBranchNameConflict checks if an error is an ErrBranchNameConflict.
func IsErrBranchesEqual ¶ added in v1.11.0
IsErrBranchesEqual checks if an error is an ErrBranchesEqual.
func IsErrCircularDependency ¶ added in v1.6.0
IsErrCircularDependency checks if an error is a ErrCircularDependency.
func IsErrCommentNotExist ¶
IsErrCommentNotExist checks if an error is a ErrCommentNotExist.
func IsErrCommitIDDoesNotMatch ¶ added in v1.9.0
IsErrCommitIDDoesNotMatch checks if an error is a ErrCommitIDDoesNotMatch.
func IsErrDependenciesLeft ¶ added in v1.6.0
IsErrDependenciesLeft checks if an error is a ErrDependenciesLeft.
func IsErrDependencyExists ¶ added in v1.6.0
IsErrDependencyExists checks if an error is a ErrDependencyExists.
func IsErrDependencyNotExists ¶ added in v1.6.0
IsErrDependencyNotExists checks if an error is a ErrDependencyExists.
func IsErrErrPullRequestHeadRepoMissing ¶ added in v1.9.0
IsErrErrPullRequestHeadRepoMissing checks if an error is a ErrPullRequestHeadRepoMissing.
func IsErrFilePathInvalid ¶ added in v1.9.0
IsErrFilePathInvalid checks if an error is an ErrFilePathInvalid.
func IsErrFilePathProtected ¶ added in v1.12.0
IsErrFilePathProtected checks if an error is an ErrFilePathProtected.
func IsErrFilenameInvalid ¶ added in v1.9.0
IsErrFilenameInvalid checks if an error is an ErrFilenameInvalid.
func IsErrForbiddenIssueReaction ¶ added in v1.11.0
IsErrForbiddenIssueReaction checks if an error is a ErrForbiddenIssueReaction.
func IsErrForkAlreadyExist ¶ added in v1.9.0
IsErrForkAlreadyExist checks if an error is an ErrForkAlreadyExist.
func IsErrInvalidCloneAddr ¶
IsErrInvalidCloneAddr checks if an error is a ErrInvalidCloneAddr.
func IsErrInvalidMergeStyle ¶ added in v1.4.0
IsErrInvalidMergeStyle checks if an error is a ErrInvalidMergeStyle.
func IsErrInvalidTagName ¶
IsErrInvalidTagName checks if an error is a ErrInvalidTagName.
func IsErrIssueIsClosed ¶ added in v1.11.0
IsErrIssueIsClosed checks if an error is a ErrIssueNotExist.
func IsErrIssueLabelTemplateLoad ¶ added in v1.10.0
IsErrIssueLabelTemplateLoad checks if an error is a ErrIssueLabelTemplateLoad.
func IsErrIssueNotExist ¶
IsErrIssueNotExist checks if an error is a ErrIssueNotExist.
func IsErrIssueWasClosed ¶ added in v1.11.0
IsErrIssueWasClosed checks if an error is a ErrIssueWasClosed.
func IsErrLFSFileLocked ¶ added in v1.11.0
IsErrLFSFileLocked checks if an error is a ErrLFSFileLocked.
func IsErrLFSLockAlreadyExist ¶ added in v1.4.0
IsErrLFSLockAlreadyExist checks if an error is a ErrLFSLockAlreadyExist.
func IsErrLFSLockNotExist ¶ added in v1.4.0
IsErrLFSLockNotExist checks if an error is a ErrLFSLockNotExist.
func IsErrLFSUnauthorizedAction ¶ added in v1.4.0
IsErrLFSUnauthorizedAction checks if an error is a ErrLFSUnauthorizedAction.
func IsErrLabelNotExist ¶
IsErrLabelNotExist checks if an error is a ErrLabelNotExist.
func IsErrLastOrgOwner ¶
IsErrLastOrgOwner checks if an error is a ErrLastOrgOwner.
func IsErrMergeConflicts ¶ added in v1.11.0
IsErrMergeConflicts checks if an error is a ErrMergeConflicts.
func IsErrMergeUnrelatedHistories ¶ added in v1.11.0
IsErrMergeUnrelatedHistories checks if an error is a ErrMergeUnrelatedHistories.
func IsErrMilestoneNotExist ¶
IsErrMilestoneNotExist checks if an error is a ErrMilestoneNotExist.
func IsErrNewIssueInsert ¶ added in v1.10.0
IsErrNewIssueInsert checks if an error is a ErrNewIssueInsert.
func IsErrNoPendingTransfer ¶ added in v1.14.0
IsErrNoPendingTransfer is an error type when a repository has no pending transfers
func IsErrNotAllowedToMerge ¶ added in v1.5.0
IsErrNotAllowedToMerge checks if an error is an ErrNotAllowedToMerge.
func IsErrNotExist ¶ added in v1.10.0
IsErrNotExist checks if an error is an ErrNotExist
func IsErrNotValidReviewRequest ¶ added in v1.13.0
IsErrNotValidReviewRequest checks if an error is a ErrNotValidReviewRequest.
func IsErrOrgLabelNotExist ¶ added in v1.12.0
IsErrOrgLabelNotExist checks if an error is a OrgErrLabelNotExist.
func IsErrOrgNotExist ¶ added in v1.2.0
IsErrOrgNotExist checks if an error is a ErrOrgNotExist.
func IsErrProjectBoardNotExist ¶ added in v1.13.0
IsErrProjectBoardNotExist checks if an error is a ErrProjectBoardNotExist
func IsErrProjectNotExist ¶ added in v1.13.0
IsErrProjectNotExist checks if an error is a ErrProjectNotExist
func IsErrProtectedTagName ¶ added in v1.15.0
IsErrProtectedTagName checks if an error is a ErrProtectedTagName.
func IsErrPullRequestAlreadyExists ¶ added in v1.0.0
IsErrPullRequestAlreadyExists checks if an error is a ErrPullRequestAlreadyExists.
func IsErrPullRequestHasMerged ¶ added in v1.11.0
IsErrPullRequestHasMerged checks if an error is a ErrPullRequestHasMerged.
func IsErrPullRequestNotExist ¶
IsErrPullRequestNotExist checks if an error is a ErrPullRequestNotExist.
func IsErrPullWasClosed ¶ added in v1.11.0
IsErrPullWasClosed checks if an error is a ErrErrPullWasClosed.
func IsErrReactionAlreadyExist ¶ added in v1.10.2
IsErrReactionAlreadyExist checks if an error is a ErrReactionAlreadyExist.
func IsErrRebaseConflicts ¶ added in v1.11.0
IsErrRebaseConflicts checks if an error is a ErrRebaseConflicts.
func IsErrReleaseAlreadyExist ¶
IsErrReleaseAlreadyExist checks if an error is a ErrReleaseAlreadyExist.
func IsErrReleaseNotExist ¶
IsErrReleaseNotExist checks if an error is a ErrReleaseNotExist.
func IsErrRepoFileAlreadyExists ¶ added in v1.9.0
IsErrRepoFileAlreadyExists checks if an error is a ErrRepoFileAlreadyExists.
func IsErrRepoFileDoesNotExist ¶ added in v1.9.0
IsErrRepoFileDoesNotExist checks if an error is a ErrRepoDoesNotExist.
func IsErrRepoLabelNotExist ¶ added in v1.12.0
IsErrRepoLabelNotExist checks if an error is a RepoErrLabelNotExist.
func IsErrRepoTransferInProgress ¶ added in v1.14.0
IsErrRepoTransferInProgress checks if an error is a ErrRepoTransferInProgress.
func IsErrReviewNotExist ¶ added in v1.6.0
IsErrReviewNotExist checks if an error is a ErrReviewNotExist.
func IsErrSHADoesNotMatch ¶ added in v1.9.0
IsErrSHADoesNotMatch checks if an error is a ErrSHADoesNotMatch.
func IsErrSHANotFound ¶ added in v1.9.0
IsErrSHANotFound checks if an error is a ErrSHANotFound.
func IsErrSHAOrCommitIDNotProvided ¶ added in v1.9.0
IsErrSHAOrCommitIDNotProvided checks if an error is a ErrSHAOrCommitIDNotProvided.
func IsErrStopwatchNotExist ¶ added in v1.3.0
IsErrStopwatchNotExist checks if an error is a ErrStopwatchNotExist.
func IsErrTagAlreadyExists ¶ added in v1.3.0
IsErrTagAlreadyExists checks if an error is an ErrTagAlreadyExists.
func IsErrTaskDoesNotExist ¶ added in v1.10.0
IsErrTaskDoesNotExist checks if an error is a ErrTaskIsNotExist.
func IsErrTeamAlreadyExist ¶
IsErrTeamAlreadyExist checks if an error is a ErrTeamAlreadyExist.
func IsErrTeamNotExist ¶ added in v1.10.0
IsErrTeamNotExist checks if an error is a ErrTeamNotExist.
func IsErrTrackedTimeNotExist ¶ added in v1.3.0
IsErrTrackedTimeNotExist checks if an error is a ErrTrackedTimeNotExist.
func IsErrUnknownDependencyType ¶ added in v1.6.0
IsErrUnknownDependencyType checks if an error is ErrUnknownDependencyType
func IsErrUpdateTaskNotExist ¶
IsErrUpdateTaskNotExist checks if an error is a ErrUpdateTaskNotExist.
func IsErrUploadNotExist ¶
IsErrUploadNotExist checks if an error is a ErrUploadNotExist.
func IsErrUserCannotCommit ¶ added in v1.9.0
IsErrUserCannotCommit checks if an error is an ErrUserCannotCommit.
func IsErrUserDoesNotHaveAccessToRepo ¶ added in v1.5.0
IsErrUserDoesNotHaveAccessToRepo checks if an error is a ErrRepoFileAlreadyExists.
func IsErrUserHasOrgs ¶
IsErrUserHasOrgs checks if an error is a ErrUserHasOrgs.
func IsErrUserNotAllowedCreateOrg ¶ added in v1.1.0
IsErrUserNotAllowedCreateOrg checks if an error is an ErrUserNotAllowedCreateOrg.
func IsErrUserOwnRepos ¶
IsErrUserOwnRepos checks if an error is a ErrUserOwnRepos.
func IsErrWikiAlreadyExist ¶
IsErrWikiAlreadyExist checks if an error is an ErrWikiAlreadyExist.
func IsErrWikiInvalidFileName ¶ added in v1.4.0
IsErrWikiInvalidFileName checks if an error is an ErrWikiInvalidFileName.
func IsErrWikiReservedName ¶ added in v1.4.0
IsErrWikiReservedName checks if an error is an ErrWikiReservedName.
func IsOfficialReviewer ¶ added in v1.11.0
func IsOfficialReviewer(issue *Issue, reviewers ...*user_model.User) (bool, error)
IsOfficialReviewer check if at least one of the provided reviewers can make official reviews in issue (counts towards required approvals)
func IsOfficialReviewerTeam ¶ added in v1.13.0
IsOfficialReviewerTeam check if reviewer in this team can make official reviews in issue (counts towards required approvals)
func IsOrganizationMember ¶
IsOrganizationMember returns true if given user is member of organization.
func IsOrganizationOwner ¶
IsOrganizationOwner returns true if given user is in the owner team.
func IsOwnerMemberCollaborator ¶ added in v1.16.0
func IsOwnerMemberCollaborator(repo *repo_model.Repository, userID int64) (bool, error)
IsOwnerMemberCollaborator checks if a provided user is the owner, a collaborator or a member of a team in a repository
func IsProjectBoardTypeValid ¶ added in v1.13.0
func IsProjectBoardTypeValid(p ProjectBoardType) bool
IsProjectBoardTypeValid checks if the project board type is valid
func IsProjectTypeValid ¶ added in v1.13.0
func IsProjectTypeValid(p ProjectType) bool
IsProjectTypeValid checks if a project type is valid
func IsProtectedBranch ¶ added in v1.16.0
IsProtectedBranch checks if branch is protected
func IsPublicMembership ¶
IsPublicMembership returns true if given user public his/her membership.
func IsReleaseExist ¶
IsReleaseExist returns true if release with given tag name already exists.
func IsRepoReader ¶ added in v1.16.0
func IsRepoReader(repo *repo_model.Repository, userID int64) (bool, error)
IsRepoReader returns true if user has explicit read access or higher to the repository.
func IsTeamMember ¶
IsTeamMember returns true if given user is a member of team.
func IsUsableTeamName ¶ added in v1.0.0
IsUsableTeamName tests if a name could be as team name
func IsUserAllowedModifyTag ¶ added in v1.16.0
func IsUserAllowedModifyTag(pt *ProtectedTag, userID int64) (bool, error)
IsUserAllowedModifyTag returns true if the user is allowed to modify the tag
func IsUserAllowedToControlTag ¶ added in v1.15.0
func IsUserAllowedToControlTag(tags []*ProtectedTag, tagName string, userID int64) (bool, error)
IsUserAllowedToControlTag checks if a user can control the specific tag. It returns true if the tag name is not protected or the user is allowed to control it.
func IsUserAssignedToIssue ¶ added in v1.5.0
func IsUserAssignedToIssue(issue *Issue, user *user_model.User) (isAssigned bool, err error)
IsUserAssignedToIssue returns true when the user is assigned to the issue
func IsUserInTeams ¶ added in v1.3.0
IsUserInTeams returns if a user in some teams
func IsUserMergeWhitelisted ¶ added in v1.16.0
func IsUserMergeWhitelisted(protectBranch *ProtectedBranch, userID int64, permissionInRepo Permission) bool
IsUserMergeWhitelisted checks if some user is whitelisted to merge to this branch
func IsUserOfficialReviewer ¶ added in v1.16.0
func IsUserOfficialReviewer(protectBranch *ProtectedBranch, user *user_model.User) (bool, error)
IsUserOfficialReviewer check if user is official reviewer for the branch (counts towards required approvals)
func IsUserOrgOwner ¶ added in v1.16.0
func IsUserOrgOwner(users user_model.UserList, orgID int64) map[int64]bool
IsUserOrgOwner returns true if user is in the owner team of given organization.
func IsUserParticipantsOfIssue ¶ added in v1.12.0
func IsUserParticipantsOfIssue(user *user_model.User, issue *Issue) bool
IsUserParticipantsOfIssue return true if user is participants of an issue
func IsUserRealRepoAdmin ¶ added in v1.13.0
func IsUserRealRepoAdmin(repo *repo_model.Repository, user *user_model.User) (bool, error)
IsUserRealRepoAdmin check if this user is real repo admin
func IsUserRepoAdmin ¶ added in v1.7.0
func IsUserRepoAdmin(repo *repo_model.Repository, user *user_model.User) (bool, error)
IsUserRepoAdmin return true if user has admin right of a repo
func IsUserVisibleToViewer ¶ added in v1.16.0
func IsUserVisibleToViewer(u, viewer *user_model.User) bool
IsUserVisibleToViewer check if viewer is able to see user profile
func IssueNoDependenciesLeft ¶ added in v1.6.0
IssueNoDependenciesLeft checks if issue can be closed
func IterateLFS ¶ added in v1.13.0
func IterateLFS(f func(mo *LFSMetaObject) error) error
IterateLFS iterates lfs object
func LFSAutoAssociate ¶ added in v1.11.0
func LFSAutoAssociate(metas []*LFSMetaObject, user *user_model.User, repoID int64) error
LFSAutoAssociate auto associates accessible LFSMetaObjects
func LFSObjectAccessible ¶ added in v1.11.0
func LFSObjectAccessible(user *user_model.User, oid string) (bool, error)
LFSObjectAccessible checks if a provided Oid is accessible to the user
func LFSObjectIsAssociated ¶ added in v1.16.0
LFSObjectIsAssociated checks if a provided Oid is associated
func LinkedRepository ¶ added in v1.16.0
func LinkedRepository(a *repo_model.Attachment) (*repo_model.Repository, unit.Type, error)
LinkedRepository returns the linked repo if any
func LoadLabelsFormatted ¶ added in v1.11.0
LoadLabelsFormatted loads the labels' list of a template file as a string separated by comma
func LocalCopyPath ¶ added in v1.4.0
func LocalCopyPath() string
LocalCopyPath returns the local repository temporary copy path.
func LockIssue ¶ added in v1.8.0
func LockIssue(opts *IssueLockOptions) error
LockIssue locks an issue. This would limit commenting abilities to users with write access to the repo
func MakeIDsFromAPIAssigneesToAdd ¶ added in v1.5.0
func MakeIDsFromAPIAssigneesToAdd(oneAssignee string, multipleAssignees []string) (assigneeIDs []int64, err error)
MakeIDsFromAPIAssigneesToAdd returns an array with all assignee IDs
func MarkConversation ¶ added in v1.12.0
func MarkConversation(comment *Comment, doer *user_model.User, isResolve bool) (err error)
MarkConversation Add or remove Conversation mark for a code comment
func MarkReviewsAsNotStale ¶ added in v1.12.0
MarkReviewsAsNotStale marks existing reviews as not stale for a giving commit SHA
func MarkReviewsAsStale ¶ added in v1.12.0
MarkReviewsAsStale marks existing reviews as stale
func MoveIssuesOnProjectBoard ¶ added in v1.16.0
func MoveIssuesOnProjectBoard(board *ProjectBoard, sortedIssueIDs map[int64]int64) error
MoveIssuesOnProjectBoard moves or keeps issues in a column and sorts them inside that column
func NewAccessToken ¶
func NewAccessToken(t *AccessToken) error
NewAccessToken creates new access token.
func NewCommitStatus ¶ added in v1.2.0
func NewCommitStatus(opts NewCommitStatusOptions) error
NewCommitStatus save commit statuses into database
func NewIssue ¶
func NewIssue(repo *repo_model.Repository, issue *Issue, labelIDs []int64, uuids []string) (err error)
NewIssue creates new issue with labels for repository.
func NewIssueLabel ¶
func NewIssueLabel(issue *Issue, label *Label, doer *user_model.User) (err error)
NewIssueLabel creates a new issue-label relation.
func NewIssueLabels ¶
func NewIssueLabels(issue *Issue, labels []*Label, doer *user_model.User) (err error)
NewIssueLabels creates a list of issue-label relations.
func NewMilestone ¶
NewMilestone creates new milestone of repository.
func NewProject ¶ added in v1.13.0
NewProject creates a new Project
func NewProjectBoard ¶ added in v1.13.0
func NewProjectBoard(board *ProjectBoard) error
NewProjectBoard adds a new project board to a given project
func NewPullRequest ¶
func NewPullRequest(repo *repo_model.Repository, issue *Issue, labelIDs []int64, uuids []string, pr *PullRequest) (err error)
NewPullRequest creates new pull request with labels for repository.
func NewTeam ¶
NewTeam creates a record of new team. It's caller's responsibility to assign organization ID.
func NotifyWatchers ¶
NotifyWatchers creates batch of actions for every watcher.
func NotifyWatchersActions ¶ added in v1.11.0
NotifyWatchersActions creates batch of actions for every watcher.
func PushUpdateDeleteTag ¶ added in v1.10.0
func PushUpdateDeleteTag(repo *repo_model.Repository, tagName string) error
PushUpdateDeleteTag must be called for any push actions to delete tag
func PushUpdateDeleteTagsContext ¶ added in v1.12.0
func PushUpdateDeleteTagsContext(ctx context.Context, repo *repo_model.Repository, tags []string) error
PushUpdateDeleteTagsContext updates a number of delete tags with context
func PushingEnvironment ¶ added in v1.9.0
func PushingEnvironment(doer *user_model.User, repo *repo_model.Repository) []string
PushingEnvironment returns an os environment to allow hooks to work on push
func RecalculateAccesses ¶ added in v1.16.0
func RecalculateAccesses(repo *repo_model.Repository) error
RecalculateAccesses recalculates all accesses for repository.
func RecalculateIssueIndexForRepo ¶ added in v1.15.0
RecalculateIssueIndexForRepo create issue_index for repo if not exist and update it based on highest index of existing issues assigned to a repo
func RemoveDeletedBranchByID ¶ added in v1.16.0
RemoveDeletedBranchByID removes a deleted branch from the database
func RemoveDeletedBranchByName ¶ added in v1.16.0
RemoveDeletedBranchByName removes all deleted branches
func RemoveIssueDependency ¶ added in v1.6.0
func RemoveIssueDependency(user *user_model.User, issue, dep *Issue, depType DependencyType) (err error)
RemoveIssueDependency removes a dependency from an issue
func RemoveLFSMetaObjectByOid ¶ added in v1.1.0
RemoveLFSMetaObjectByOid removes a LFSMetaObject entry from database by its OID. It may return ErrLFSObjectNotExist or a database error.
func RemoveOldDeletedBranches ¶ added in v1.3.0
RemoveOldDeletedBranches removes old deleted branches
func RemoveOrgUser ¶
RemoveOrgUser removes user from given organization.
func RemoveTeamMember ¶
RemoveTeamMember removes member from given team of given organization.
func RemoveTemporaryPath ¶ added in v1.9.0
RemoveTemporaryPath removes the temporary path
func RenameBranch ¶ added in v1.16.0
func RenameBranch(repo *repo_model.Repository, from, to string, gitAction func(isDefault bool) error) (err error)
RenameBranch rename a branch
func ReviewExists ¶ added in v1.11.0
ReviewExists returns whether a review exists for a particular line of code in the PR
func SaveOrUpdateTag ¶ added in v1.12.0
func SaveOrUpdateTag(repo *repo_model.Repository, newRel *Release) error
SaveOrUpdateTag must be called for any push actions to add tag
func SearchIssueIDsByKeyword ¶ added in v1.8.0
SearchIssueIDsByKeyword search issues on database
func SearchRepositoryCondition ¶ added in v1.11.4
func SearchRepositoryCondition(opts *SearchRepoOptions) builder.Cond
SearchRepositoryCondition creates a query condition according search repository options
func SearchRepositoryIDs ¶ added in v1.14.0
func SearchRepositoryIDs(opts *SearchRepoOptions) ([]int64, int64, error)
SearchRepositoryIDs takes keyword and part of repository name to search, it returns results in given range and number of total results.
func SecToTime ¶ added in v1.5.0
SecToTime converts an amount of seconds to a human-readable string (example: 66s -> 1min 6s)
func SetDefaultBoard ¶ added in v1.14.0
SetDefaultBoard represents a board for issues not assigned to one if boardID is 0 unset default
func SetRepoReadBy ¶ added in v1.16.0
SetRepoReadBy sets repo to be visited by given user.
func SortReleases ¶
func SortReleases(rels []*Release)
SortReleases sorts releases by number of commits and created time.
func SrgbToLinear ¶ added in v1.16.0
SrgbToLinear converts a component of an sRGB color to its linear intensity See: https://en.wikipedia.org/wiki/SRGB#The_reverse_transformation_(sRGB_to_CIE_XYZ)
func StatsCorrectSQL ¶ added in v1.16.0
func StopwatchExists ¶ added in v1.3.0
StopwatchExists returns true if the stopwatch exists
func SubmitReview ¶ added in v1.11.0
func SubmitReview(doer *user_model.User, issue *Issue, reviewType ReviewType, content, commitID string, stale bool, attachmentUUIDs []string) (*Review, *Comment, error)
SubmitReview creates a review out of the existing pending review or creates a new one if no pending review exist
func TestRepositoryReadyForTransfer ¶ added in v1.14.0
func TestRepositoryReadyForTransfer(status repo_model.RepositoryStatus) error
TestRepositoryReadyForTransfer make sure repo is ready to transfer
func TotalTimes ¶ added in v1.3.0
func TotalTimes(options *FindTrackedTimesOptions) (map[*user_model.User]string, error)
TotalTimes returns the spent time for each user by an issue
func TransferOwnership ¶
func TransferOwnership(doer *user_model.User, newOwnerName string, repo *repo_model.Repository) (err error)
TransferOwnership transfers all corresponding repository items from old user to new one.
func UnlockIssue ¶ added in v1.8.0
func UnlockIssue(opts *IssueLockOptions) error
UnlockIssue unlocks a previously locked issue.
func UpdateAccessToken ¶
func UpdateAccessToken(t *AccessToken) error
UpdateAccessToken updates information of access token.
func UpdateComment ¶
func UpdateComment(c *Comment, doer *user_model.User) error
UpdateComment updates information of comment.
func UpdateCommentsMigrationsByType ¶ added in v1.10.0
func UpdateCommentsMigrationsByType(tp structs.GitServiceType, originalAuthorID string, posterID int64) error
UpdateCommentsMigrationsByType updates comments' migrations information via given git service type and original id and poster id
func UpdateIssueDeadline ¶ added in v1.5.0
func UpdateIssueDeadline(issue *Issue, deadlineUnix timeutil.TimeStamp, doer *user_model.User) (err error)
UpdateIssueDeadline updates an issue deadline and adds comments. Setting a deadline to 0 means deleting it.
func UpdateIssueMentions ¶
UpdateIssueMentions updates issue-user relations for mentioned users.
func UpdateIssueUserByRead ¶
UpdateIssueUserByRead updates issue-user relation for reading.
func UpdateIssueUsersByMentions ¶
UpdateIssueUsersByMentions updates issue-user pairs by mentioning.
func UpdateIssuesMigrationsByType ¶ added in v1.10.0
func UpdateIssuesMigrationsByType(gitServiceType api.GitServiceType, originalAuthorID string, posterID int64) error
UpdateIssuesMigrationsByType updates all migrated repositories' issues from gitServiceType to replace originalAuthorID to posterID
func UpdateMigrationsByType ¶ added in v1.10.0
func UpdateMigrationsByType(tp structs.GitServiceType, externalUserID string, userID int64) error
UpdateMigrationsByType updates all migrated repositories' posterid from gitServiceType to replace originalAuthorID to posterID
func UpdateMilestone ¶
UpdateMilestone updates information of given milestone.
func UpdateNotificationStatuses ¶ added in v1.4.0
func UpdateNotificationStatuses(user *user_model.User, currentStatus, desiredStatus NotificationStatus) error
UpdateNotificationStatuses updates the statuses of all of a user's notifications that are of the currentStatus type to the desiredStatus
func UpdateProject ¶ added in v1.13.0
UpdateProject updates project properties
func UpdateProjectBoard ¶ added in v1.13.0
func UpdateProjectBoard(board *ProjectBoard) error
UpdateProjectBoard updates a project board
func UpdateProjectBoardSorting ¶ added in v1.14.0
func UpdateProjectBoardSorting(bs ProjectBoardList) error
UpdateProjectBoardSorting update project board sorting
func UpdateProtectBranch ¶ added in v1.3.0
func UpdateProtectBranch(repo *repo_model.Repository, protectBranch *ProtectedBranch, opts WhitelistOptions) (err error)
UpdateProtectBranch saves branch protection options of repository. If ID is 0, it creates a new record. Otherwise, updates existing record. This function also performs check if whitelist user and team's IDs have been changed to avoid unnecessary whitelist delete and regenerate.
func UpdateProtectedTag ¶ added in v1.15.0
func UpdateProtectedTag(pt *ProtectedTag) error
UpdateProtectedTag updates the protected tag
func UpdateReactionsMigrationsByType ¶ added in v1.12.0
func UpdateReactionsMigrationsByType(gitServiceType api.GitServiceType, originalAuthorID string, userID int64) error
UpdateReactionsMigrationsByType updates all migrated repositories' reactions from gitServiceType to replace originalAuthorID to posterID
func UpdateRelease ¶
UpdateRelease updates all columns of a release
func UpdateReleasesMigrationsByType ¶ added in v1.10.0
func UpdateReleasesMigrationsByType(gitServiceType structs.GitServiceType, originalAuthorID string, posterID int64) error
UpdateReleasesMigrationsByType updates all migrated repositories' releases from gitServiceType to replace originalAuthorID to posterID
func UpdateRepoSize ¶ added in v1.16.0
func UpdateRepoSize(ctx context.Context, repo *repo_model.Repository) error
UpdateRepoSize updates the repository size, calculating it using util.GetDirectorySize
func UpdateRepository ¶
func UpdateRepository(repo *repo_model.Repository, visibilityChanged bool) (err error)
UpdateRepository updates a repository
func UpdateRepositoryCtx ¶ added in v1.12.0
func UpdateRepositoryCtx(ctx context.Context, repo *repo_model.Repository, visibilityChanged bool) error
UpdateRepositoryCtx updates a repository with db context
func UpdateReviewsMigrationsByType ¶ added in v1.12.0
func UpdateReviewsMigrationsByType(tp structs.GitServiceType, originalAuthorID string, posterID int64) error
UpdateReviewsMigrationsByType updates reviews' migrations information via given git service type and original id and poster id
func UpdateTeam ¶
UpdateTeam updates information of team.
func UpdateTeamUnits ¶ added in v1.5.0
UpdateTeamUnits updates a teams's units
func UploadLocalPath ¶
UploadLocalPath returns where uploads is stored in local file system based on given UUID.
func UsersInTeamsCount ¶ added in v1.7.0
UsersInTeamsCount counts the number of users which are in userIDs and teamIDs
Types ¶
type Access ¶
type Access struct { ID int64 `xorm:"pk autoincr"` UserID int64 `xorm:"UNIQUE(s)"` RepoID int64 `xorm:"UNIQUE(s)"` Mode perm.AccessMode }
Access represents the highest access level of a user to the repository. The only access type that is not in this table is the real owner of a repository. In case of an organization repository, the members of the owners team are in this table.
type AccessToken ¶
type AccessToken struct { ID int64 `xorm:"pk autoincr"` UID int64 `xorm:"INDEX"` Name string Token string `xorm:"-"` TokenHash string `xorm:"UNIQUE"` // sha256 of token TokenSalt string TokenLastEight string `xorm:"token_last_eight"` CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"` UpdatedUnix timeutil.TimeStamp `xorm:"INDEX updated"` HasRecentActivity bool `xorm:"-"` HasUsed bool `xorm:"-"` }
AccessToken represents a personal access token.
func GetAccessTokenBySHA ¶
func GetAccessTokenBySHA(token string) (*AccessToken, error)
GetAccessTokenBySHA returns access token by given token value
func ListAccessTokens ¶
func ListAccessTokens(opts ListAccessTokensOptions) ([]*AccessToken, error)
ListAccessTokens returns a list of access tokens belongs to given user.
func (*AccessToken) AfterLoad ¶ added in v1.3.0
func (t *AccessToken) AfterLoad()
AfterLoad is invoked from XORM after setting the values of all fields of this object.
type AccessibleReposEnvironment ¶ added in v1.1.0
type AccessibleReposEnvironment interface { CountRepos() (int64, error) RepoIDs(page, pageSize int) ([]int64, error) Repos(page, pageSize int) ([]*repo_model.Repository, error) MirrorRepos() ([]*repo_model.Repository, error) AddKeyword(keyword string) SetSort(db.SearchOrderBy) }
AccessibleReposEnvironment operations involving the repositories that are accessible to a particular user
type Action ¶
type Action struct { ID int64 `xorm:"pk autoincr"` UserID int64 `xorm:"INDEX"` // Receiver user id. OpType ActionType ActUserID int64 `xorm:"INDEX"` // Action user id. ActUser *user_model.User `xorm:"-"` RepoID int64 `xorm:"INDEX"` Repo *repo_model.Repository `xorm:"-"` CommentID int64 `xorm:"INDEX"` Comment *Comment `xorm:"-"` IsDeleted bool `xorm:"INDEX NOT NULL DEFAULT false"` RefName string IsPrivate bool `xorm:"INDEX NOT NULL DEFAULT false"` Content string `xorm:"TEXT"` CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"` }
Action represents user operation type and other information to repository. It implemented interface base.Actioner so that can be used in template render.
func GetFeeds ¶
func GetFeeds(opts GetFeedsOptions) ([]*Action, error)
GetFeeds returns actions according to the provided options
func (*Action) GetActFullName ¶ added in v1.6.0
GetActFullName gets the action's user full name.
func (*Action) GetActUserName ¶
GetActUserName gets the action's user name.
func (*Action) GetCommentLink ¶ added in v1.2.0
GetCommentLink returns link to action comment.
func (*Action) GetContent ¶
GetContent returns the action's content.
func (*Action) GetDisplayName ¶ added in v1.9.0
GetDisplayName gets the action's display name based on DEFAULT_SHOW_FULL_NAME, or falls back to the username if it is blank.
func (*Action) GetDisplayNameTitle ¶ added in v1.9.0
GetDisplayNameTitle gets the action's display name used for the title (tooltip) based on DEFAULT_SHOW_FULL_NAME
func (*Action) GetIssueContent ¶
GetIssueContent returns the content of first issue associated with this action.
func (*Action) GetIssueInfos ¶
GetIssueInfos returns a list of issues associated with the action.
func (*Action) GetIssueTitle ¶
GetIssueTitle returns the title of first issue associated with the action.
func (*Action) GetOpType ¶
func (a *Action) GetOpType() ActionType
GetOpType gets the ActionType of this action.
func (*Action) GetRefLink ¶ added in v1.16.0
GetRefLink returns the action's ref link.
func (*Action) GetRepoLink ¶
GetRepoLink returns relative link to action repository.
func (*Action) GetRepoName ¶
GetRepoName returns the name of the action repository.
func (*Action) GetRepoPath ¶
GetRepoPath returns the virtual path to the action repository.
func (*Action) GetRepoUserName ¶
GetRepoUserName returns the name of the action repository owner.
func (*Action) LoadActUser ¶ added in v1.14.0
func (a *Action) LoadActUser()
LoadActUser loads a.ActUser
func (*Action) ShortActUserName ¶
ShortActUserName gets the action's user name trimmed to max 20 chars.
func (*Action) ShortRepoName ¶
ShortRepoName returns the name of the action repository trimmed to max 33 chars.
func (*Action) ShortRepoPath ¶
ShortRepoPath returns the virtual path to the action repository trimmed to max 20 + 1 + 33 chars.
func (*Action) ShortRepoUserName ¶
ShortRepoUserName returns the name of the action repository owner trimmed to max 20 chars.
type ActionList ¶ added in v1.4.0
type ActionList []*Action
ActionList defines a list of actions
func (ActionList) LoadAttributes ¶ added in v1.4.0
func (actions ActionList) LoadAttributes() error
LoadAttributes loads attributes of the actions
func (ActionList) LoadRepositories ¶ added in v1.4.0
func (actions ActionList) LoadRepositories() ([]*repo_model.Repository, error)
LoadRepositories loads actions' all repositories
func (ActionList) LoadUsers ¶ added in v1.4.0
func (actions ActionList) LoadUsers() ([]*user_model.User, error)
LoadUsers loads actions' all users
type ActionType ¶
type ActionType int
ActionType represents the type of an action.
const ( ActionCreateRepo ActionType = iota + 1 // 1 ActionRenameRepo // 2 ActionStarRepo // 3 ActionWatchRepo // 4 ActionCommitRepo // 5 ActionCreateIssue // 6 ActionCreatePullRequest // 7 ActionTransferRepo // 8 ActionPushTag // 9 ActionCommentIssue // 10 ActionMergePullRequest // 11 ActionCloseIssue // 12 ActionReopenIssue // 13 ActionClosePullRequest // 14 ActionReopenPullRequest // 15 ActionDeleteTag // 16 ActionDeleteBranch // 17 ActionMirrorSyncPush // 18 ActionMirrorSyncCreate // 19 ActionMirrorSyncDelete // 20 ActionApprovePullRequest // 21 ActionRejectPullRequest // 22 ActionCommentPull // 23 ActionPublishRelease // 24 ActionPullReviewDismissed // 25 ActionPullRequestReadyForReview // 26 )
Possible action types.
type ActivityAuthorData ¶ added in v1.9.0
type ActivityAuthorData struct { Name string `json:"name"` Login string `json:"login"` AvatarLink string `json:"avatar_link"` HomeLink string `json:"home_link"` Commits int64 `json:"commits"` }
ActivityAuthorData represents statistical git commit count data
func GetActivityStatsTopAuthors ¶ added in v1.9.0
func GetActivityStatsTopAuthors(repo *repo_model.Repository, timeFrom time.Time, count int) ([]*ActivityAuthorData, error)
GetActivityStatsTopAuthors returns top author stats for git commits for all branches
type ActivityStats ¶ added in v1.3.0
type ActivityStats struct { OpenedPRs PullRequestList OpenedPRAuthorCount int64 MergedPRs PullRequestList MergedPRAuthorCount int64 OpenedIssues IssueList OpenedIssueAuthorCount int64 ClosedIssues IssueList ClosedIssueAuthorCount int64 UnresolvedIssues IssueList PublishedReleases []*Release PublishedReleaseAuthorCount int64 Code *git.CodeActivityStats }
ActivityStats represets issue and pull request information.
func GetActivityStats ¶ added in v1.3.0
func GetActivityStats(repo *repo_model.Repository, timeFrom time.Time, releases, issues, prs, code bool) (*ActivityStats, error)
GetActivityStats return stats for repository at given time range
func (*ActivityStats) ActiveIssueCount ¶ added in v1.3.0
func (stats *ActivityStats) ActiveIssueCount() int
ActiveIssueCount returns total active issue count
func (*ActivityStats) ActivePRCount ¶ added in v1.3.0
func (stats *ActivityStats) ActivePRCount() int
ActivePRCount returns total active pull request count
func (*ActivityStats) ClosedIssueCount ¶ added in v1.3.0
func (stats *ActivityStats) ClosedIssueCount() int
ClosedIssueCount returns closed issue count
func (*ActivityStats) ClosedIssuePerc ¶ added in v1.3.0
func (stats *ActivityStats) ClosedIssuePerc() int
ClosedIssuePerc returns closed issue count percent from total active
func (*ActivityStats) FillIssues ¶ added in v1.3.0
func (stats *ActivityStats) FillIssues(repoID int64, fromTime time.Time) error
FillIssues returns issue information for activity page
func (*ActivityStats) FillPullRequests ¶ added in v1.3.0
func (stats *ActivityStats) FillPullRequests(repoID int64, fromTime time.Time) error
FillPullRequests returns pull request information for activity page
func (*ActivityStats) FillReleases ¶ added in v1.3.0
func (stats *ActivityStats) FillReleases(repoID int64, fromTime time.Time) error
FillReleases returns release information for activity page
func (*ActivityStats) FillUnresolvedIssues ¶ added in v1.3.0
func (stats *ActivityStats) FillUnresolvedIssues(repoID int64, fromTime time.Time, issues, prs bool) error
FillUnresolvedIssues returns unresolved issue and pull request information for activity page
func (*ActivityStats) MergedPRCount ¶ added in v1.3.0
func (stats *ActivityStats) MergedPRCount() int
MergedPRCount returns merged pull request count
func (*ActivityStats) MergedPRPerc ¶ added in v1.3.0
func (stats *ActivityStats) MergedPRPerc() int
MergedPRPerc returns merged pull request percent from total active
func (*ActivityStats) OpenedIssueCount ¶ added in v1.3.0
func (stats *ActivityStats) OpenedIssueCount() int
OpenedIssueCount returns open issue count
func (*ActivityStats) OpenedIssuePerc ¶ added in v1.3.0
func (stats *ActivityStats) OpenedIssuePerc() int
OpenedIssuePerc returns open issue count percent from total active
func (*ActivityStats) OpenedPRCount ¶ added in v1.3.0
func (stats *ActivityStats) OpenedPRCount() int
OpenedPRCount returns opened pull request count
func (*ActivityStats) OpenedPRPerc ¶ added in v1.3.0
func (stats *ActivityStats) OpenedPRPerc() int
OpenedPRPerc returns opened pull request percents from total active
func (*ActivityStats) PublishedReleaseCount ¶ added in v1.3.0
func (stats *ActivityStats) PublishedReleaseCount() int
PublishedReleaseCount returns published release count
func (*ActivityStats) UnresolvedIssueCount ¶ added in v1.3.0
func (stats *ActivityStats) UnresolvedIssueCount() int
UnresolvedIssueCount returns unresolved issue and pull request count
type CodeComments ¶ added in v1.6.0
CodeComments represents comments on code by using this structure: FILENAME -> LINE (+ == proposed; - == previous) -> COMMENTS
func FetchCodeComments ¶ added in v1.6.0
func FetchCodeComments(issue *Issue, currentUser *user_model.User) (CodeComments, error)
FetchCodeComments will return a 2d-map: ["Path"]["Line"] = Comments at line
type Collaboration ¶
type Collaboration struct { ID int64 `xorm:"pk autoincr"` RepoID int64 `xorm:"UNIQUE(s) INDEX NOT NULL"` UserID int64 `xorm:"UNIQUE(s) INDEX NOT NULL"` Mode perm.AccessMode `xorm:"DEFAULT 2 NOT NULL"` CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"` UpdatedUnix timeutil.TimeStamp `xorm:"INDEX updated"` }
Collaboration represent the relation between an individual and a repository.
type Collaborator ¶
type Collaborator struct { *user_model.User Collaboration *Collaboration }
Collaborator represents a user with collaboration details.
func GetCollaborators ¶ added in v1.16.0
func GetCollaborators(repoID int64, listOptions db.ListOptions) ([]*Collaborator, error)
GetCollaborators returns the collaborators for a repository
type Comment ¶
type Comment struct { ID int64 `xorm:"pk autoincr"` Type CommentType `xorm:"INDEX"` PosterID int64 `xorm:"INDEX"` Poster *user_model.User `xorm:"-"` OriginalAuthor string OriginalAuthorID int64 IssueID int64 `xorm:"INDEX"` Issue *Issue `xorm:"-"` LabelID int64 Label *Label `xorm:"-"` AddedLabels []*Label `xorm:"-"` RemovedLabels []*Label `xorm:"-"` OldProjectID int64 ProjectID int64 OldProject *Project `xorm:"-"` Project *Project `xorm:"-"` OldMilestoneID int64 MilestoneID int64 OldMilestone *Milestone `xorm:"-"` Milestone *Milestone `xorm:"-"` TimeID int64 Time *TrackedTime `xorm:"-"` AssigneeID int64 RemovedAssignee bool Assignee *user_model.User `xorm:"-"` AssigneeTeamID int64 `xorm:"NOT NULL DEFAULT 0"` AssigneeTeam *Team `xorm:"-"` ResolveDoerID int64 ResolveDoer *user_model.User `xorm:"-"` OldTitle string NewTitle string OldRef string NewRef string DependentIssueID int64 DependentIssue *Issue `xorm:"-"` CommitID int64 Line int64 // - previous line / + proposed line TreePath string Content string `xorm:"LONGTEXT"` RenderedContent string `xorm:"-"` // Path represents the 4 lines of code cemented by this comment Patch string `xorm:"-"` PatchQuoted string `xorm:"LONGTEXT patch"` CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"` UpdatedUnix timeutil.TimeStamp `xorm:"INDEX updated"` // Reference issue in commit message CommitSHA string `xorm:"VARCHAR(40)"` Attachments []*repo_model.Attachment `xorm:"-"` Reactions ReactionList `xorm:"-"` // For view issue page. ShowRole RoleDescriptor `xorm:"-"` Review *Review `xorm:"-"` ReviewID int64 `xorm:"index"` Invalidated bool // Reference an issue or pull from another comment, issue or PR // All information is about the origin of the reference RefRepoID int64 `xorm:"index"` // Repo where the referencing RefIssueID int64 `xorm:"index"` RefCommentID int64 `xorm:"index"` // 0 if origin is Issue title or content (or PR's) RefAction references.XRefAction `xorm:"SMALLINT"` // What happens if RefIssueID resolves RefIsPull bool RefRepo *repo_model.Repository `xorm:"-"` RefIssue *Issue `xorm:"-"` RefComment *Comment `xorm:"-"` Commits []*SignCommitWithStatuses `xorm:"-"` OldCommit string `xorm:"-"` NewCommit string `xorm:"-"` CommitsNum int64 `xorm:"-"` IsForcePush bool `xorm:"-"` }
Comment represents a comment in commit and issue page.
func AddReviewRequest ¶ added in v1.12.0
func AddReviewRequest(issue *Issue, reviewer, doer *user_model.User) (*Comment, error)
AddReviewRequest add a review request from one reviewer
func AddTeamReviewRequest ¶ added in v1.13.0
AddTeamReviewRequest add a review request from one team
func CreateComment ¶
func CreateComment(opts *CreateCommentOptions) (comment *Comment, err error)
CreateComment creates comment of issue or commit.
func CreatePushPullComment ¶ added in v1.13.0
func CreatePushPullComment(pusher *user_model.User, pr *PullRequest, oldCommitID, newCommitID string) (comment *Comment, err error)
CreatePushPullComment create push code to pull base comment
func FetchCodeCommentsByLine ¶ added in v1.14.0
func FetchCodeCommentsByLine(issue *Issue, currentUser *user_model.User, treePath string, line int64) ([]*Comment, error)
FetchCodeCommentsByLine fetches the code comments for a given treePath and line number
func FindComments ¶ added in v1.2.0
func FindComments(opts *FindCommentsOptions) ([]*Comment, error)
FindComments returns all comments according options
func GetCommentByID ¶
GetCommentByID returns the comment by given ID.
func RemoveReviewRequest ¶ added in v1.12.0
func RemoveReviewRequest(issue *Issue, reviewer, doer *user_model.User) (*Comment, error)
RemoveReviewRequest remove a review request from one reviewer
func RemoveTeamReviewRequest ¶ added in v1.13.0
RemoveTeamReviewRequest remove a review request from one team
func UpdateIssueByAPI ¶ added in v1.10.2
func UpdateIssueByAPI(issue *Issue, doer *user_model.User) (statusChangeComment *Comment, titleChanged bool, err error)
UpdateIssueByAPI updates all allowed fields of given issue. If the issue status is changed a statusChangeComment is returned similarly if the title is changed the titleChanged bool is set to true
func (*Comment) AfterDelete ¶
func (c *Comment) AfterDelete()
AfterDelete is invoked from XORM after the object is deleted.
func (*Comment) AfterLoad ¶ added in v1.3.0
AfterLoad is invoked from XORM after setting the values of all fields of this object.
func (*Comment) BeforeInsert ¶
func (c *Comment) BeforeInsert()
BeforeInsert will be invoked by XORM before inserting a record
func (*Comment) BeforeUpdate ¶
func (c *Comment) BeforeUpdate()
BeforeUpdate will be invoked by XORM before updating a record
func (*Comment) CheckInvalidation ¶ added in v1.6.0
func (c *Comment) CheckInvalidation(repo *git.Repository, doer *user_model.User, branch string) error
CheckInvalidation checks if the line of code comment got changed by another commit. If the line got changed the comment is going to be invalidated.
func (*Comment) CodeCommentURL ¶ added in v1.6.0
CodeCommentURL returns the url to a comment in code
func (*Comment) DiffSide ¶ added in v1.6.0
DiffSide returns "previous" if Comment.Line is a LOC of the previous changes and "proposed" if it is a LOC of the proposed changes.
func (*Comment) IsResolved ¶ added in v1.12.0
IsResolved check if an code comment is resolved
func (*Comment) LoadAssigneeUserAndTeam ¶ added in v1.13.0
LoadAssigneeUserAndTeam if comment.Type is CommentTypeAssignees, then load assignees
func (*Comment) LoadAttachments ¶ added in v1.7.0
LoadAttachments loads attachments (it never returns error, the error during `GetAttachmentsByCommentIDCtx` is ignored)
func (*Comment) LoadDepIssueDetails ¶ added in v1.6.0
LoadDepIssueDetails loads Dependent Issue Details
func (*Comment) LoadLabel ¶ added in v1.1.0
LoadLabel if comment.Type is CommentTypeLabel, then load Label
func (*Comment) LoadMilestone ¶ added in v1.1.0
LoadMilestone if comment.Type is CommentTypeMilestone, then load milestone
func (*Comment) LoadPoster ¶ added in v1.7.0
LoadPoster loads comment poster
func (*Comment) LoadProject ¶ added in v1.13.0
LoadProject if comment.Type is CommentTypeProject, then load project.
func (*Comment) LoadPushCommits ¶ added in v1.13.0
LoadPushCommits Load push commits
func (*Comment) LoadReactions ¶ added in v1.4.0
func (c *Comment) LoadReactions(repo *repo_model.Repository) error
LoadReactions loads comment reactions
func (*Comment) LoadRefComment ¶ added in v1.10.0
LoadRefComment loads comment that created this reference from database
func (*Comment) LoadRefIssue ¶ added in v1.10.0
LoadRefIssue loads comment that created this reference from database
func (*Comment) LoadResolveDoer ¶ added in v1.12.0
LoadResolveDoer if comment.Type is CommentTypeCode and ResolveDoerID not zero, then load resolveDoer
func (*Comment) LoadReview ¶ added in v1.6.0
LoadReview loads the associated review
func (*Comment) LoadTime ¶ added in v1.14.0
LoadTime loads the associated time for a CommentTypeAddTimeManual
func (*Comment) RefCommentHTMLURL ¶ added in v1.10.0
RefCommentHTMLURL returns the HTML URL for the comment that created this reference
func (*Comment) RefIssueHTMLURL ¶ added in v1.10.0
RefIssueHTMLURL returns the HTML URL of the issue where this reference was created
func (*Comment) RefIssueIdent ¶ added in v1.10.0
RefIssueIdent returns the user friendly identity (e.g. "#1234") of the issue where this reference was created
func (*Comment) RefIssueTitle ¶ added in v1.10.0
RefIssueTitle returns the title of the issue where this reference was created
func (*Comment) UnsignedLine ¶ added in v1.6.0
UnsignedLine returns the LOC of the code comment without + or -
func (*Comment) UpdateAttachments ¶ added in v1.11.0
UpdateAttachments update attachments by UUIDs for the comment
type CommentList ¶ added in v1.7.0
type CommentList []*Comment
CommentList defines a list of comments
func (CommentList) Issues ¶ added in v1.9.0
func (comments CommentList) Issues() IssueList
Issues returns all the issues of comments
func (CommentList) LoadAttachments ¶ added in v1.9.0
func (comments CommentList) LoadAttachments() error
LoadAttachments loads attachments
func (CommentList) LoadAttributes ¶ added in v1.9.0
func (comments CommentList) LoadAttributes() error
LoadAttributes loads attributes of the comments, except for attachments and comments
func (CommentList) LoadIssues ¶ added in v1.9.0
func (comments CommentList) LoadIssues() error
LoadIssues loads issues of comments
func (CommentList) LoadPosters ¶ added in v1.7.0
func (comments CommentList) LoadPosters() error
LoadPosters loads posters
type CommentType ¶
type CommentType int
CommentType defines whether a comment is just a simple comment, an action (like close) or a reference.
const ( // 0 Plain comment, can be associated with a commit (CommitID > 0) and a line (LineNum > 0) CommentTypeComment CommentType = iota CommentTypeReopen // 1 CommentTypeClose // 2 // 3 References. CommentTypeIssueRef // 4 Reference from a commit (not part of a pull request) CommentTypeCommitRef // 5 Reference from a comment CommentTypeCommentRef // 6 Reference from a pull request CommentTypePullRef // 7 Labels changed CommentTypeLabel // 8 Milestone changed CommentTypeMilestone // 9 Assignees changed CommentTypeAssignees // 10 Change Title CommentTypeChangeTitle // 11 Delete Branch CommentTypeDeleteBranch // 12 Start a stopwatch for time tracking CommentTypeStartTracking // 13 Stop a stopwatch for time tracking CommentTypeStopTracking // 14 Add time manual for time tracking CommentTypeAddTimeManual // 15 Cancel a stopwatch for time tracking CommentTypeCancelTracking // 16 Added a due date CommentTypeAddedDeadline // 17 Modified the due date CommentTypeModifiedDeadline // 18 Removed a due date CommentTypeRemovedDeadline // 19 Dependency added CommentTypeAddDependency // 20 Dependency removed CommentTypeRemoveDependency // 21 Comment a line of code CommentTypeCode // 22 Reviews a pull request by giving general feedback CommentTypeReview // 23 Lock an issue, giving only collaborators access CommentTypeLock // 24 Unlocks a previously locked issue CommentTypeUnlock // 25 Change pull request's target branch CommentTypeChangeTargetBranch // 26 Delete time manual for time tracking CommentTypeDeleteTimeManual // 27 add or remove Request from one CommentTypeReviewRequest // 28 merge pull request CommentTypeMergePull // 29 push to PR head branch CommentTypePullPush // 30 Project changed CommentTypeProject // 31 Project board changed CommentTypeProjectBoard // 32 Dismiss Review CommentTypeDismissReview // 33 Change issue ref CommentTypeChangeIssueRef )
Enumerate all the comment types
const (
CommentTypeUnknown CommentType = -1
)
define unknown comment type
func (CommentType) String ¶ added in v1.16.0
func (t CommentType) String() string
type CommitStatus ¶ added in v1.2.0
type CommitStatus struct { ID int64 `xorm:"pk autoincr"` Index int64 `xorm:"INDEX UNIQUE(repo_sha_index)"` RepoID int64 `xorm:"INDEX UNIQUE(repo_sha_index)"` Repo *repo_model.Repository `xorm:"-"` State api.CommitStatusState `xorm:"VARCHAR(7) NOT NULL"` SHA string `xorm:"VARCHAR(64) NOT NULL INDEX UNIQUE(repo_sha_index)"` TargetURL string `xorm:"TEXT"` Description string `xorm:"TEXT"` ContextHash string `xorm:"char(40) index"` Context string `xorm:"TEXT"` Creator *user_model.User `xorm:"-"` CreatorID int64 CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"` UpdatedUnix timeutil.TimeStamp `xorm:"INDEX updated"` }
CommitStatus holds a single Status of a single Commit
func CalcCommitStatus ¶ added in v1.3.0
func CalcCommitStatus(statuses []*CommitStatus) *CommitStatus
CalcCommitStatus returns commit status state via some status, the commit statues should order by id desc
func GetCommitStatuses ¶ added in v1.2.0
func GetCommitStatuses(repo *repo_model.Repository, sha string, opts *CommitStatusOptions) ([]*CommitStatus, int64, error)
GetCommitStatuses returns all statuses for a given commit.
func GetLatestCommitStatus ¶ added in v1.2.0
func GetLatestCommitStatus(repoID int64, sha string, listOptions db.ListOptions) ([]*CommitStatus, int64, error)
GetLatestCommitStatus returns all statuses with a unique context for a given commit.
func (*CommitStatus) APIURL ¶ added in v1.2.0
func (status *CommitStatus) APIURL() string
APIURL returns the absolute APIURL to this commit-status.
type CommitStatusIndex ¶ added in v1.16.0
type CommitStatusIndex struct { ID int64 RepoID int64 `xorm:"unique(repo_sha)"` SHA string `xorm:"unique(repo_sha)"` MaxIndex int64 `xorm:"index"` }
CommitStatusIndex represents a table for commit status index
type CommitStatusOptions ¶ added in v1.10.0
type CommitStatusOptions struct { db.ListOptions State string SortType string }
CommitStatusOptions holds the options for query commit statuses
type ContentEmptyErr ¶ added in v1.11.0
type ContentEmptyErr struct{}
ContentEmptyErr represents an content empty error
func (ContentEmptyErr) Error ¶ added in v1.11.0
func (ContentEmptyErr) Error() string
type CreateCommentOptions ¶
type CreateCommentOptions struct { Type CommentType Doer *user_model.User Repo *repo_model.Repository Issue *Issue Label *Label DependentIssueID int64 OldMilestoneID int64 MilestoneID int64 OldProjectID int64 ProjectID int64 TimeID int64 AssigneeID int64 AssigneeTeamID int64 RemovedAssignee bool OldTitle string NewTitle string OldRef string NewRef string CommitID int64 CommitSHA string Patch string LineNum int64 TreePath string ReviewID int64 Content string Attachments []string // UUIDs of attachments RefRepoID int64 RefIssueID int64 RefCommentID int64 RefAction references.XRefAction RefIsPull bool IsForcePush bool Invalidated bool }
CreateCommentOptions defines options for creating comment
type CreateRepoOptions ¶
type CreateRepoOptions struct { Name string Description string OriginalURL string GitServiceType api.GitServiceType Gitignores string IssueLabels string License string Readme string DefaultBranch string IsPrivate bool IsMirror bool IsTemplate bool AutoInit bool Status repo_model.RepositoryStatus TrustModel repo_model.TrustModelType MirrorInterval string }
CreateRepoOptions contains the create repository options
type CreateReviewOptions ¶ added in v1.6.0
type CreateReviewOptions struct { Content string Type ReviewType Issue *Issue Reviewer *user_model.User ReviewerTeam *Team Official bool CommitID string Stale bool }
CreateReviewOptions represent the options to create a review. Type, Issue and Reviewer are required.
type DeletedBranch ¶ added in v1.3.0
type DeletedBranch struct { ID int64 `xorm:"pk autoincr"` RepoID int64 `xorm:"UNIQUE(s) INDEX NOT NULL"` Name string `xorm:"UNIQUE(s) NOT NULL"` Commit string `xorm:"UNIQUE(s) NOT NULL"` DeletedByID int64 `xorm:"INDEX"` DeletedBy *user_model.User `xorm:"-"` DeletedUnix timeutil.TimeStamp `xorm:"INDEX created"` }
DeletedBranch struct
func GetDeletedBranchByID ¶ added in v1.16.0
func GetDeletedBranchByID(repoID, id int64) (*DeletedBranch, error)
GetDeletedBranchByID get a deleted branch by its ID
func GetDeletedBranches ¶ added in v1.16.0
func GetDeletedBranches(repoID int64) ([]*DeletedBranch, error)
GetDeletedBranches returns all the deleted branches
func (*DeletedBranch) LoadUser ¶ added in v1.3.0
func (deletedBranch *DeletedBranch) LoadUser()
LoadUser loads the user that deleted the branch When there's no user found it returns a user_model.NewGhostUser
type DependencyInfo ¶ added in v1.11.0
type DependencyInfo struct { Issue `xorm:"extends"` repo_model.Repository `xorm:"extends"` }
DependencyInfo represents high level information about an issue which is a dependency of another issue.
type DependencyType ¶ added in v1.6.0
type DependencyType int
DependencyType Defines Dependency Type Constants
const ( DependencyTypeBlockedBy DependencyType = iota DependencyTypeBlocking )
Define Dependency Types
type ErrAccessTokenEmpty ¶
type ErrAccessTokenEmpty struct{}
ErrAccessTokenEmpty represents a "AccessTokenEmpty" kind of error.
func (ErrAccessTokenEmpty) Error ¶
func (err ErrAccessTokenEmpty) Error() string
type ErrAccessTokenNotExist ¶
type ErrAccessTokenNotExist struct {
Token string
}
ErrAccessTokenNotExist represents a "AccessTokenNotExist" kind of error.
func (ErrAccessTokenNotExist) Error ¶
func (err ErrAccessTokenNotExist) Error() string
type ErrBranchAlreadyExists ¶ added in v1.3.0
type ErrBranchAlreadyExists struct {
BranchName string
}
ErrBranchAlreadyExists represents an error that branch with such name already exists.
func (ErrBranchAlreadyExists) Error ¶ added in v1.3.0
func (err ErrBranchAlreadyExists) Error() string
type ErrBranchDoesNotExist ¶ added in v1.13.0
type ErrBranchDoesNotExist struct {
BranchName string
}
ErrBranchDoesNotExist represents an error that branch with such name does not exist.
func (ErrBranchDoesNotExist) Error ¶ added in v1.13.0
func (err ErrBranchDoesNotExist) Error() string
type ErrBranchNameConflict ¶ added in v1.3.0
type ErrBranchNameConflict struct {
BranchName string
}
ErrBranchNameConflict represents an error that branch name conflicts with other branch.
func (ErrBranchNameConflict) Error ¶ added in v1.3.0
func (err ErrBranchNameConflict) Error() string
type ErrBranchesEqual ¶ added in v1.11.0
ErrBranchesEqual represents an error that branch name conflicts with other branch.
func (ErrBranchesEqual) Error ¶ added in v1.11.0
func (err ErrBranchesEqual) Error() string
type ErrCircularDependency ¶ added in v1.6.0
ErrCircularDependency represents a "DependencyCircular" kind of error.
func (ErrCircularDependency) Error ¶ added in v1.6.0
func (err ErrCircularDependency) Error() string
type ErrCommentNotExist ¶
ErrCommentNotExist represents a "CommentNotExist" kind of error.
func (ErrCommentNotExist) Error ¶
func (err ErrCommentNotExist) Error() string
type ErrCommitIDDoesNotMatch ¶ added in v1.9.0
ErrCommitIDDoesNotMatch represents a "CommitIDDoesNotMatch" kind of error.
func (ErrCommitIDDoesNotMatch) Error ¶ added in v1.9.0
func (err ErrCommitIDDoesNotMatch) Error() string
type ErrDependenciesLeft ¶ added in v1.6.0
type ErrDependenciesLeft struct {
IssueID int64
}
ErrDependenciesLeft represents an error where the issue you're trying to close still has dependencies left.
func (ErrDependenciesLeft) Error ¶ added in v1.6.0
func (err ErrDependenciesLeft) Error() string
type ErrDependencyExists ¶ added in v1.6.0
ErrDependencyExists represents a "DependencyAlreadyExists" kind of error.
func (ErrDependencyExists) Error ¶ added in v1.6.0
func (err ErrDependencyExists) Error() string
type ErrDependencyNotExists ¶ added in v1.6.0
ErrDependencyNotExists represents a "DependencyAlreadyExists" kind of error.
func (ErrDependencyNotExists) Error ¶ added in v1.6.0
func (err ErrDependencyNotExists) Error() string
type ErrFilePathInvalid ¶ added in v1.9.0
ErrFilePathInvalid represents a "FilePathInvalid" kind of error.
func (ErrFilePathInvalid) Error ¶ added in v1.9.0
func (err ErrFilePathInvalid) Error() string
type ErrFilePathProtected ¶ added in v1.12.0
ErrFilePathProtected represents a "FilePathProtected" kind of error.
func (ErrFilePathProtected) Error ¶ added in v1.12.0
func (err ErrFilePathProtected) Error() string
type ErrFilenameInvalid ¶ added in v1.9.0
type ErrFilenameInvalid struct {
Path string
}
ErrFilenameInvalid represents a "FilenameInvalid" kind of error.
func (ErrFilenameInvalid) Error ¶ added in v1.9.0
func (err ErrFilenameInvalid) Error() string
type ErrForbiddenIssueReaction ¶ added in v1.11.0
type ErrForbiddenIssueReaction struct {
Reaction string
}
ErrForbiddenIssueReaction is used when a forbidden reaction was try to created
func (ErrForbiddenIssueReaction) Error ¶ added in v1.11.0
func (err ErrForbiddenIssueReaction) Error() string
type ErrForkAlreadyExist ¶ added in v1.9.0
ErrForkAlreadyExist represents a "ForkAlreadyExist" kind of error.
func (ErrForkAlreadyExist) Error ¶ added in v1.9.0
func (err ErrForkAlreadyExist) Error() string
type ErrInvalidCloneAddr ¶
type ErrInvalidCloneAddr struct { Host string IsURLError bool IsInvalidPath bool IsProtocolInvalid bool IsPermissionDenied bool LocalPath bool NotResolvedIP bool }
ErrInvalidCloneAddr represents a "InvalidCloneAddr" kind of error.
func (*ErrInvalidCloneAddr) Error ¶
func (err *ErrInvalidCloneAddr) Error() string
type ErrInvalidMergeStyle ¶ added in v1.4.0
type ErrInvalidMergeStyle struct { ID int64 Style repo_model.MergeStyle }
ErrInvalidMergeStyle represents an error if merging with disabled merge strategy
func (ErrInvalidMergeStyle) Error ¶ added in v1.4.0
func (err ErrInvalidMergeStyle) Error() string
type ErrInvalidTagName ¶
type ErrInvalidTagName struct {
TagName string
}
ErrInvalidTagName represents a "InvalidTagName" kind of error.
func (ErrInvalidTagName) Error ¶
func (err ErrInvalidTagName) Error() string
type ErrIssueIsClosed ¶ added in v1.11.0
ErrIssueIsClosed represents a "IssueIsClosed" kind of error.
func (ErrIssueIsClosed) Error ¶ added in v1.11.0
func (err ErrIssueIsClosed) Error() string
type ErrIssueLabelTemplateLoad ¶ added in v1.10.0
ErrIssueLabelTemplateLoad represents a "ErrIssueLabelTemplateLoad" kind of error.
func (ErrIssueLabelTemplateLoad) Error ¶ added in v1.10.0
func (err ErrIssueLabelTemplateLoad) Error() string
type ErrIssueNotExist ¶
ErrIssueNotExist represents a "IssueNotExist" kind of error.
func (ErrIssueNotExist) Error ¶
func (err ErrIssueNotExist) Error() string
type ErrIssueStopwatchAlreadyExist ¶ added in v1.15.7
ErrIssueStopwatchAlreadyExist represents an error that stopwatch is already exist
func (ErrIssueStopwatchAlreadyExist) Error ¶ added in v1.15.7
func (err ErrIssueStopwatchAlreadyExist) Error() string
type ErrIssueStopwatchNotExist ¶ added in v1.15.7
ErrIssueStopwatchNotExist represents an error that stopwatch is not exist
func (ErrIssueStopwatchNotExist) Error ¶ added in v1.15.7
func (err ErrIssueStopwatchNotExist) Error() string
type ErrIssueWasClosed ¶ added in v1.11.0
ErrIssueWasClosed is used when close a closed issue
func (ErrIssueWasClosed) Error ¶ added in v1.11.0
func (err ErrIssueWasClosed) Error() string
type ErrLFSFileLocked ¶ added in v1.11.0
ErrLFSFileLocked represents a "LFSFileLocked" kind of error.
func (ErrLFSFileLocked) Error ¶ added in v1.11.0
func (err ErrLFSFileLocked) Error() string
type ErrLFSLockAlreadyExist ¶ added in v1.4.0
ErrLFSLockAlreadyExist represents a "LFSLockAlreadyExist" kind of error.
func (ErrLFSLockAlreadyExist) Error ¶ added in v1.4.0
func (err ErrLFSLockAlreadyExist) Error() string
type ErrLFSLockNotExist ¶ added in v1.4.0
ErrLFSLockNotExist represents a "LFSLockNotExist" kind of error.
func (ErrLFSLockNotExist) Error ¶ added in v1.4.0
func (err ErrLFSLockNotExist) Error() string
type ErrLFSUnauthorizedAction ¶ added in v1.4.0
type ErrLFSUnauthorizedAction struct {}
ErrLFSUnauthorizedAction represents a "LFSUnauthorizedAction" kind of error.
func (ErrLFSUnauthorizedAction) Error ¶ added in v1.4.0
func (err ErrLFSUnauthorizedAction) Error() string
type ErrLabelNotExist ¶
type ErrLabelNotExist struct {
LabelID int64
}
ErrLabelNotExist represents a "LabelNotExist" kind of error.
func (ErrLabelNotExist) Error ¶
func (err ErrLabelNotExist) Error() string
type ErrLastOrgOwner ¶
type ErrLastOrgOwner struct {
UID int64
}
ErrLastOrgOwner represents a "LastOrgOwner" kind of error.
func (ErrLastOrgOwner) Error ¶
func (err ErrLastOrgOwner) Error() string
type ErrMergeConflicts ¶ added in v1.11.0
type ErrMergeConflicts struct { Style repo_model.MergeStyle StdOut string StdErr string Err error }
ErrMergeConflicts represents an error if merging fails with a conflict
func (ErrMergeConflicts) Error ¶ added in v1.11.0
func (err ErrMergeConflicts) Error() string
type ErrMergeUnrelatedHistories ¶ added in v1.11.0
type ErrMergeUnrelatedHistories struct {}
ErrMergeUnrelatedHistories represents an error if merging fails due to unrelated histories
func (ErrMergeUnrelatedHistories) Error ¶ added in v1.11.0
func (err ErrMergeUnrelatedHistories) Error() string
type ErrMilestoneNotExist ¶
ErrMilestoneNotExist represents a "MilestoneNotExist" kind of error.
func (ErrMilestoneNotExist) Error ¶
func (err ErrMilestoneNotExist) Error() string
type ErrNewIssueInsert ¶ added in v1.10.0
type ErrNewIssueInsert struct {
OriginalError error
}
ErrNewIssueInsert is used when the INSERT statement in newIssue fails
func (ErrNewIssueInsert) Error ¶ added in v1.10.0
func (err ErrNewIssueInsert) Error() string
type ErrNoPendingRepoTransfer ¶ added in v1.14.0
type ErrNoPendingRepoTransfer struct {
RepoID int64
}
ErrNoPendingRepoTransfer is an error type for repositories without a pending transfer request
func (ErrNoPendingRepoTransfer) Error ¶ added in v1.14.0
func (e ErrNoPendingRepoTransfer) Error() string
type ErrNotAllowedToMerge ¶ added in v1.5.0
type ErrNotAllowedToMerge struct {
Reason string
}
ErrNotAllowedToMerge represents an error that a branch is protected and the current user is not allowed to modify it.
func (ErrNotAllowedToMerge) Error ¶ added in v1.5.0
func (err ErrNotAllowedToMerge) Error() string
type ErrNotExist ¶ added in v1.10.0
type ErrNotExist struct {
ID int64
}
ErrNotExist represents a non-exist error.
func (ErrNotExist) Error ¶ added in v1.10.0
func (err ErrNotExist) Error() string
type ErrNotValidReviewRequest ¶ added in v1.13.0
ErrNotValidReviewRequest an not allowed review request modify
func (ErrNotValidReviewRequest) Error ¶ added in v1.13.0
func (err ErrNotValidReviewRequest) Error() string
type ErrOrgLabelNotExist ¶ added in v1.12.0
ErrOrgLabelNotExist represents a "OrgLabelNotExist" kind of error.
func (ErrOrgLabelNotExist) Error ¶ added in v1.12.0
func (err ErrOrgLabelNotExist) Error() string
type ErrOrgNotExist ¶
ErrOrgNotExist represents a "OrgNotExist" kind of error.
func (ErrOrgNotExist) Error ¶ added in v1.2.0
func (err ErrOrgNotExist) Error() string
type ErrProjectBoardNotExist ¶ added in v1.13.0
type ErrProjectBoardNotExist struct {
BoardID int64
}
ErrProjectBoardNotExist represents a "ProjectBoardNotExist" kind of error.
func (ErrProjectBoardNotExist) Error ¶ added in v1.13.0
func (err ErrProjectBoardNotExist) Error() string
type ErrProjectNotExist ¶ added in v1.13.0
ErrProjectNotExist represents a "ProjectNotExist" kind of error.
func (ErrProjectNotExist) Error ¶ added in v1.13.0
func (err ErrProjectNotExist) Error() string
type ErrProtectedTagName ¶ added in v1.15.0
type ErrProtectedTagName struct {
TagName string
}
ErrProtectedTagName represents a "ProtectedTagName" kind of error.
func (ErrProtectedTagName) Error ¶ added in v1.15.0
func (err ErrProtectedTagName) Error() string
type ErrPullRequestAlreadyExists ¶ added in v1.0.0
type ErrPullRequestAlreadyExists struct { ID int64 IssueID int64 HeadRepoID int64 BaseRepoID int64 HeadBranch string BaseBranch string }
ErrPullRequestAlreadyExists represents a "PullRequestAlreadyExists"-error
func (ErrPullRequestAlreadyExists) Error ¶ added in v1.0.0
func (err ErrPullRequestAlreadyExists) Error() string
Error does pretty-printing :D
type ErrPullRequestHasMerged ¶ added in v1.11.0
type ErrPullRequestHasMerged struct { ID int64 IssueID int64 HeadRepoID int64 BaseRepoID int64 HeadBranch string BaseBranch string }
ErrPullRequestHasMerged represents a "PullRequestHasMerged"-error
func (ErrPullRequestHasMerged) Error ¶ added in v1.11.0
func (err ErrPullRequestHasMerged) Error() string
Error does pretty-printing :D
type ErrPullRequestHeadRepoMissing ¶ added in v1.9.0
ErrPullRequestHeadRepoMissing represents a "ErrPullRequestHeadRepoMissing" error
func (ErrPullRequestHeadRepoMissing) Error ¶ added in v1.9.0
func (err ErrPullRequestHeadRepoMissing) Error() string
Error does pretty-printing :D
type ErrPullRequestNotExist ¶
type ErrPullRequestNotExist struct { ID int64 IssueID int64 HeadRepoID int64 BaseRepoID int64 HeadBranch string BaseBranch string }
ErrPullRequestNotExist represents a "PullRequestNotExist" kind of error.
func (ErrPullRequestNotExist) Error ¶
func (err ErrPullRequestNotExist) Error() string
type ErrPullWasClosed ¶ added in v1.11.0
ErrPullWasClosed is used close a closed pull request
func (ErrPullWasClosed) Error ¶ added in v1.11.0
func (err ErrPullWasClosed) Error() string
type ErrReactionAlreadyExist ¶ added in v1.10.2
type ErrReactionAlreadyExist struct {
Reaction string
}
ErrReactionAlreadyExist is used when a existing reaction was try to created
func (ErrReactionAlreadyExist) Error ¶ added in v1.10.2
func (err ErrReactionAlreadyExist) Error() string
type ErrRebaseConflicts ¶ added in v1.11.0
type ErrRebaseConflicts struct { Style repo_model.MergeStyle CommitSHA string StdOut string StdErr string Err error }
ErrRebaseConflicts represents an error if rebase fails with a conflict
func (ErrRebaseConflicts) Error ¶ added in v1.11.0
func (err ErrRebaseConflicts) Error() string
type ErrReleaseAlreadyExist ¶
type ErrReleaseAlreadyExist struct {
TagName string
}
ErrReleaseAlreadyExist represents a "ReleaseAlreadyExist" kind of error.
func (ErrReleaseAlreadyExist) Error ¶
func (err ErrReleaseAlreadyExist) Error() string
type ErrReleaseNotExist ¶
ErrReleaseNotExist represents a "ReleaseNotExist" kind of error.
func (ErrReleaseNotExist) Error ¶
func (err ErrReleaseNotExist) Error() string
type ErrRepoFileAlreadyExists ¶ added in v1.9.0
type ErrRepoFileAlreadyExists struct {
Path string
}
ErrRepoFileAlreadyExists represents a "RepoFileAlreadyExist" kind of error.
func (ErrRepoFileAlreadyExists) Error ¶ added in v1.9.0
func (err ErrRepoFileAlreadyExists) Error() string
type ErrRepoFileDoesNotExist ¶ added in v1.9.0
ErrRepoFileDoesNotExist represents a "RepoFileDoesNotExist" kind of error.
func (ErrRepoFileDoesNotExist) Error ¶ added in v1.9.0
func (err ErrRepoFileDoesNotExist) Error() string
type ErrRepoLabelNotExist ¶ added in v1.12.0
ErrRepoLabelNotExist represents a "RepoLabelNotExist" kind of error.
func (ErrRepoLabelNotExist) Error ¶ added in v1.12.0
func (err ErrRepoLabelNotExist) Error() string
type ErrRepoTransferInProgress ¶ added in v1.14.0
ErrRepoTransferInProgress represents the state of a repository that has an ongoing transfer
func (ErrRepoTransferInProgress) Error ¶ added in v1.14.0
func (err ErrRepoTransferInProgress) Error() string
type ErrReviewNotExist ¶ added in v1.6.0
type ErrReviewNotExist struct {
ID int64
}
ErrReviewNotExist represents a "ReviewNotExist" kind of error.
func (ErrReviewNotExist) Error ¶ added in v1.6.0
func (err ErrReviewNotExist) Error() string
type ErrSHADoesNotMatch ¶ added in v1.9.0
ErrSHADoesNotMatch represents a "SHADoesNotMatch" kind of error.
func (ErrSHADoesNotMatch) Error ¶ added in v1.9.0
func (err ErrSHADoesNotMatch) Error() string
type ErrSHANotFound ¶ added in v1.9.0
type ErrSHANotFound struct {
SHA string
}
ErrSHANotFound represents a "SHADoesNotMatch" kind of error.
func (ErrSHANotFound) Error ¶ added in v1.9.0
func (err ErrSHANotFound) Error() string
type ErrSHAOrCommitIDNotProvided ¶ added in v1.9.0
type ErrSHAOrCommitIDNotProvided struct{}
ErrSHAOrCommitIDNotProvided represents a "SHAOrCommitIDNotProvided" kind of error.
func (ErrSHAOrCommitIDNotProvided) Error ¶ added in v1.9.0
func (err ErrSHAOrCommitIDNotProvided) Error() string
type ErrStopwatchNotExist ¶ added in v1.3.0
type ErrStopwatchNotExist struct {
ID int64
}
ErrStopwatchNotExist represents a "Stopwatch Not Exist" kind of error.
func (ErrStopwatchNotExist) Error ¶ added in v1.3.0
func (err ErrStopwatchNotExist) Error() string
type ErrTagAlreadyExists ¶ added in v1.3.0
type ErrTagAlreadyExists struct {
TagName string
}
ErrTagAlreadyExists represents an error that tag with such name already exists.
func (ErrTagAlreadyExists) Error ¶ added in v1.3.0
func (err ErrTagAlreadyExists) Error() string
type ErrTaskDoesNotExist ¶ added in v1.10.0
ErrTaskDoesNotExist represents a "TaskDoesNotExist" kind of error.
func (ErrTaskDoesNotExist) Error ¶ added in v1.10.0
func (err ErrTaskDoesNotExist) Error() string
type ErrTeamAlreadyExist ¶
ErrTeamAlreadyExist represents a "TeamAlreadyExist" kind of error.
func (ErrTeamAlreadyExist) Error ¶
func (err ErrTeamAlreadyExist) Error() string
type ErrTeamNotExist ¶
ErrTeamNotExist represents a "TeamNotExist" error
func (ErrTeamNotExist) Error ¶ added in v1.10.0
func (err ErrTeamNotExist) Error() string
type ErrTrackedTimeNotExist ¶ added in v1.3.0
type ErrTrackedTimeNotExist struct {
ID int64
}
ErrTrackedTimeNotExist represents a "TrackedTime Not Exist" kind of error.
func (ErrTrackedTimeNotExist) Error ¶ added in v1.3.0
func (err ErrTrackedTimeNotExist) Error() string
type ErrUnknownDependencyType ¶ added in v1.6.0
type ErrUnknownDependencyType struct {
Type DependencyType
}
ErrUnknownDependencyType represents an error where an unknown dependency type was passed
func (ErrUnknownDependencyType) Error ¶ added in v1.6.0
func (err ErrUnknownDependencyType) Error() string
type ErrUpdateTaskNotExist ¶
type ErrUpdateTaskNotExist struct {
UUID string
}
ErrUpdateTaskNotExist represents a "UpdateTaskNotExist" kind of error.
func (ErrUpdateTaskNotExist) Error ¶
func (err ErrUpdateTaskNotExist) Error() string
type ErrUploadNotExist ¶
ErrUploadNotExist represents a "UploadNotExist" kind of error.
func (ErrUploadNotExist) Error ¶
func (err ErrUploadNotExist) Error() string
type ErrUserCannotCommit ¶ added in v1.9.0
type ErrUserCannotCommit struct {
UserName string
}
ErrUserCannotCommit represents "UserCannotCommit" kind of error.
func (ErrUserCannotCommit) Error ¶ added in v1.9.0
func (err ErrUserCannotCommit) Error() string
type ErrUserDoesNotHaveAccessToRepo ¶ added in v1.5.0
ErrUserDoesNotHaveAccessToRepo represets an error where the user doesn't has access to a given repo.
func (ErrUserDoesNotHaveAccessToRepo) Error ¶ added in v1.5.0
func (err ErrUserDoesNotHaveAccessToRepo) Error() string
type ErrUserHasOrgs ¶
type ErrUserHasOrgs struct {
UID int64
}
ErrUserHasOrgs represents a "UserHasOrgs" kind of error.
func (ErrUserHasOrgs) Error ¶
func (err ErrUserHasOrgs) Error() string
type ErrUserNotAllowedCreateOrg ¶ added in v1.1.0
type ErrUserNotAllowedCreateOrg struct{}
ErrUserNotAllowedCreateOrg represents a "UserNotAllowedCreateOrg" kind of error.
func (ErrUserNotAllowedCreateOrg) Error ¶ added in v1.1.0
func (err ErrUserNotAllowedCreateOrg) Error() string
type ErrUserOwnRepos ¶
type ErrUserOwnRepos struct {
UID int64
}
ErrUserOwnRepos represents a "UserOwnRepos" kind of error.
func (ErrUserOwnRepos) Error ¶
func (err ErrUserOwnRepos) Error() string
type ErrWikiAlreadyExist ¶
type ErrWikiAlreadyExist struct {
Title string
}
ErrWikiAlreadyExist represents a "WikiAlreadyExist" kind of error.
func (ErrWikiAlreadyExist) Error ¶
func (err ErrWikiAlreadyExist) Error() string
type ErrWikiInvalidFileName ¶ added in v1.4.0
type ErrWikiInvalidFileName struct {
FileName string
}
ErrWikiInvalidFileName represents an invalid wiki file name.
func (ErrWikiInvalidFileName) Error ¶ added in v1.4.0
func (err ErrWikiInvalidFileName) Error() string
type ErrWikiReservedName ¶ added in v1.4.0
type ErrWikiReservedName struct {
Title string
}
ErrWikiReservedName represents a reserved name error.
func (ErrWikiReservedName) Error ¶ added in v1.4.0
func (err ErrWikiReservedName) Error() string
type FindCommentsOptions ¶ added in v1.2.0
type FindCommentsOptions struct { db.ListOptions RepoID int64 IssueID int64 ReviewID int64 Since int64 Before int64 Line int64 TreePath string Type CommentType }
FindCommentsOptions describes the conditions to Find comments
type FindNotificationOptions ¶ added in v1.12.0
type FindNotificationOptions struct { db.ListOptions UserID int64 RepoID int64 IssueID int64 Status []NotificationStatus Source []NotificationSource UpdatedAfterUnix int64 UpdatedBeforeUnix int64 }
FindNotificationOptions represent the filters for notifications. If an ID is 0 it will be ignored.
func (*FindNotificationOptions) ToCond ¶ added in v1.12.0
func (opts *FindNotificationOptions) ToCond() builder.Cond
ToCond will convert each condition into a xorm-Cond
type FindOrgMembersOpts ¶ added in v1.11.0
type FindOrgMembersOpts struct { db.ListOptions OrgID int64 PublicOnly bool }
FindOrgMembersOpts represensts find org members conditions
type FindOrgOptions ¶ added in v1.16.0
type FindOrgOptions struct { db.ListOptions UserID int64 IncludePrivate bool }
FindOrgOptions finds orgs options
type FindReactionsOptions ¶ added in v1.4.0
type FindReactionsOptions struct { db.ListOptions IssueID int64 CommentID int64 UserID int64 Reaction string }
FindReactionsOptions describes the conditions to Find reactions
type FindReleasesOptions ¶ added in v1.2.0
type FindReleasesOptions struct { db.ListOptions IncludeDrafts bool IncludeTags bool IsPreRelease util.OptionalBool IsDraft util.OptionalBool TagNames []string }
FindReleasesOptions describes the conditions to Find releases
type FindReviewOptions ¶ added in v1.6.0
type FindReviewOptions struct { db.ListOptions Type ReviewType IssueID int64 ReviewerID int64 OfficialOnly bool }
FindReviewOptions represent possible filters to find reviews
type FindTaskOptions ¶ added in v1.10.0
type FindTaskOptions struct {
Status int
}
FindTaskOptions find all tasks
func (FindTaskOptions) ToConds ¶ added in v1.10.0
func (opts FindTaskOptions) ToConds() builder.Cond
ToConds generates conditions for database operation.
type FindTrackedTimesOptions ¶ added in v1.3.0
type FindTrackedTimesOptions struct { db.ListOptions IssueID int64 UserID int64 RepositoryID int64 MilestoneID int64 CreatedAfterUnix int64 CreatedBeforeUnix int64 }
FindTrackedTimesOptions represent the filters for tracked times. If an ID is 0 it will be ignored.
type GenerateRepoOptions ¶ added in v1.11.0
type GenerateRepoOptions struct { Name string Description string Private bool GitContent bool Topics bool GitHooks bool Webhooks bool Avatar bool IssueLabels bool }
GenerateRepoOptions contains the template units to generate
func (GenerateRepoOptions) IsValid ¶ added in v1.11.0
func (gro GenerateRepoOptions) IsValid() bool
IsValid checks whether at least one option is chosen for generation
type GetFeedsOptions ¶ added in v1.2.0
type GetFeedsOptions struct { RequestedUser *user_model.User // the user we want activity for RequestedTeam *Team // the team we want activity for Actor *user_model.User // the user viewing the activity IncludePrivate bool // include private actions OnlyPerformedBy bool // only actions performed by requested user IncludeDeleted bool // include deleted actions Date string // the day we want activity for: YYYY-MM-DD }
GetFeedsOptions options for retrieving feeds
type GetMilestonesOption ¶ added in v1.13.0
type GetMilestonesOption struct { db.ListOptions RepoID int64 State api.StateType Name string SortType string }
GetMilestonesOption contain options to get milestones
type GetUserTeamOptions ¶ added in v1.16.1
type GetUserTeamOptions struct { db.ListOptions UserID int64 }
GetUserTeamOptions holds the search options.
type GiteaTemplate ¶ added in v1.11.0
GiteaTemplate holds information about a .gitea/template file
func (GiteaTemplate) Globs ¶ added in v1.11.0
func (gt GiteaTemplate) Globs() []glob.Glob
Globs parses the .gitea/template globs or returns them if they were already parsed
type Issue ¶
type Issue struct { ID int64 `xorm:"pk autoincr"` RepoID int64 `xorm:"INDEX UNIQUE(repo_index)"` Repo *repo_model.Repository `xorm:"-"` Index int64 `xorm:"UNIQUE(repo_index)"` // Index in one repository. PosterID int64 `xorm:"INDEX"` Poster *user_model.User `xorm:"-"` OriginalAuthor string OriginalAuthorID int64 `xorm:"index"` Title string `xorm:"name"` Content string `xorm:"LONGTEXT"` RenderedContent string `xorm:"-"` Labels []*Label `xorm:"-"` MilestoneID int64 `xorm:"INDEX"` Milestone *Milestone `xorm:"-"` Project *Project `xorm:"-"` Priority int AssigneeID int64 `xorm:"-"` Assignee *user_model.User `xorm:"-"` IsClosed bool `xorm:"INDEX"` IsRead bool `xorm:"-"` IsPull bool `xorm:"INDEX"` // Indicates whether is a pull request or not. PullRequest *PullRequest `xorm:"-"` NumComments int Ref string DeadlineUnix timeutil.TimeStamp `xorm:"INDEX"` CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"` UpdatedUnix timeutil.TimeStamp `xorm:"INDEX updated"` ClosedUnix timeutil.TimeStamp `xorm:"INDEX"` Attachments []*repo_model.Attachment `xorm:"-"` Comments []*Comment `xorm:"-"` Reactions ReactionList `xorm:"-"` TotalTrackedTime int64 `xorm:"-"` Assignees []*user_model.User `xorm:"-"` // IsLocked limits commenting abilities to users on an issue // with write access IsLocked bool `xorm:"NOT NULL DEFAULT false"` // For view issue page. ShowRole RoleDescriptor `xorm:"-"` }
Issue represents an issue or pull request of repository.
func GetIssueByID ¶
GetIssueByID returns an issue by given ID.
func GetIssueByIndex ¶
GetIssueByIndex returns raw issue without loading attributes by index in a repository.
func GetIssueWithAttrsByID ¶ added in v1.7.0
GetIssueWithAttrsByID returns an issue with attributes by given ID.
func GetIssueWithAttrsByIndex ¶ added in v1.7.0
GetIssueWithAttrsByIndex returns issue by index in a repository.
func GetIssuesByIDs ¶ added in v1.2.0
GetIssuesByIDs return issues with the given IDs.
func Issues ¶
func Issues(opts *IssuesOptions) ([]*Issue, error)
Issues returns a list of issues by given conditions.
func (*Issue) BlockedByDependencies ¶ added in v1.6.0
func (issue *Issue) BlockedByDependencies() ([]*DependencyInfo, error)
BlockedByDependencies finds all Dependencies an issue is blocked by
func (*Issue) BlockingDependencies ¶ added in v1.6.0
func (issue *Issue) BlockingDependencies() ([]*DependencyInfo, error)
BlockingDependencies returns all blocking dependencies, aka all other issues a given issue blocks
func (*Issue) ChangeContent ¶
func (issue *Issue) ChangeContent(doer *user_model.User, content string) (err error)
ChangeContent changes issue content, as the given user.
func (*Issue) ChangeRef ¶ added in v1.13.0
func (issue *Issue) ChangeRef(doer *user_model.User, oldRef string) (err error)
ChangeRef changes the branch of this issue, as the given user.
func (*Issue) ChangeStatus ¶
ChangeStatus changes issue status to open or closed.
func (*Issue) ChangeTitle ¶
func (issue *Issue) ChangeTitle(doer *user_model.User, oldTitle string) (err error)
ChangeTitle changes the title of this issue, as the given user.
func (*Issue) ClearLabels ¶
func (issue *Issue) ClearLabels(doer *user_model.User) (err error)
ClearLabels removes all issue labels as the given user. Triggers appropriate WebHooks, if any.
func (*Issue) FindAndUpdateIssueMentions ¶ added in v1.13.2
func (issue *Issue) FindAndUpdateIssueMentions(ctx context.Context, doer *user_model.User, content string) (mentions []*user_model.User, err error)
FindAndUpdateIssueMentions finds users mentioned in the given content string, and saves them in the database.
func (*Issue) GetLastComment ¶ added in v1.12.0
GetLastComment return last comment for the current issue.
func (*Issue) GetLastEventLabel ¶ added in v1.8.0
GetLastEventLabel returns the localization label for the current issue.
func (*Issue) GetLastEventLabelFake ¶ added in v1.9.0
GetLastEventLabelFake returns the localization label for the current issue without providing a link in the username.
func (*Issue) GetLastEventTimestamp ¶ added in v1.8.0
GetLastEventTimestamp returns the last user visible event timestamp, either the creation of this issue or the close.
func (*Issue) GetPullRequest ¶ added in v1.1.0
func (issue *Issue) GetPullRequest() (pr *PullRequest, err error)
GetPullRequest returns the issue pull request
func (*Issue) GetTasksDone ¶ added in v1.4.0
GetTasksDone returns the amount of completed tasks in the issues content
func (*Issue) IsTimetrackerEnabled ¶ added in v1.5.0
IsTimetrackerEnabled returns true if the repo enables timetracking
func (*Issue) LoadAssignees ¶ added in v1.12.0
LoadAssignees load assignees of this issue.
func (*Issue) LoadAttributes ¶
LoadAttributes loads the attribute of this issue.
func (*Issue) LoadDiscussComments ¶ added in v1.8.0
LoadDiscussComments loads discuss comments
func (*Issue) LoadLabels ¶ added in v1.12.0
LoadLabels loads labels
func (*Issue) LoadMilestone ¶ added in v1.10.2
LoadMilestone load milestone of this issue.
func (*Issue) LoadPoster ¶ added in v1.7.0
LoadPoster loads poster
func (*Issue) LoadProject ¶ added in v1.13.0
LoadProject load the project the issue was assigned to
func (*Issue) LoadPullRequest ¶ added in v1.7.0
LoadPullRequest loads pull request info
func (*Issue) ProjectBoardID ¶ added in v1.13.0
ProjectBoardID return project board id if issue was assigned to one
func (*Issue) ReplaceLabels ¶
func (issue *Issue) ReplaceLabels(labels []*Label, doer *user_model.User) (err error)
ReplaceLabels removes all current labels and add new labels to the issue. Triggers appropriate WebHooks, if any.
func (*Issue) ResolveMentionsByVisibility ¶ added in v1.9.5
func (issue *Issue) ResolveMentionsByVisibility(ctx context.Context, doer *user_model.User, mentions []string) (users []*user_model.User, err error)
ResolveMentionsByVisibility returns the users mentioned in an issue, removing those that don't have access to reading it. Teams are expanded into their users, but organizations are ignored.
func (*Issue) ToggleAssignee ¶ added in v1.11.0
func (issue *Issue) ToggleAssignee(doer *user_model.User, assigneeID int64) (removed bool, comment *Comment, err error)
ToggleAssignee changes a user between assigned and not assigned for this issue, and make issue comment for it.
func (*Issue) UpdateAttachments ¶ added in v1.11.0
UpdateAttachments update attachments by UUIDs for the issue
type IssueAssignees ¶ added in v1.5.0
type IssueAssignees struct { ID int64 `xorm:"pk autoincr"` AssigneeID int64 `xorm:"INDEX"` IssueID int64 `xorm:"INDEX"` }
IssueAssignees saves all issue assignees
type IssueByLabelCount ¶ added in v1.16.0
IssueByLabelCount contains the number of issue group by label
type IssueByRepositoryCount ¶ added in v1.16.0
IssueByRepositoryCount contains the number of issue group by repository
type IssueDependency ¶ added in v1.6.0
type IssueDependency struct { ID int64 `xorm:"pk autoincr"` UserID int64 `xorm:"NOT NULL"` IssueID int64 `xorm:"UNIQUE(issue_dependency) NOT NULL"` DependencyID int64 `xorm:"UNIQUE(issue_dependency) NOT NULL"` CreatedUnix timeutil.TimeStamp `xorm:"created"` UpdatedUnix timeutil.TimeStamp `xorm:"updated"` }
IssueDependency represents an issue dependency
type IssueIndex ¶ added in v1.15.0
type IssueIndex db.ResourceIndex
IssueIndex represents the issue index table
type IssueLabel ¶
type IssueLabel struct { ID int64 `xorm:"pk autoincr"` IssueID int64 `xorm:"UNIQUE(s)"` LabelID int64 `xorm:"UNIQUE(s)"` }
IssueLabel represents an issue-label relation.
type IssueList ¶ added in v1.1.0
type IssueList []*Issue
IssueList defines a list of issues
func (IssueList) GetApprovalCounts ¶ added in v1.12.0
func (issues IssueList) GetApprovalCounts() (map[int64][]*ReviewCount, error)
GetApprovalCounts returns a map of issue ID to slice of approval counts FIXME: only returns official counts due to double counting of non-official approvals
func (IssueList) LoadAttachments ¶ added in v1.4.0
LoadAttachments loads attachments
func (IssueList) LoadAttributes ¶ added in v1.1.0
LoadAttributes loads attributes of the issues, except for attachments and comments
func (IssueList) LoadComments ¶ added in v1.4.0
LoadComments loads comments
func (IssueList) LoadDiscussComments ¶ added in v1.8.0
LoadDiscussComments loads discuss comments
func (IssueList) LoadPullRequests ¶ added in v1.14.1
LoadPullRequests loads pull requests
func (IssueList) LoadRepositories ¶ added in v1.1.0
func (issues IssueList) LoadRepositories() ([]*repo_model.Repository, error)
LoadRepositories loads issues' all repositories
type IssueLockOptions ¶ added in v1.8.0
type IssueLockOptions struct { Doer *user_model.User Issue *Issue Reason string }
IssueLockOptions defines options for locking and/or unlocking an issue/PR
type IssueStats ¶
type IssueStats struct {
OpenCount, ClosedCount int64
YourRepositoriesCount int64
AssignCount int64
CreateCount int64
MentionCount int64
ReviewRequestedCount int64
}
IssueStats represents issue statistic information.
func GetIssueStats ¶
func GetIssueStats(opts *IssueStatsOptions) (*IssueStats, error)
GetIssueStats returns issue statistic information by given conditions.
func GetUserIssueStats ¶
func GetUserIssueStats(opts UserIssueStatsOptions) (*IssueStats, error)
GetUserIssueStats returns issue statistic information for dashboard by given conditions.
type IssueStatsOptions ¶
type IssueStatsOptions struct { RepoID int64 Labels string MilestoneID int64 AssigneeID int64 MentionedID int64 PosterID int64 ReviewRequestedID int64 IsPull util.OptionalBool IssueIDs []int64 }
IssueStatsOptions contains parameters accepted by GetIssueStats.
type IssueUser ¶
type IssueUser struct { ID int64 `xorm:"pk autoincr"` UID int64 `xorm:"INDEX"` // User ID. IssueID int64 IsRead bool IsMentioned bool }
IssueUser represents an issue-user relation.
type IssueWatch ¶ added in v1.2.0
type IssueWatch struct { ID int64 `xorm:"pk autoincr"` UserID int64 `xorm:"UNIQUE(watch) NOT NULL"` IssueID int64 `xorm:"UNIQUE(watch) NOT NULL"` IsWatching bool `xorm:"NOT NULL"` CreatedUnix timeutil.TimeStamp `xorm:"created NOT NULL"` UpdatedUnix timeutil.TimeStamp `xorm:"updated NOT NULL"` }
IssueWatch is connection request for receiving issue notification.
func GetIssueWatch ¶ added in v1.2.0
func GetIssueWatch(userID, issueID int64) (iw *IssueWatch, exists bool, err error)
GetIssueWatch returns all IssueWatch objects from db by user and issue the current Web-UI need iw object for watchers AND explicit non-watchers
type IssueWatchList ¶ added in v1.11.0
type IssueWatchList []*IssueWatch
IssueWatchList contains IssueWatch
func GetIssueWatchers ¶ added in v1.2.0
func GetIssueWatchers(issueID int64, listOptions db.ListOptions) (IssueWatchList, error)
GetIssueWatchers returns watchers/unwatchers of a given issue
type IssuesOptions ¶
type IssuesOptions struct { db.ListOptions RepoIDs []int64 // include all repos if empty AssigneeID int64 PosterID int64 MentionedID int64 ReviewRequestedID int64 MilestoneIDs []int64 ProjectID int64 ProjectBoardID int64 IsClosed util.OptionalBool IsPull util.OptionalBool LabelIDs []int64 IncludedLabelNames []string ExcludedLabelNames []string IncludeMilestones []string SortType string IssueIDs []int64 UpdatedAfterUnix int64 UpdatedBeforeUnix int64 // prioritize issues from this repo PriorityRepoID int64 IsArchived util.OptionalBool Org *Organization // issues permission scope Team *Team // issues permission scope User *user_model.User // issues permission scope }
IssuesOptions represents options of an issue.
type LFSLock ¶ added in v1.4.0
type LFSLock struct { ID int64 `xorm:"pk autoincr"` RepoID int64 `xorm:"INDEX NOT NULL"` OwnerID int64 `xorm:"INDEX NOT NULL"` Path string `xorm:"TEXT"` Created time.Time `xorm:"created"` }
LFSLock represents a git lfs lock of repository.
func CreateLFSLock ¶ added in v1.4.0
func CreateLFSLock(repo *repo_model.Repository, lock *LFSLock) (*LFSLock, error)
CreateLFSLock creates a new lock.
func DeleteLFSLockByID ¶ added in v1.4.0
func DeleteLFSLockByID(id int64, repo *repo_model.Repository, u *user_model.User, force bool) (*LFSLock, error)
DeleteLFSLockByID deletes a lock by given ID.
func GetLFSLock ¶ added in v1.4.0
func GetLFSLock(repo *repo_model.Repository, path string) (*LFSLock, error)
GetLFSLock returns release by given path.
func GetLFSLockByID ¶ added in v1.4.0
GetLFSLockByID returns release by given id.
func GetLFSLockByRepoID ¶ added in v1.4.0
GetLFSLockByRepoID returns a list of locks of repository.
func GetTreePathLock ¶ added in v1.16.0
GetTreePathLock returns LSF lock for the treePath
func (*LFSLock) BeforeInsert ¶ added in v1.4.0
func (l *LFSLock) BeforeInsert()
BeforeInsert is invoked from XORM before inserting an object of this type.
type LFSMetaObject ¶ added in v1.1.0
type LFSMetaObject struct { ID int64 `xorm:"pk autoincr"` lfs.Pointer `xorm:"extends"` RepositoryID int64 `xorm:"UNIQUE(s) INDEX NOT NULL"` Existing bool `xorm:"-"` CreatedUnix timeutil.TimeStamp `xorm:"created"` }
LFSMetaObject stores metadata for LFS tracked files.
func GetLFSMetaObjectByOid ¶ added in v1.1.0
func GetLFSMetaObjectByOid(repoID int64, oid string) (*LFSMetaObject, error)
GetLFSMetaObjectByOid selects a LFSMetaObject entry from database by its OID. It may return ErrLFSObjectNotExist or a database error. If the error is nil, the returned pointer is a valid LFSMetaObject.
func GetLFSMetaObjects ¶ added in v1.16.0
func GetLFSMetaObjects(repoID int64, page, pageSize int) ([]*LFSMetaObject, error)
GetLFSMetaObjects returns all LFSMetaObjects associated with a repository
func NewLFSMetaObject ¶ added in v1.1.0
func NewLFSMetaObject(m *LFSMetaObject) (*LFSMetaObject, error)
NewLFSMetaObject stores a given populated LFSMetaObject structure in the database if it is not already present.
type LFSTokenResponse ¶ added in v1.1.0
LFSTokenResponse defines the JSON structure in which the JWT token is stored. This structure is fetched via SSH and passed by the Git LFS client to the server endpoint for authorization.
type Label ¶
type Label struct { ID int64 `xorm:"pk autoincr"` RepoID int64 `xorm:"INDEX"` OrgID int64 `xorm:"INDEX"` Name string Description string Color string `xorm:"VARCHAR(7)"` NumIssues int NumClosedIssues int CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"` UpdatedUnix timeutil.TimeStamp `xorm:"INDEX updated"` NumOpenIssues int `xorm:"-"` NumOpenRepoIssues int64 `xorm:"-"` IsChecked bool `xorm:"-"` QueryString string `xorm:"-"` IsSelected bool `xorm:"-"` IsExcluded bool `xorm:"-"` }
Label represents a label of repository for issues.
func GetLabelByID ¶
GetLabelByID returns a label by given ID.
func GetLabelInOrgByID ¶ added in v1.12.0
GetLabelInOrgByID returns a label by ID in given organization.
func GetLabelInOrgByName ¶ added in v1.12.0
GetLabelInOrgByName returns a label by name in given organization.
func GetLabelInRepoByID ¶
GetLabelInRepoByID returns a label by ID in given repository.
func GetLabelInRepoByName ¶ added in v1.0.0
GetLabelInRepoByName returns a label by name in given repository.
func GetLabelsByIDs ¶ added in v1.12.0
GetLabelsByIDs returns a list of labels by IDs
func GetLabelsByIssueID ¶
GetLabelsByIssueID returns all labels that belong to given issue by ID.
func GetLabelsByOrgID ¶ added in v1.12.0
GetLabelsByOrgID returns all labels that belong to given organization by ID.
func GetLabelsByRepoID ¶
GetLabelsByRepoID returns all labels that belong to given repository by ID.
func GetLabelsInOrgByIDs ¶ added in v1.12.0
GetLabelsInOrgByIDs returns a list of labels by IDs in given organization, it silently ignores label IDs that do not belong to the organization.
func GetLabelsInRepoByIDs ¶
GetLabelsInRepoByIDs returns a list of labels by IDs in given repository, it silently ignores label IDs that do not belong to the repository.
func (*Label) BelongsToOrg ¶ added in v1.12.0
BelongsToOrg returns true if label is an organization label
func (*Label) BelongsToRepo ¶ added in v1.12.0
BelongsToRepo returns true if label is a repository label
func (*Label) CalOpenIssues ¶
func (label *Label) CalOpenIssues()
CalOpenIssues sets the number of open issues of a label based on the already stored number of closed issues.
func (*Label) CalOpenOrgIssues ¶ added in v1.12.0
CalOpenOrgIssues calculates the open issues of a label for a specific repo
func (*Label) ForegroundColor ¶
ForegroundColor calculates the text color for labels based on their background color.
func (*Label) LoadSelectedLabelsAfterClick ¶ added in v1.8.0
LoadSelectedLabelsAfterClick calculates the set of selected labels when a label is clicked
type ListAccessTokensOptions ¶ added in v1.13.0
type ListAccessTokensOptions struct { db.ListOptions Name string UserID int64 }
ListAccessTokensOptions contain filter options
type Milestone ¶
type Milestone struct { ID int64 `xorm:"pk autoincr"` RepoID int64 `xorm:"INDEX"` Repo *repo_model.Repository `xorm:"-"` Name string Content string `xorm:"TEXT"` RenderedContent string `xorm:"-"` IsClosed bool NumIssues int NumClosedIssues int NumOpenIssues int `xorm:"-"` Completeness int // Percentage(1-100). IsOverdue bool `xorm:"-"` CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"` UpdatedUnix timeutil.TimeStamp `xorm:"INDEX updated"` DeadlineUnix timeutil.TimeStamp ClosedDateUnix timeutil.TimeStamp DeadlineString string `xorm:"-"` TotalTrackedTime int64 `xorm:"-"` TimeSinceUpdate int64 `xorm:"-"` }
Milestone represents a milestone of repository.
func GetMilestoneByRepoID ¶
GetMilestoneByRepoID returns the milestone in a repository.
func GetMilestoneByRepoIDANDName ¶ added in v1.12.0
GetMilestoneByRepoIDANDName return a milestone if one exist by name and repo
func (*Milestone) AfterLoad ¶ added in v1.3.0
func (m *Milestone) AfterLoad()
AfterLoad is invoked from XORM after setting the value of a field of this object.
func (*Milestone) BeforeUpdate ¶
func (m *Milestone) BeforeUpdate()
BeforeUpdate is invoked from XORM before updating this object.
func (*Milestone) LoadTotalTrackedTime ¶ added in v1.11.0
LoadTotalTrackedTime loads the tracked time for the milestone
type MilestoneList ¶ added in v1.5.0
type MilestoneList []*Milestone
MilestoneList is a list of milestones offering additional functionality
func GetMilestones ¶
func GetMilestones(opts GetMilestonesOption) (MilestoneList, int64, error)
GetMilestones returns milestones filtered by GetMilestonesOption's
func GetMilestonesByRepoIDs ¶ added in v1.11.0
func GetMilestonesByRepoIDs(repoIDs []int64, page int, isClosed bool, sortType string) (MilestoneList, error)
GetMilestonesByRepoIDs returns a list of milestones of given repositories and status.
func SearchMilestones ¶ added in v1.11.4
func SearchMilestones(repoCond builder.Cond, page int, isClosed bool, sortType, keyword string) (MilestoneList, error)
SearchMilestones search milestones
func (MilestoneList) LoadTotalTrackedTimes ¶ added in v1.5.0
func (milestones MilestoneList) LoadTotalTrackedTimes() error
LoadTotalTrackedTimes loads for every milestone in the list the TotalTrackedTime by a batch request
type MilestonesStats ¶ added in v1.11.0
type MilestonesStats struct {
OpenCount, ClosedCount int64
}
MilestonesStats represents milestone statistic information.
func GetMilestonesStatsByRepoCond ¶ added in v1.12.0
func GetMilestonesStatsByRepoCond(repoCond builder.Cond) (*MilestonesStats, error)
GetMilestonesStatsByRepoCond returns milestone statistic information for dashboard by given conditions.
func GetMilestonesStatsByRepoCondAndKw ¶ added in v1.15.0
func GetMilestonesStatsByRepoCondAndKw(repoCond builder.Cond, keyword string) (*MilestonesStats, error)
GetMilestonesStatsByRepoCondAndKw returns milestone statistic information for dashboard by given repo conditions and name keyword.
func (MilestonesStats) Total ¶ added in v1.11.4
func (m MilestonesStats) Total() int64
Total returns the total counts of milestones
type MinimalOrg ¶ added in v1.15.0
type MinimalOrg = Organization
MinimalOrg represents a simple orgnization with only needed columns
func GetUserOrgsList ¶ added in v1.15.0
func GetUserOrgsList(user *user_model.User) ([]*MinimalOrg, error)
GetUserOrgsList returns one user's all orgs list
type NewCommitStatusOptions ¶ added in v1.2.0
type NewCommitStatusOptions struct { Repo *repo_model.Repository Creator *user_model.User SHA string CommitStatus *CommitStatus }
NewCommitStatusOptions holds options for creating a CommitStatus
type NewIssueOptions ¶
type NewIssueOptions struct { Repo *repo_model.Repository Issue *Issue LabelIDs []int64 Attachments []string // In UUID format. IsPull bool }
NewIssueOptions represents the options of a new issue.
type Notification ¶ added in v1.1.0
type Notification struct { ID int64 `xorm:"pk autoincr"` UserID int64 `xorm:"INDEX NOT NULL"` RepoID int64 `xorm:"INDEX NOT NULL"` Status NotificationStatus `xorm:"SMALLINT INDEX NOT NULL"` Source NotificationSource `xorm:"SMALLINT INDEX NOT NULL"` IssueID int64 `xorm:"INDEX NOT NULL"` CommitID string `xorm:"INDEX"` CommentID int64 UpdatedBy int64 `xorm:"INDEX NOT NULL"` Issue *Issue `xorm:"-"` Repository *repo_model.Repository `xorm:"-"` Comment *Comment `xorm:"-"` User *user_model.User `xorm:"-"` CreatedUnix timeutil.TimeStamp `xorm:"created INDEX NOT NULL"` UpdatedUnix timeutil.TimeStamp `xorm:"updated INDEX NOT NULL"` }
Notification represents a notification
func GetNotificationByID ¶ added in v1.12.0
func GetNotificationByID(notificationID int64) (*Notification, error)
GetNotificationByID return notification by ID
func SetNotificationStatus ¶ added in v1.1.0
func SetNotificationStatus(notificationID int64, user *user_model.User, status NotificationStatus) (*Notification, error)
SetNotificationStatus change the notification status
func (*Notification) APIURL ¶ added in v1.12.0
func (n *Notification) APIURL() string
APIURL formats a URL-string to the notification
func (*Notification) GetIssue ¶ added in v1.1.0
func (n *Notification) GetIssue() (*Issue, error)
GetIssue returns the issue of the notification
func (*Notification) GetRepo ¶ added in v1.1.0
func (n *Notification) GetRepo() (*repo_model.Repository, error)
GetRepo returns the repo of the notification
func (*Notification) HTMLURL ¶ added in v1.11.0
func (n *Notification) HTMLURL() string
HTMLURL formats a URL-string to the notification
func (*Notification) LoadAttributes ¶ added in v1.12.0
func (n *Notification) LoadAttributes() (err error)
LoadAttributes load Repo Issue User and Comment if not loaded
type NotificationList ¶ added in v1.11.0
type NotificationList []*Notification
NotificationList contains a list of notifications
func GetNotifications ¶ added in v1.12.0
func GetNotifications(opts *FindNotificationOptions) (NotificationList, error)
GetNotifications returns all notifications that fit to the given options.
func NotificationsForUser ¶ added in v1.1.0
func NotificationsForUser(user *user_model.User, statuses []NotificationStatus, page, perPage int) (NotificationList, error)
NotificationsForUser returns notifications for a given user and status
func (NotificationList) LoadAttributes ¶ added in v1.12.0
func (nl NotificationList) LoadAttributes() (err error)
LoadAttributes load Repo Issue User and Comment if not loaded
func (NotificationList) LoadComments ¶ added in v1.11.0
func (nl NotificationList) LoadComments() ([]int, error)
LoadComments loads comments from database
func (NotificationList) LoadIssues ¶ added in v1.11.0
func (nl NotificationList) LoadIssues() ([]int, error)
LoadIssues loads issues from database
func (NotificationList) LoadRepos ¶ added in v1.11.0
func (nl NotificationList) LoadRepos() (RepositoryList, []int, error)
LoadRepos loads repositories from database
func (NotificationList) Without ¶ added in v1.11.4
func (nl NotificationList) Without(failures []int) NotificationList
Without returns the notification list without the failures
type NotificationSource ¶ added in v1.1.0
type NotificationSource uint8
NotificationSource is the source of the notification (issue, PR, commit, etc)
const ( // NotificationSourceIssue is a notification of an issue NotificationSourceIssue NotificationSource = iota + 1 // NotificationSourcePullRequest is a notification of a pull request NotificationSourcePullRequest // NotificationSourceCommit is a notification of a commit NotificationSourceCommit // NotificationSourceRepository is a notification for a repository NotificationSourceRepository )
type NotificationStatus ¶ added in v1.1.0
type NotificationStatus uint8
NotificationStatus is the status of the notification (read or unread)
const ( // NotificationStatusUnread represents an unread notification NotificationStatusUnread NotificationStatus = iota + 1 // NotificationStatusRead represents a read notification NotificationStatusRead // NotificationStatusPinned represents a pinned notification NotificationStatusPinned )
type OrgUser ¶
type OrgUser struct { ID int64 `xorm:"pk autoincr"` UID int64 `xorm:"INDEX UNIQUE(s)"` OrgID int64 `xorm:"INDEX UNIQUE(s)"` IsPublic bool `xorm:"INDEX"` }
OrgUser represents an organization-user relation.
func GetOrgUsersByOrgID ¶
func GetOrgUsersByOrgID(opts *FindOrgMembersOpts) ([]*OrgUser, error)
GetOrgUsersByOrgID returns all organization-user relations by organization ID.
func GetOrgUsersByUserID ¶
func GetOrgUsersByUserID(uid int64, opts *SearchOrganizationsOptions) ([]*OrgUser, error)
GetOrgUsersByUserID returns all organization-user relations by user ID.
type Organization ¶ added in v1.16.0
type Organization user_model.User
Organization represents an organization
func FindOrgs ¶ added in v1.16.0
func FindOrgs(opts FindOrgOptions) ([]*Organization, error)
FindOrgs returns a list of organizations according given conditions
func GetOrgByID ¶ added in v1.16.0
func GetOrgByID(id int64) (*Organization, error)
GetOrgByID returns the user object by given ID if exists.
func GetOrgByIDCtx ¶ added in v1.16.0
func GetOrgByIDCtx(ctx context.Context, id int64) (*Organization, error)
GetOrgByIDCtx returns the user object by given ID if exists.
func GetOrgByName ¶
func GetOrgByName(name string) (*Organization, error)
GetOrgByName returns organization by given name.
func GetOrgsCanCreateRepoByUserID ¶ added in v1.11.0
func GetOrgsCanCreateRepoByUserID(userID int64) ([]*Organization, error)
GetOrgsCanCreateRepoByUserID returns a list of organizations where given user ID are allowed to create repos.
func GetOwnedOrgsByUserID ¶
func GetOwnedOrgsByUserID(userID int64) ([]*Organization, error)
GetOwnedOrgsByUserID returns a list of organizations are owned by given user ID.
func GetOwnedOrgsByUserIDDesc ¶
func GetOwnedOrgsByUserIDDesc(userID int64, desc string) ([]*Organization, error)
GetOwnedOrgsByUserIDDesc returns a list of organizations are owned by given user ID, ordered descending by the given condition.
func OrgFromUser ¶ added in v1.16.0
func OrgFromUser(user *user_model.User) *Organization
OrgFromUser converts user to organization
func (*Organization) AccessibleReposEnv ¶ added in v1.16.0
func (org *Organization) AccessibleReposEnv(userID int64) (AccessibleReposEnvironment, error)
AccessibleReposEnv builds an AccessibleReposEnvironment for the repositories in `org` that are accessible to the specified user.
func (*Organization) AccessibleTeamReposEnv ¶ added in v1.16.0
func (org *Organization) AccessibleTeamReposEnv(team *Team) AccessibleReposEnvironment
AccessibleTeamReposEnv an AccessibleReposEnvironment for the repositories in `org` that are accessible to the specified team.
func (*Organization) AddMember ¶ added in v1.16.0
func (org *Organization) AddMember(uid int64) error
AddMember adds new member to organization.
func (*Organization) AsUser ¶ added in v1.16.0
func (org *Organization) AsUser() *user_model.User
AsUser returns the org as user object
func (*Organization) AvatarLink ¶ added in v1.16.0
func (org *Organization) AvatarLink() string
AvatarLink returns the full avatar link with http host
func (*Organization) CanCreateOrgRepo ¶ added in v1.16.0
func (org *Organization) CanCreateOrgRepo(uid int64) (bool, error)
CanCreateOrgRepo returns true if given user can create repo in organization
func (*Organization) CanCreateRepo ¶ added in v1.16.0
func (org *Organization) CanCreateRepo() bool
CanCreateRepo returns if user login can create a repository NOTE: functions calling this assume a failure due to repository count limit; if new checks are added, those functions should be revised
func (*Organization) CustomAvatarRelativePath ¶ added in v1.16.0
func (org *Organization) CustomAvatarRelativePath() string
CustomAvatarRelativePath returns user custom avatar relative path.
func (*Organization) DisplayName ¶ added in v1.16.0
func (org *Organization) DisplayName() string
DisplayName returns full name if it's not empty, returns username otherwise.
func (*Organization) GetMembers ¶ added in v1.16.0
func (org *Organization) GetMembers() (user_model.UserList, map[int64]bool, error)
GetMembers returns all members of organization.
func (*Organization) GetOrgUserMaxAuthorizeLevel ¶ added in v1.16.0
func (org *Organization) GetOrgUserMaxAuthorizeLevel(uid int64) (perm.AccessMode, error)
GetOrgUserMaxAuthorizeLevel returns highest authorize level of user in an organization
func (*Organization) GetOwnerTeam ¶ added in v1.16.0
func (org *Organization) GetOwnerTeam() (*Team, error)
GetOwnerTeam returns owner team of organization.
func (*Organization) GetTeam ¶ added in v1.16.0
func (org *Organization) GetTeam(name string) (*Team, error)
GetTeam returns named team of organization.
func (*Organization) GetUserTeamIDs ¶ added in v1.16.0
func (org *Organization) GetUserTeamIDs(userID int64) ([]int64, error)
GetUserTeamIDs returns of all team IDs of the organization that user is member of.
func (*Organization) GetUserTeams ¶ added in v1.16.0
func (org *Organization) GetUserTeams(userID int64) ([]*Team, error)
GetUserTeams returns all teams that belong to user, and that the user has joined.
func (*Organization) HTMLURL ¶ added in v1.16.0
func (org *Organization) HTMLURL() string
HTMLURL returns the organization's full link.
func (*Organization) HasMemberWithUserID ¶ added in v1.16.0
func (org *Organization) HasMemberWithUserID(userID int64) bool
HasMemberWithUserID returns true if user with userID is part of the u organisation.
func (*Organization) HomeLink ¶ added in v1.16.0
func (org *Organization) HomeLink() string
HomeLink returns the user or organization home page link.
func (*Organization) IsOrgMember ¶ added in v1.16.0
func (org *Organization) IsOrgMember(uid int64) (bool, error)
IsOrgMember returns true if given user is member of organization.
func (*Organization) IsOwnedBy ¶ added in v1.16.0
func (org *Organization) IsOwnedBy(uid int64) (bool, error)
IsOwnedBy returns true if given user is in the owner team.
func (*Organization) LoadTeams ¶ added in v1.16.0
func (org *Organization) LoadTeams() ([]*Team, error)
LoadTeams load teams if not loaded.
func (*Organization) OrganisationLink ¶ added in v1.16.0
func (org *Organization) OrganisationLink() string
OrganisationLink returns the organization sub page link.
func (*Organization) RemoveMember ¶ added in v1.16.0
func (org *Organization) RemoveMember(uid int64) error
RemoveMember removes member from organization.
func (*Organization) RemoveOrgRepo ¶ added in v1.16.0
func (org *Organization) RemoveOrgRepo(repoID int64) error
RemoveOrgRepo removes all team-repository relations of organization.
func (*Organization) ShortName ¶ added in v1.16.0
func (org *Organization) ShortName(length int) string
ShortName ellipses username to length
func (Organization) TableName ¶ added in v1.16.0
func (Organization) TableName() string
TableName represents the real table name of Organization
func (*Organization) TeamsWithAccessToRepo ¶ added in v1.16.0
func (org *Organization) TeamsWithAccessToRepo(repoID int64, mode perm.AccessMode) ([]*Team, error)
TeamsWithAccessToRepo returns all teams that have given access level to the repository.
type Permission ¶ added in v1.7.0
type Permission struct { AccessMode perm_model.AccessMode Units []*repo_model.RepoUnit UnitsMode map[unit.Type]perm_model.AccessMode }
Permission contains all the permissions related variables to a repository for a user
func GetUserRepoPermission ¶ added in v1.7.0
func GetUserRepoPermission(repo *repo_model.Repository, user *user_model.User) (Permission, error)
GetUserRepoPermission returns the user permissions to the repository
func (*Permission) CanAccess ¶ added in v1.7.0
func (p *Permission) CanAccess(mode perm_model.AccessMode, unitType unit.Type) bool
CanAccess returns true if user has mode access to the unit of the repository
func (*Permission) CanAccessAny ¶ added in v1.7.0
func (p *Permission) CanAccessAny(mode perm_model.AccessMode, unitTypes ...unit.Type) bool
CanAccessAny returns true if user has mode access to any of the units of the repository
func (*Permission) CanRead ¶ added in v1.7.0
func (p *Permission) CanRead(unitType unit.Type) bool
CanRead returns true if user could read to this unit
func (*Permission) CanReadAny ¶ added in v1.7.0
func (p *Permission) CanReadAny(unitTypes ...unit.Type) bool
CanReadAny returns true if user has read access to any of the units of the repository
func (*Permission) CanReadIssuesOrPulls ¶ added in v1.7.0
func (p *Permission) CanReadIssuesOrPulls(isPull bool) bool
CanReadIssuesOrPulls returns true if isPull is true and user could read pull requests and returns true if isPull is false and user could read to issues
func (*Permission) CanWrite ¶ added in v1.7.0
func (p *Permission) CanWrite(unitType unit.Type) bool
CanWrite returns true if user could write to this unit
func (*Permission) CanWriteIssuesOrPulls ¶ added in v1.7.0
func (p *Permission) CanWriteIssuesOrPulls(isPull bool) bool
CanWriteIssuesOrPulls returns true if isPull is true and user could write to pull requests and returns true if isPull is false and user could write to issues
func (*Permission) ColorFormat ¶ added in v1.9.0
func (p *Permission) ColorFormat(s fmt.State)
ColorFormat writes a colored string for these Permissions
func (*Permission) HasAccess ¶ added in v1.7.0
func (p *Permission) HasAccess() bool
HasAccess returns true if the current user has at least read access to any unit of this repository
func (*Permission) IsAdmin ¶ added in v1.7.0
func (p *Permission) IsAdmin() bool
IsAdmin returns true if current user has admin or higher access of repository.
func (*Permission) IsOwner ¶ added in v1.7.0
func (p *Permission) IsOwner() bool
IsOwner returns true if current user is the owner of repository.
func (*Permission) UnitAccessMode ¶ added in v1.7.0
func (p *Permission) UnitAccessMode(unitType unit.Type) perm_model.AccessMode
UnitAccessMode returns current user accessmode to the specify unit of the repository
type Project ¶ added in v1.13.0
type Project struct { ID int64 `xorm:"pk autoincr"` Title string `xorm:"INDEX NOT NULL"` Description string `xorm:"TEXT"` RepoID int64 `xorm:"INDEX"` CreatorID int64 `xorm:"NOT NULL"` IsClosed bool `xorm:"INDEX"` BoardType ProjectBoardType Type ProjectType RenderedContent string `xorm:"-"` CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"` UpdatedUnix timeutil.TimeStamp `xorm:"INDEX updated"` ClosedDateUnix timeutil.TimeStamp }
Project represents a project board
func GetProjectByID ¶ added in v1.13.0
GetProjectByID returns the projects in a repository
func GetProjects ¶ added in v1.13.0
func GetProjects(opts ProjectSearchOptions) ([]*Project, int64, error)
GetProjects returns a list of all projects that have been created in the repository
func (*Project) NumClosedIssues ¶ added in v1.13.0
NumClosedIssues return counter of closed issues assigned to a project
func (*Project) NumIssues ¶ added in v1.13.0
NumIssues return counter of all issues assigned to a project
func (*Project) NumOpenIssues ¶ added in v1.13.0
NumOpenIssues return counter of open issues assigned to a project
type ProjectBoard ¶ added in v1.13.0
type ProjectBoard struct { ID int64 `xorm:"pk autoincr"` Title string Default bool `xorm:"NOT NULL DEFAULT false"` // issues not assigned to a specific board will be assigned to this board Sorting int8 `xorm:"NOT NULL DEFAULT 0"` Color string `xorm:"VARCHAR(7)"` ProjectID int64 `xorm:"INDEX NOT NULL"` CreatorID int64 `xorm:"NOT NULL"` CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"` UpdatedUnix timeutil.TimeStamp `xorm:"INDEX updated"` Issues []*Issue `xorm:"-"` }
ProjectBoard is used to represent boards on a project
func GetProjectBoard ¶ added in v1.13.0
func GetProjectBoard(boardID int64) (*ProjectBoard, error)
GetProjectBoard fetches the current board of a project
func (*ProjectBoard) LoadIssues ¶ added in v1.13.0
func (b *ProjectBoard) LoadIssues() (IssueList, error)
LoadIssues load issues assigned to this board
type ProjectBoardList ¶ added in v1.13.0
type ProjectBoardList []*ProjectBoard
ProjectBoardList is a list of all project boards in a repository
func GetProjectBoards ¶ added in v1.13.0
func GetProjectBoards(projectID int64) (ProjectBoardList, error)
GetProjectBoards fetches all boards related to a project if no default board set, first board is a temporary "Uncategorized" board
func (ProjectBoardList) LoadIssues ¶ added in v1.13.0
func (bs ProjectBoardList) LoadIssues() (IssueList, error)
LoadIssues load issues assigned to the boards
type ProjectBoardType ¶ added in v1.13.0
type ProjectBoardType uint8
ProjectBoardType is used to represent a project board type
const ( // ProjectBoardTypeNone is a project board type that has no predefined columns ProjectBoardTypeNone ProjectBoardType = iota // ProjectBoardTypeBasicKanban is a project board type that has basic predefined columns ProjectBoardTypeBasicKanban // ProjectBoardTypeBugTriage is a project board type that has predefined columns suited to hunting down bugs ProjectBoardTypeBugTriage )
type ProjectIssue ¶ added in v1.13.0
type ProjectIssue struct { ID int64 `xorm:"pk autoincr"` IssueID int64 `xorm:"INDEX"` ProjectID int64 `xorm:"INDEX"` // If 0, then it has not been added to a specific board in the project ProjectBoardID int64 `xorm:"INDEX"` Sorting int64 `xorm:"NOT NULL DEFAULT 0"` }
ProjectIssue saves relation from issue to a project
type ProjectSearchOptions ¶ added in v1.13.0
type ProjectSearchOptions struct { RepoID int64 Page int IsClosed util.OptionalBool SortType string Type ProjectType }
ProjectSearchOptions are options for GetProjects
type ProjectType ¶ added in v1.13.0
type ProjectType uint8
ProjectType is used to identify the type of project in question and ownership
const ( // ProjectTypeIndividual is a type of project board that is owned by an individual ProjectTypeIndividual ProjectType = iota + 1 // ProjectTypeRepository is a project that is tied to a repository ProjectTypeRepository // ProjectTypeOrganization is a project that is tied to an organisation ProjectTypeOrganization )
type ProjectsConfig ¶ added in v1.13.0
type ProjectsConfig struct { BoardType ProjectBoardType Translation string }
ProjectsConfig is used to identify the type of board that is being created
func GetProjectsConfig ¶ added in v1.13.0
func GetProjectsConfig() []ProjectsConfig
GetProjectsConfig retrieves the types of configurations projects could have
type ProtectedBranch ¶ added in v1.1.0
type ProtectedBranch struct { ID int64 `xorm:"pk autoincr"` RepoID int64 `xorm:"UNIQUE(s)"` BranchName string `xorm:"UNIQUE(s)"` CanPush bool `xorm:"NOT NULL DEFAULT false"` EnableWhitelist bool WhitelistUserIDs []int64 `xorm:"JSON TEXT"` WhitelistTeamIDs []int64 `xorm:"JSON TEXT"` EnableMergeWhitelist bool `xorm:"NOT NULL DEFAULT false"` WhitelistDeployKeys bool `xorm:"NOT NULL DEFAULT false"` MergeWhitelistUserIDs []int64 `xorm:"JSON TEXT"` MergeWhitelistTeamIDs []int64 `xorm:"JSON TEXT"` EnableStatusCheck bool `xorm:"NOT NULL DEFAULT false"` StatusCheckContexts []string `xorm:"JSON TEXT"` EnableApprovalsWhitelist bool `xorm:"NOT NULL DEFAULT false"` ApprovalsWhitelistUserIDs []int64 `xorm:"JSON TEXT"` ApprovalsWhitelistTeamIDs []int64 `xorm:"JSON TEXT"` RequiredApprovals int64 `xorm:"NOT NULL DEFAULT 0"` BlockOnRejectedReviews bool `xorm:"NOT NULL DEFAULT false"` BlockOnOfficialReviewRequests bool `xorm:"NOT NULL DEFAULT false"` BlockOnOutdatedBranch bool `xorm:"NOT NULL DEFAULT false"` DismissStaleApprovals bool `xorm:"NOT NULL DEFAULT false"` RequireSignedCommits bool `xorm:"NOT NULL DEFAULT false"` ProtectedFilePatterns string `xorm:"TEXT"` UnprotectedFilePatterns string `xorm:"TEXT"` CreatedUnix timeutil.TimeStamp `xorm:"created"` UpdatedUnix timeutil.TimeStamp `xorm:"updated"` }
ProtectedBranch struct
func GetProtectedBranchBy ¶ added in v1.1.0
func GetProtectedBranchBy(repoID int64, branchName string) (*ProtectedBranch, error)
GetProtectedBranchBy getting protected branch by ID/Name
func GetProtectedBranches ¶ added in v1.16.0
func GetProtectedBranches(repoID int64) ([]*ProtectedBranch, error)
GetProtectedBranches get all protected branches
func (*ProtectedBranch) CanUserPush ¶ added in v1.3.0
func (protectBranch *ProtectedBranch) CanUserPush(userID int64) bool
CanUserPush returns if some user could push to this protected branch
func (*ProtectedBranch) GetGrantedApprovalsCount ¶ added in v1.7.0
func (protectBranch *ProtectedBranch) GetGrantedApprovalsCount(pr *PullRequest) int64
GetGrantedApprovalsCount returns the number of granted approvals for pr. A granted approval must be authored by a user in an approval whitelist.
func (*ProtectedBranch) GetProtectedFilePatterns ¶ added in v1.12.0
func (protectBranch *ProtectedBranch) GetProtectedFilePatterns() []glob.Glob
GetProtectedFilePatterns parses a semicolon separated list of protected file patterns and returns a glob.Glob slice
func (*ProtectedBranch) GetUnprotectedFilePatterns ¶ added in v1.16.0
func (protectBranch *ProtectedBranch) GetUnprotectedFilePatterns() []glob.Glob
GetUnprotectedFilePatterns parses a semicolon separated list of unprotected file patterns and returns a glob.Glob slice
func (*ProtectedBranch) HasEnoughApprovals ¶ added in v1.7.0
func (protectBranch *ProtectedBranch) HasEnoughApprovals(pr *PullRequest) bool
HasEnoughApprovals returns true if pr has enough granted approvals.
func (*ProtectedBranch) IsProtected ¶ added in v1.2.0
func (protectBranch *ProtectedBranch) IsProtected() bool
IsProtected returns if the branch is protected
func (*ProtectedBranch) IsProtectedFile ¶ added in v1.13.0
func (protectBranch *ProtectedBranch) IsProtectedFile(patterns []glob.Glob, path string) bool
IsProtectedFile return if path is protected
func (*ProtectedBranch) IsUnprotectedFile ¶ added in v1.16.0
func (protectBranch *ProtectedBranch) IsUnprotectedFile(patterns []glob.Glob, path string) bool
IsUnprotectedFile return if path is unprotected
func (*ProtectedBranch) MergeBlockedByOfficialReviewRequests ¶ added in v1.14.0
func (protectBranch *ProtectedBranch) MergeBlockedByOfficialReviewRequests(pr *PullRequest) bool
MergeBlockedByOfficialReviewRequests block merge because of some review request to official reviewer of from official review
func (*ProtectedBranch) MergeBlockedByOutdatedBranch ¶ added in v1.12.0
func (protectBranch *ProtectedBranch) MergeBlockedByOutdatedBranch(pr *PullRequest) bool
MergeBlockedByOutdatedBranch returns true if merge is blocked by an outdated head branch
func (*ProtectedBranch) MergeBlockedByProtectedFiles ¶ added in v1.13.0
func (protectBranch *ProtectedBranch) MergeBlockedByProtectedFiles(pr *PullRequest) bool
MergeBlockedByProtectedFiles returns true if merge is blocked by protected files change
func (*ProtectedBranch) MergeBlockedByRejectedReview ¶ added in v1.11.0
func (protectBranch *ProtectedBranch) MergeBlockedByRejectedReview(pr *PullRequest) bool
MergeBlockedByRejectedReview returns true if merge is blocked by rejected reviews
type ProtectedTag ¶ added in v1.15.0
type ProtectedTag struct { ID int64 `xorm:"pk autoincr"` RepoID int64 NamePattern string RegexPattern *regexp.Regexp `xorm:"-"` GlobPattern glob.Glob `xorm:"-"` AllowlistUserIDs []int64 `xorm:"JSON TEXT"` AllowlistTeamIDs []int64 `xorm:"JSON TEXT"` CreatedUnix timeutil.TimeStamp `xorm:"created"` UpdatedUnix timeutil.TimeStamp `xorm:"updated"` }
ProtectedTag struct
func GetProtectedTagByID ¶ added in v1.15.0
func GetProtectedTagByID(id int64) (*ProtectedTag, error)
GetProtectedTagByID gets the protected tag with the specific id
func GetProtectedTags ¶ added in v1.16.0
func GetProtectedTags(repoID int64) ([]*ProtectedTag, error)
GetProtectedTags gets all protected tags of the repository
func (*ProtectedTag) EnsureCompiledPattern ¶ added in v1.15.0
func (pt *ProtectedTag) EnsureCompiledPattern() error
EnsureCompiledPattern ensures the glob pattern is compiled
type PullRequest ¶
type PullRequest struct { ID int64 `xorm:"pk autoincr"` Type PullRequestType Status PullRequestStatus ConflictedFiles []string `xorm:"TEXT JSON"` CommitsAhead int CommitsBehind int ChangedProtectedFiles []string `xorm:"TEXT JSON"` IssueID int64 `xorm:"INDEX"` Issue *Issue `xorm:"-"` Index int64 HeadRepoID int64 `xorm:"INDEX"` HeadRepo *repo_model.Repository `xorm:"-"` BaseRepoID int64 `xorm:"INDEX"` BaseRepo *repo_model.Repository `xorm:"-"` HeadBranch string HeadCommitID string `xorm:"-"` BaseBranch string ProtectedBranch *ProtectedBranch `xorm:"-"` MergeBase string `xorm:"VARCHAR(40)"` HasMerged bool `xorm:"INDEX"` MergedCommitID string `xorm:"VARCHAR(40)"` MergerID int64 `xorm:"INDEX"` Merger *user_model.User `xorm:"-"` MergedUnix timeutil.TimeStamp `xorm:"updated INDEX"` Flow PullRequestFlow `xorm:"NOT NULL DEFAULT 0"` // contains filtered or unexported fields }
PullRequest represents relation between pull request and repositories.
func GetAllUnmergedAgitPullRequestByPoster ¶ added in v1.16.0
func GetAllUnmergedAgitPullRequestByPoster(uid int64) ([]*PullRequest, error)
GetAllUnmergedAgitPullRequestByPoster get all unmerged agit flow pull request By poster id.
func GetLatestPullRequestByHeadInfo ¶ added in v1.9.0
func GetLatestPullRequestByHeadInfo(repoID int64, branch string) (*PullRequest, error)
GetLatestPullRequestByHeadInfo returns the latest pull request (regardless of its status) by given head information (repo and branch).
func GetPullRequestByID ¶
func GetPullRequestByID(id int64) (*PullRequest, error)
GetPullRequestByID returns a pull request by given ID.
func GetPullRequestByIndex ¶ added in v1.0.0
func GetPullRequestByIndex(repoID, index int64) (*PullRequest, error)
GetPullRequestByIndex returns a pull request by the given index
func GetPullRequestByIssueID ¶
func GetPullRequestByIssueID(issueID int64) (*PullRequest, error)
GetPullRequestByIssueID returns pull request by given issue ID.
func GetPullRequestByIssueIDWithNoAttributes ¶ added in v1.12.0
func GetPullRequestByIssueIDWithNoAttributes(issueID int64) (*PullRequest, error)
GetPullRequestByIssueIDWithNoAttributes returns pull request with no attributes loaded by given issue ID.
func GetUnmergedPullRequest ¶
func GetUnmergedPullRequest(headRepoID, baseRepoID int64, headBranch, baseBranch string, flow PullRequestFlow) (*PullRequest, error)
GetUnmergedPullRequest returns a pull request that is open and has not been merged by given head/base and repo/branch.
func GetUnmergedPullRequestsByBaseInfo ¶
func GetUnmergedPullRequestsByBaseInfo(repoID int64, branch string) ([]*PullRequest, error)
GetUnmergedPullRequestsByBaseInfo returns all pull requests that are open and has not been merged by given base information (repo and branch).
func GetUnmergedPullRequestsByHeadInfo ¶
func GetUnmergedPullRequestsByHeadInfo(repoID int64, branch string) ([]*PullRequest, error)
GetUnmergedPullRequestsByHeadInfo returns all pull requests that are open and has not been merged by given head information (repo and branch).
func PullRequests ¶ added in v1.0.0
func PullRequests(baseRepoID int64, opts *PullRequestsOptions) ([]*PullRequest, int64, error)
PullRequests returns all pull requests for a base Repo by the given conditions
func (*PullRequest) CanAutoMerge ¶
func (pr *PullRequest) CanAutoMerge() bool
CanAutoMerge returns true if this pull request can be merged automatically.
func (*PullRequest) GetApprovalCounts ¶ added in v1.12.0
func (pr *PullRequest) GetApprovalCounts() ([]*ReviewCount, error)
GetApprovalCounts returns the approval counts by type FIXME: Only returns official counts due to double counting of non-official counts
func (*PullRequest) GetApprovers ¶ added in v1.11.0
func (pr *PullRequest) GetApprovers() string
GetApprovers returns the approvers of the pull request
func (*PullRequest) GetBaseBranchHTMLURL ¶ added in v1.14.0
func (pr *PullRequest) GetBaseBranchHTMLURL() string
GetBaseBranchHTMLURL returns the HTML URL of the base branch
func (*PullRequest) GetDefaultMergeMessage ¶ added in v1.4.0
func (pr *PullRequest) GetDefaultMergeMessage() string
GetDefaultMergeMessage returns default message used when merging pull request
func (*PullRequest) GetDefaultSquashMessage ¶ added in v1.4.0
func (pr *PullRequest) GetDefaultSquashMessage() string
GetDefaultSquashMessage returns default message used when squash and merging pull request
func (*PullRequest) GetGitRefName ¶ added in v1.4.0
func (pr *PullRequest) GetGitRefName() string
GetGitRefName returns git ref for hidden pull request branch
func (*PullRequest) GetHeadBranchHTMLURL ¶ added in v1.14.0
func (pr *PullRequest) GetHeadBranchHTMLURL() string
GetHeadBranchHTMLURL returns the HTML URL of the head branch
func (*PullRequest) GetWorkInProgressPrefix ¶ added in v1.6.0
func (pr *PullRequest) GetWorkInProgressPrefix() string
GetWorkInProgressPrefix returns the prefix used to mark the pull request as a work in progress. It returns an empty string when none were found
func (*PullRequest) IsChecking ¶
func (pr *PullRequest) IsChecking() bool
IsChecking returns true if this pull request is still checking conflict.
func (*PullRequest) IsEmpty ¶ added in v1.14.0
func (pr *PullRequest) IsEmpty() bool
IsEmpty returns true if this pull request is empty.
func (*PullRequest) IsFilesConflicted ¶ added in v1.8.0
func (pr *PullRequest) IsFilesConflicted() bool
IsFilesConflicted determines if the Pull Request has changes conflicting with the target branch.
func (*PullRequest) IsSameRepo ¶ added in v1.12.0
func (pr *PullRequest) IsSameRepo() bool
IsSameRepo returns true if base repo and head repo is the same
func (*PullRequest) IsWorkInProgress ¶ added in v1.6.0
func (pr *PullRequest) IsWorkInProgress() bool
IsWorkInProgress determine if the Pull Request is a Work In Progress by its title
func (*PullRequest) LoadAttributes ¶
func (pr *PullRequest) LoadAttributes() error
LoadAttributes loads pull request attributes from database
func (*PullRequest) LoadBaseRepo ¶ added in v1.10.0
func (pr *PullRequest) LoadBaseRepo() error
LoadBaseRepo loads the target repository
func (*PullRequest) LoadHeadRepo ¶ added in v1.10.0
func (pr *PullRequest) LoadHeadRepo() error
LoadHeadRepo loads the head repository
func (*PullRequest) LoadIssue ¶
func (pr *PullRequest) LoadIssue() (err error)
LoadIssue loads issue information from database
func (*PullRequest) LoadProtectedBranch ¶ added in v1.7.0
func (pr *PullRequest) LoadProtectedBranch() (err error)
LoadProtectedBranch loads the protected branch of the base branch
func (*PullRequest) MustHeadUserName ¶ added in v1.10.0
func (pr *PullRequest) MustHeadUserName() string
MustHeadUserName returns the HeadRepo's username if failed return blank
func (*PullRequest) ResolveCrossReferences ¶ added in v1.11.0
func (pr *PullRequest) ResolveCrossReferences() ([]*Comment, error)
ResolveCrossReferences will return the list of references to close/reopen by this PR
func (*PullRequest) SetMerged ¶ added in v1.9.0
func (pr *PullRequest) SetMerged() (bool, error)
SetMerged sets a pull request to merged and closes the corresponding issue
func (*PullRequest) Update ¶
func (pr *PullRequest) Update() error
Update updates all fields of pull request.
func (*PullRequest) UpdateCols ¶
func (pr *PullRequest) UpdateCols(cols ...string) error
UpdateCols updates specific fields of pull request.
func (*PullRequest) UpdateColsIfNotMerged ¶ added in v1.11.1
func (pr *PullRequest) UpdateColsIfNotMerged(cols ...string) error
UpdateColsIfNotMerged updates specific fields of a pull request if it has not been merged
func (*PullRequest) UpdateCommitDivergence ¶ added in v1.12.0
func (pr *PullRequest) UpdateCommitDivergence(ahead, behind int) error
UpdateCommitDivergence update Divergence of a pull request
type PullRequestFlow ¶ added in v1.16.0
type PullRequestFlow int
PullRequestFlow the flow of pull request
const ( // PullRequestFlowGithub github flow from head branch to base branch PullRequestFlowGithub PullRequestFlow = iota // PullRequestFlowAGit Agit flow pull request, head branch is not exist PullRequestFlowAGit )
type PullRequestList ¶
type PullRequestList []*PullRequest
PullRequestList defines a list of pull requests
func (PullRequestList) InvalidateCodeComments ¶ added in v1.6.0
func (prs PullRequestList) InvalidateCodeComments(doer *user_model.User, repo *git.Repository, branch string) error
InvalidateCodeComments will lookup the prs for code comments which got invalidated by change
func (PullRequestList) LoadAttributes ¶
func (prs PullRequestList) LoadAttributes() error
LoadAttributes load all the prs attributes
type PullRequestStatus ¶
type PullRequestStatus int
PullRequestStatus defines pull request status
const ( PullRequestStatusConflict PullRequestStatus = iota PullRequestStatusChecking PullRequestStatusMergeable PullRequestStatusManuallyMerged PullRequestStatusError PullRequestStatusEmpty )
Enumerate all the pull request status
type PullRequestType ¶
type PullRequestType int
PullRequestType defines pull request type
const ( PullRequestGitea PullRequestType = iota PullRequestGit )
Enumerate all the pull request types
type PullRequestsOptions ¶ added in v1.0.0
type PullRequestsOptions struct { db.ListOptions State string SortType string Labels []string MilestoneID int64 }
PullRequestsOptions holds the options for PRs
type PushActionContent ¶ added in v1.13.0
type PushActionContent struct { IsForcePush bool `json:"is_force_push"` CommitIDs []string `json:"commit_ids"` }
PushActionContent is content of push pull comment
type Reaction ¶ added in v1.4.0
type Reaction struct { ID int64 `xorm:"pk autoincr"` Type string `xorm:"INDEX UNIQUE(s) NOT NULL"` IssueID int64 `xorm:"INDEX UNIQUE(s) NOT NULL"` CommentID int64 `xorm:"INDEX UNIQUE(s)"` UserID int64 `xorm:"INDEX UNIQUE(s) NOT NULL"` OriginalAuthorID int64 `xorm:"INDEX UNIQUE(s) NOT NULL DEFAULT(0)"` OriginalAuthor string `xorm:"INDEX UNIQUE(s)"` User *user_model.User `xorm:"-"` CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"` }
Reaction represents a reactions on issues and comments.
func CreateCommentReaction ¶ added in v1.4.0
func CreateCommentReaction(doer *user_model.User, issue *Issue, comment *Comment, content string) (*Reaction, error)
CreateCommentReaction creates a reaction on comment.
func CreateIssueReaction ¶ added in v1.4.0
CreateIssueReaction creates a reaction on issue.
func CreateReaction ¶ added in v1.4.0
func CreateReaction(opts *ReactionOptions) (*Reaction, error)
CreateReaction creates reaction for issue or comment.
type ReactionList ¶ added in v1.4.0
type ReactionList []*Reaction
ReactionList represents list of reactions
func FindCommentReactions ¶ added in v1.11.0
func FindCommentReactions(comment *Comment) (ReactionList, int64, error)
FindCommentReactions returns a ReactionList of all reactions from an comment
func FindIssueReactions ¶ added in v1.11.0
func FindIssueReactions(issue *Issue, listOptions db.ListOptions) (ReactionList, int64, error)
FindIssueReactions returns a ReactionList of all reactions from an issue
func (ReactionList) GetFirstUsers ¶ added in v1.4.0
func (list ReactionList) GetFirstUsers() string
GetFirstUsers returns first reacted user display names separated by comma
func (ReactionList) GetMoreUserCount ¶ added in v1.4.0
func (list ReactionList) GetMoreUserCount() int
GetMoreUserCount returns count of not shown users in reaction tooltip
func (ReactionList) GroupByType ¶ added in v1.4.0
func (list ReactionList) GroupByType() map[string]ReactionList
GroupByType returns reactions grouped by type
func (ReactionList) HasUser ¶ added in v1.4.0
func (list ReactionList) HasUser(userID int64) bool
HasUser check if user has reacted
func (ReactionList) LoadUsers ¶ added in v1.4.0
func (list ReactionList) LoadUsers(repo *repo_model.Repository) ([]*user_model.User, error)
LoadUsers loads reactions' all users
type ReactionOptions ¶ added in v1.4.0
type ReactionOptions struct { Type string Doer *user_model.User Issue *Issue Comment *Comment }
ReactionOptions defines options for creating or deleting reactions
type Release ¶
type Release struct { ID int64 `xorm:"pk autoincr"` RepoID int64 `xorm:"INDEX UNIQUE(n)"` Repo *repo_model.Repository `xorm:"-"` PublisherID int64 `xorm:"INDEX"` Publisher *user_model.User `xorm:"-"` TagName string `xorm:"INDEX UNIQUE(n)"` OriginalAuthor string OriginalAuthorID int64 `xorm:"index"` LowerTagName string Target string Title string Sha1 string `xorm:"VARCHAR(40)"` NumCommits int64 NumCommitsBehind int64 `xorm:"-"` Note string `xorm:"TEXT"` RenderedNote string `xorm:"-"` IsDraft bool `xorm:"NOT NULL DEFAULT false"` IsPrerelease bool `xorm:"NOT NULL DEFAULT false"` IsTag bool `xorm:"NOT NULL DEFAULT false"` Attachments []*repo_model.Attachment `xorm:"-"` CreatedUnix timeutil.TimeStamp `xorm:"INDEX"` }
Release represents a release of repository.
func GetLatestReleaseByRepoID ¶ added in v1.12.0
GetLatestReleaseByRepoID returns the latest release for a repository
func GetRelease ¶
GetRelease returns release by given ID.
func GetReleaseByID ¶
GetReleaseByID returns release with given ID.
func GetReleasesByRepoID ¶
func GetReleasesByRepoID(repoID int64, opts FindReleasesOptions) ([]*Release, error)
GetReleasesByRepoID returns a list of releases of repository.
func GetReleasesByRepoIDAndNames ¶ added in v1.1.0
func GetReleasesByRepoIDAndNames(ctx context.Context, repoID int64, tagNames []string) (rels []*Release, err error)
GetReleasesByRepoIDAndNames returns a list of releases of repository according repoID and tagNames.
func (*Release) APIURL ¶ added in v1.1.0
APIURL the api url for a release. release must have attributes loaded
func (*Release) HTMLURL ¶ added in v1.12.0
HTMLURL the url for a release on the web UI. release must have attributes loaded
func (*Release) LoadAttributes ¶ added in v1.1.0
LoadAttributes load repo and publisher attributes for a release
type RenamedBranch ¶ added in v1.16.0
type RenamedBranch struct { ID int64 `xorm:"pk autoincr"` RepoID int64 `xorm:"INDEX NOT NULL"` From string To string CreatedUnix timeutil.TimeStamp `xorm:"created"` }
RenamedBranch provide renamed branch log will check it when a branch can't be found
func FindRenamedBranch ¶ added in v1.16.0
func FindRenamedBranch(repoID int64, from string) (branch *RenamedBranch, exist bool, err error)
FindRenamedBranch check if a branch was renamed
type RepoTransfer ¶ added in v1.14.0
type RepoTransfer struct { ID int64 `xorm:"pk autoincr"` DoerID int64 Doer *user_model.User `xorm:"-"` RecipientID int64 Recipient *user_model.User `xorm:"-"` RepoID int64 TeamIDs []int64 Teams []*Team `xorm:"-"` CreatedUnix timeutil.TimeStamp `xorm:"INDEX NOT NULL created"` UpdatedUnix timeutil.TimeStamp `xorm:"INDEX NOT NULL updated"` }
RepoTransfer is used to manage repository transfers
func GetPendingRepositoryTransfer ¶ added in v1.14.0
func GetPendingRepositoryTransfer(repo *repo_model.Repository) (*RepoTransfer, error)
GetPendingRepositoryTransfer fetches the most recent and ongoing transfer process for the repository
func (*RepoTransfer) CanUserAcceptTransfer ¶ added in v1.14.0
func (r *RepoTransfer) CanUserAcceptTransfer(u *user_model.User) bool
CanUserAcceptTransfer checks if the user has the rights to accept/decline a repo transfer. For user, it checks if it's himself For organizations, it checks if the user is able to create repos
func (*RepoTransfer) LoadAttributes ¶ added in v1.14.0
func (r *RepoTransfer) LoadAttributes() error
LoadAttributes fetches the transfer recipient from the database
type RepositoryList ¶
type RepositoryList []*repo_model.Repository
RepositoryList contains a list of repositories
func RepositoryListOfMap ¶ added in v1.2.0
func RepositoryListOfMap(repoMap map[int64]*repo_model.Repository) RepositoryList
RepositoryListOfMap make list from values of map
func SearchRepository ¶ added in v1.10.0
func SearchRepository(opts *SearchRepoOptions) (RepositoryList, int64, error)
SearchRepository returns repositories based on search options, it returns results in given range and number of total results.
func SearchRepositoryByCondition ¶ added in v1.11.4
func SearchRepositoryByCondition(opts *SearchRepoOptions, cond builder.Cond, loadAttributes bool) (RepositoryList, int64, error)
SearchRepositoryByCondition search repositories by condition
func SearchRepositoryByName ¶
func SearchRepositoryByName(opts *SearchRepoOptions) (RepositoryList, int64, error)
SearchRepositoryByName takes keyword and part of repository name to search, it returns results in given range and number of total results.
func (RepositoryList) Len ¶ added in v1.4.0
func (repos RepositoryList) Len() int
func (RepositoryList) Less ¶ added in v1.4.0
func (repos RepositoryList) Less(i, j int) bool
func (RepositoryList) LoadAttributes ¶
func (repos RepositoryList) LoadAttributes() error
LoadAttributes loads the attributes for the given RepositoryList
func (RepositoryList) Swap ¶ added in v1.4.0
func (repos RepositoryList) Swap(i, j int)
type Review ¶ added in v1.6.0
type Review struct { ID int64 `xorm:"pk autoincr"` Type ReviewType Reviewer *user_model.User `xorm:"-"` ReviewerID int64 `xorm:"index"` ReviewerTeamID int64 `xorm:"NOT NULL DEFAULT 0"` ReviewerTeam *Team `xorm:"-"` OriginalAuthor string OriginalAuthorID int64 Issue *Issue `xorm:"-"` IssueID int64 `xorm:"index"` Content string `xorm:"TEXT"` // Official is a review made by an assigned approver (counts towards approval) Official bool `xorm:"NOT NULL DEFAULT false"` CommitID string `xorm:"VARCHAR(40)"` Stale bool `xorm:"NOT NULL DEFAULT false"` Dismissed bool `xorm:"NOT NULL DEFAULT false"` CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"` UpdatedUnix timeutil.TimeStamp `xorm:"INDEX updated"` // CodeComments are the initial code comments of the review CodeComments CodeComments `xorm:"-"` Comments []*Comment `xorm:"-"` }
Review represents collection of code comments giving feedback for a PR
func CreateReview ¶ added in v1.6.0
func CreateReview(opts CreateReviewOptions) (*Review, error)
CreateReview creates a new review based on opts
func FindReviews ¶ added in v1.6.0
func FindReviews(opts FindReviewOptions) ([]*Review, error)
FindReviews returns reviews passing FindReviewOptions
func GetCurrentReview ¶ added in v1.6.0
func GetCurrentReview(reviewer *user_model.User, issue *Issue) (*Review, error)
GetCurrentReview returns the current pending review of reviewer for given issue
func GetReviewByID ¶ added in v1.6.0
GetReviewByID returns the review by the given ID
func GetReviewByIssueIDAndUserID ¶ added in v1.13.0
GetReviewByIssueIDAndUserID get the latest review of reviewer for a pull request
func GetReviewersByIssueID ¶ added in v1.11.0
GetReviewersByIssueID gets the latest review of each reviewer for a pull request
func GetReviewersFromOriginalAuthorsByIssueID ¶ added in v1.13.0
GetReviewersFromOriginalAuthorsByIssueID gets the latest review of each original authors for a pull request
func GetTeamReviewerByIssueIDAndTeamID ¶ added in v1.13.0
GetTeamReviewerByIssueIDAndTeamID get the latest review request of reviewer team for a pull request
func (*Review) GetCodeCommentsCount ¶ added in v1.12.0
GetCodeCommentsCount return count of CodeComments a Review has
func (*Review) HTMLURL ¶ added in v1.12.0
HTMLURL formats a URL-string to the related review issue-comment
func (*Review) LoadAttributes ¶ added in v1.6.0
LoadAttributes loads all attributes except CodeComments
func (*Review) LoadCodeComments ¶ added in v1.6.0
LoadCodeComments loads CodeComments
func (*Review) LoadReviewer ¶ added in v1.11.0
LoadReviewer loads reviewer
func (*Review) LoadReviewerTeam ¶ added in v1.13.0
LoadReviewerTeam loads reviewer team
type ReviewCount ¶ added in v1.12.0
type ReviewCount struct { IssueID int64 Type ReviewType Count int64 }
ReviewCount represents a count of Reviews
type ReviewType ¶ added in v1.6.0
type ReviewType int
ReviewType defines the sort of feedback a review gives
const ( // ReviewTypePending is a review which is not published yet ReviewTypePending ReviewType = iota // ReviewTypeApprove approves changes ReviewTypeApprove // ReviewTypeComment gives general feedback ReviewTypeComment // ReviewTypeReject gives feedback blocking merge ReviewTypeReject // ReviewTypeRequest request review from others ReviewTypeRequest )
const ReviewTypeUnknown ReviewType = -1
ReviewTypeUnknown unknown review type
func (ReviewType) Icon ¶ added in v1.6.0
func (rt ReviewType) Icon() string
Icon returns the corresponding icon for the review type
type RoleDescriptor ¶ added in v1.16.0
type RoleDescriptor int
RoleDescriptor defines comment tag type
const ( RoleDescriptorNone RoleDescriptor = iota RoleDescriptorPoster RoleDescriptorWriter RoleDescriptorOwner )
Enumerate all the role tags.
func (RoleDescriptor) HasRole ¶ added in v1.16.0
func (rd RoleDescriptor) HasRole(role string) bool
HasRole returns if a certain role is enabled on the RoleDescriptor.
func (RoleDescriptor) WithRole ¶ added in v1.16.0
func (rd RoleDescriptor) WithRole(role RoleDescriptor) RoleDescriptor
WithRole enable a specific tag on the RoleDescriptor.
type SearchMembersOptions ¶ added in v1.12.0
type SearchMembersOptions struct {
db.ListOptions
}
SearchMembersOptions holds the search options
type SearchOrderBy ¶ added in v1.3.0
type SearchOrderBy string
SearchOrderBy is used to sort the result
const ( SearchOrderByAlphabetically SearchOrderBy = "name ASC" SearchOrderByAlphabeticallyReverse SearchOrderBy = "name DESC" SearchOrderByLeastUpdated SearchOrderBy = "updated_unix ASC" SearchOrderByRecentUpdated SearchOrderBy = "updated_unix DESC" SearchOrderByOldest SearchOrderBy = "created_unix ASC" SearchOrderByNewest SearchOrderBy = "created_unix DESC" SearchOrderBySize SearchOrderBy = "size ASC" SearchOrderBySizeReverse SearchOrderBy = "size DESC" SearchOrderByID SearchOrderBy = "id ASC" SearchOrderByIDReverse SearchOrderBy = "id DESC" SearchOrderByStars SearchOrderBy = "num_stars ASC" SearchOrderByStarsReverse SearchOrderBy = "num_stars DESC" SearchOrderByForks SearchOrderBy = "num_forks ASC" SearchOrderByForksReverse SearchOrderBy = "num_forks DESC" )
Strings for sorting result
func (SearchOrderBy) String ¶ added in v1.3.0
func (s SearchOrderBy) String() string
type SearchOrgTeamOptions ¶ added in v1.16.1
type SearchOrgTeamOptions struct { db.ListOptions Keyword string OrgID int64 IncludeDesc bool }
SearchOrgTeamOptions holds the search options
type SearchOrganizationsOptions ¶ added in v1.12.0
type SearchOrganizationsOptions struct { db.ListOptions All bool }
SearchOrganizationsOptions options to filter organizations
type SearchRepoOptions ¶
type SearchRepoOptions struct { db.ListOptions Actor *user_model.User Keyword string OwnerID int64 PriorityOwnerID int64 TeamID int64 OrderBy db.SearchOrderBy Private bool // Include private repositories in results StarredByID int64 WatchedByID int64 AllPublic bool // Include also all public repositories of users and public organisations AllLimited bool // Include also all public repositories of limited organisations // None -> include public and private // True -> include just private // False -> include just public IsPrivate util.OptionalBool // None -> include collaborative AND non-collaborative // True -> include just collaborative // False -> include just non-collaborative Collaborate util.OptionalBool // None -> include forks AND non-forks // True -> include just forks // False -> include just non-forks Fork util.OptionalBool // None -> include templates AND non-templates // True -> include just templates // False -> include just non-templates Template util.OptionalBool // None -> include mirrors AND non-mirrors // True -> include just mirrors // False -> include just non-mirrors Mirror util.OptionalBool // None -> include archived AND non-archived // True -> include just archived // False -> include just non-archived Archived util.OptionalBool // only search topic name TopicOnly bool // include description in keyword search IncludeDescription bool // None -> include has milestones AND has no milestone // True -> include just has milestones // False -> include just has no milestone HasMilestones util.OptionalBool // LowerNames represents valid lower names to restrict to LowerNames []string }
SearchRepoOptions holds the search options
type SignCommitWithStatuses ¶ added in v1.2.0
type SignCommitWithStatuses struct { Status *CommitStatus Statuses []*CommitStatus *asymkey_model.SignCommit }
SignCommitWithStatuses represents a commit with validation of signature and status state.
func ConvertFromGitCommit ¶ added in v1.16.0
func ConvertFromGitCommit(commits []*git.Commit, repo *repo_model.Repository) []*SignCommitWithStatuses
ConvertFromGitCommit converts git commits into SignCommitWithStatuses
func ParseCommitsWithStatus ¶ added in v1.2.0
func ParseCommitsWithStatus(oldCommits []*asymkey_model.SignCommit, repo *repo_model.Repository) []*SignCommitWithStatuses
ParseCommitsWithStatus checks commits latest statuses and calculates its worst status state
type Statistic ¶
type Statistic struct { Counter struct { User, Org, PublicKey, Repo, Watch, Star, Action, Access, Issue, IssueClosed, IssueOpen, Comment, Oauth, Follow, Mirror, Release, AuthSource, Webhook, Milestone, Label, HookTask, Team, UpdateTask, Project, ProjectBoard, Attachment int64 IssueByLabel []IssueByLabelCount IssueByRepository []IssueByRepositoryCount } }
Statistic contains the database statistics
func GetStatistic ¶
func GetStatistic() (stats Statistic)
GetStatistic returns the database statistics
type Stopwatch ¶ added in v1.3.0
type Stopwatch struct { ID int64 `xorm:"pk autoincr"` IssueID int64 `xorm:"INDEX"` UserID int64 `xorm:"INDEX"` CreatedUnix timeutil.TimeStamp `xorm:"created"` }
Stopwatch represents a stopwatch for time tracking.
func GetUserStopwatches ¶ added in v1.11.0
func GetUserStopwatches(userID int64, listOptions db.ListOptions) ([]*Stopwatch, error)
GetUserStopwatches return list of all stopwatches of a user
func HasUserStopwatch ¶ added in v1.3.0
HasUserStopwatch returns true if the user has a stopwatch
type Task ¶ added in v1.10.0
type Task struct { ID int64 DoerID int64 `xorm:"index"` // operator Doer *user_model.User `xorm:"-"` OwnerID int64 `xorm:"index"` // repo owner id, when creating, the repoID maybe zero Owner *user_model.User `xorm:"-"` RepoID int64 `xorm:"index"` Repo *repo_model.Repository `xorm:"-"` Type structs.TaskType Status structs.TaskStatus `xorm:"index"` StartTime timeutil.TimeStamp EndTime timeutil.TimeStamp PayloadContent string `xorm:"TEXT"` Message string `xorm:"TEXT"` // if task failed, saved the error reason Created timeutil.TimeStamp `xorm:"created"` }
Task represents a task
func FindTasks ¶ added in v1.10.0
func FindTasks(opts FindTaskOptions) ([]*Task, error)
FindTasks find all tasks
func GetMigratingTask ¶ added in v1.10.0
GetMigratingTask returns the migrating task by repo's id
func GetMigratingTaskByID ¶ added in v1.13.0
func GetMigratingTaskByID(id, doerID int64) (*Task, *migration.MigrateOptions, error)
GetMigratingTaskByID returns the migrating task by repo's id
func (*Task) MigrateConfig ¶ added in v1.10.0
func (task *Task) MigrateConfig() (*migration.MigrateOptions, error)
MigrateConfig returns task config when migrate repository
func (*Task) UpdateCols ¶ added in v1.10.0
UpdateCols updates some columns
type Team ¶
type Team struct { ID int64 `xorm:"pk autoincr"` OrgID int64 `xorm:"INDEX"` LowerName string Name string Description string AccessMode perm.AccessMode `xorm:"'authorize'"` Repos []*repo_model.Repository `xorm:"-"` Members []*user_model.User `xorm:"-"` NumRepos int NumMembers int Units []*TeamUnit `xorm:"-"` IncludesAllRepositories bool `xorm:"NOT NULL DEFAULT false"` CanCreateOrgRepo bool `xorm:"NOT NULL DEFAULT false"` }
Team represents a organization team.
func GetRepoTeams ¶ added in v1.16.0
func GetRepoTeams(repo *repo_model.Repository) ([]*Team, error)
GetRepoTeams gets the list of teams that has access to the repository
func GetReviewerTeams ¶ added in v1.16.0
func GetReviewerTeams(repo *repo_model.Repository) ([]*Team, error)
GetReviewerTeams get all teams can be requested to review
func GetTeamByID ¶
GetTeamByID returns team by given ID.
func GetTeamsWithAccessToRepo ¶ added in v1.3.0
func GetTeamsWithAccessToRepo(orgID, repoID int64, mode perm.AccessMode) ([]*Team, error)
GetTeamsWithAccessToRepo returns all teams in an organization that have given access level to the repository.
func GetUserOrgTeams ¶ added in v1.8.0
GetUserOrgTeams returns all teams that user belongs to in given organization.
func GetUserTeams ¶
func GetUserTeams(opts *GetUserTeamOptions) ([]*Team, int64, error)
GetUserTeams search for org teams. Caller is responsible to check permissions.
func SearchOrgTeams ¶ added in v1.16.1
func SearchOrgTeams(opts *SearchOrgTeamOptions) ([]*Team, int64, error)
SearchOrgTeams search for org teams. Caller is responsible to check permissions.
func (*Team) AddAllRepositories ¶ added in v1.11.0
AddAllRepositories adds all repositories to the team
func (*Team) AddMember ¶
AddMember adds new membership of the team to the organization, the user will have membership to the organization automatically when needed.
func (*Team) AddRepository ¶
func (t *Team) AddRepository(repo *repo_model.Repository) (err error)
AddRepository adds new repository to team of organization.
func (*Team) ColorFormat ¶ added in v1.9.0
ColorFormat provides a basic color format for a Team
func (*Team) GetMembers ¶
func (t *Team) GetMembers(opts *SearchMembersOptions) (err error)
GetMembers returns paginated members in team of organization.
func (*Team) GetRepositories ¶
func (t *Team) GetRepositories(opts *SearchOrgTeamOptions) error
GetRepositories returns paginated repositories in team of organization.
func (*Team) GetUnitNames ¶ added in v1.6.0
GetUnitNames returns the team units names
func (*Team) GetUnitsMap ¶ added in v1.16.0
GetUnitsMap returns the team units permissions
func (*Team) HasRepository ¶
HasRepository returns true if given repository belong to team.
func (*Team) IsOwnerTeam ¶
IsOwnerTeam returns true if team is owner team.
func (*Team) RemoveAllRepositories ¶ added in v1.11.0
RemoveAllRepositories removes all repositories from team and recalculates access
func (*Team) RemoveMember ¶
RemoveMember removes member from team of organization.
func (*Team) RemoveRepository ¶
RemoveRepository removes repository from team of organization. If the team shall include all repositories the request is ignored.
func (*Team) UnitAccessMode ¶ added in v1.16.0
func (t *Team) UnitAccessMode(tp unit.Type) perm.AccessMode
UnitAccessMode returns if the team has the given unit type enabled
type TeamRepo ¶
type TeamRepo struct { ID int64 `xorm:"pk autoincr"` OrgID int64 `xorm:"INDEX"` TeamID int64 `xorm:"UNIQUE(s)"` RepoID int64 `xorm:"UNIQUE(s)"` }
TeamRepo represents an team-repository relation.
type TeamUnit ¶ added in v1.5.0
type TeamUnit struct { ID int64 `xorm:"pk autoincr"` OrgID int64 `xorm:"INDEX"` TeamID int64 `xorm:"UNIQUE(s)"` Type unit.Type `xorm:"UNIQUE(s)"` AccessMode perm.AccessMode }
TeamUnit describes all units of a repository
type TeamUser ¶
type TeamUser struct { ID int64 `xorm:"pk autoincr"` OrgID int64 `xorm:"INDEX"` TeamID int64 `xorm:"UNIQUE(s)"` UID int64 `xorm:"UNIQUE(s)"` }
TeamUser represents an team-user relation.
type TrackedTime ¶ added in v1.3.0
type TrackedTime struct { ID int64 `xorm:"pk autoincr"` IssueID int64 `xorm:"INDEX"` Issue *Issue `xorm:"-"` UserID int64 `xorm:"INDEX"` User *user_model.User `xorm:"-"` Created time.Time `xorm:"-"` CreatedUnix int64 `xorm:"created"` Time int64 `xorm:"NOT NULL"` Deleted bool `xorm:"NOT NULL DEFAULT false"` }
TrackedTime represents a time that was spent for a specific issue.
func AddTime ¶ added in v1.3.0
func AddTime(user *user_model.User, issue *Issue, amount int64, created time.Time) (*TrackedTime, error)
AddTime will add the given time (in seconds) to the issue
func GetTrackedTimeByID ¶ added in v1.11.0
func GetTrackedTimeByID(id int64) (*TrackedTime, error)
GetTrackedTimeByID returns raw TrackedTime without loading attributes by id
func (*TrackedTime) AfterLoad ¶ added in v1.3.0
func (t *TrackedTime) AfterLoad()
AfterLoad is invoked from XORM after setting the values of all fields of this object.
func (*TrackedTime) LoadAttributes ¶ added in v1.11.0
func (t *TrackedTime) LoadAttributes() (err error)
LoadAttributes load Issue, User
type TrackedTimeList ¶ added in v1.11.0
type TrackedTimeList []*TrackedTime
TrackedTimeList is a List of TrackedTime's
func GetTrackedTimes ¶ added in v1.3.0
func GetTrackedTimes(opts *FindTrackedTimesOptions) (TrackedTimeList, error)
GetTrackedTimes returns all tracked times that fit to the given options.
func (TrackedTimeList) LoadAttributes ¶ added in v1.11.0
func (tl TrackedTimeList) LoadAttributes() (err error)
LoadAttributes load Issue, User
type TranslatableMessage ¶ added in v1.15.0
type TranslatableMessage struct { Format string Args []interface{} `json:"omitempty"` }
TranslatableMessage represents JSON struct that can be translated with a Locale
type Upload ¶
Upload represent a uploaded file to a repo to be deleted when moved
func GetUploadByUUID ¶
GetUploadByUUID returns the Upload by UUID
func GetUploadsByUUIDs ¶
GetUploadsByUUIDs returns multiple uploads by UUIDS
type UserHeatmapData ¶ added in v1.7.0
type UserHeatmapData struct { Timestamp timeutil.TimeStamp `json:"timestamp"` Contributions int64 `json:"contributions"` }
UserHeatmapData represents the data needed to create a heatmap
func GetUserHeatmapDataByUser ¶ added in v1.7.0
func GetUserHeatmapDataByUser(user, doer *user_model.User) ([]*UserHeatmapData, error)
GetUserHeatmapDataByUser returns an array of UserHeatmapData
func GetUserHeatmapDataByUserTeam ¶ added in v1.14.0
func GetUserHeatmapDataByUserTeam(user *user_model.User, team *Team, doer *user_model.User) ([]*UserHeatmapData, error)
GetUserHeatmapDataByUserTeam returns an array of UserHeatmapData
type UserIDCount ¶ added in v1.12.0
UserIDCount is a simple coalition of UserID and Count
func GetUIDsAndNotificationCounts ¶ added in v1.12.0
func GetUIDsAndNotificationCounts(since, until timeutil.TimeStamp) ([]UserIDCount, error)
GetUIDsAndNotificationCounts between the two provided times
type UserIssueStatsOptions ¶ added in v1.4.0
type UserIssueStatsOptions struct { UserID int64 RepoIDs []int64 FilterMode int IsPull bool IsClosed bool IssueIDs []int64 IsArchived util.OptionalBool LabelIDs []int64 Org *Organization Team *Team }
UserIssueStatsOptions contains parameters accepted by GetUserIssueStats.
Source Files ¶
- access.go
- action.go
- action_list.go
- branches.go
- commit.go
- commit_status.go
- consistency.go
- error.go
- fixture_generation.go
- helper.go
- helper_directory.go
- helper_environment.go
- issue.go
- issue_assignees.go
- issue_comment.go
- issue_comment_list.go
- issue_dependency.go
- issue_label.go
- issue_list.go
- issue_lock.go
- issue_milestone.go
- issue_reaction.go
- issue_stopwatch.go
- issue_tracked_time.go
- issue_user.go
- issue_watch.go
- issue_xref.go
- lfs.go
- lfs_lock.go
- migrate.go
- notification.go
- org.go
- org_team.go
- project.go
- project_board.go
- project_issue.go
- protected_tag.go
- pull.go
- pull_list.go
- release.go
- repo.go
- repo_activity.go
- repo_collaboration.go
- repo_generate.go
- repo_list.go
- repo_permission.go
- repo_transfer.go
- review.go
- statistic.go
- task.go
- token.go
- upload.go
- user.go
- user_heatmap.go
- userlist.go