Documentation ¶
Index ¶
- Constants
- Variables
- func AccessTokenByNameExists(token *AccessToken) (bool, error)
- func AccessibleRepoIDsQuery(user *User) *builder.Builder
- func ActivateUserEmail(userID int64, email string, primary, activate bool) (err error)
- func AddDeletePRBranchComment(doer *User, repo *Repository, issueID int64, branchName string) error
- func AddEmailAddress(email *EmailAddress) error
- func AddEmailAddresses(emails []*EmailAddress) error
- func AddOrgUser(orgID, uid int64) error
- func AddReleaseAttachments(releaseID int64, attachmentUUIDs []string) (err error)
- func AddTeamMember(team *Team, userID int64) error
- func AddUserOpenID(openid *UserOpenID) error
- func AssertCount(t testing.TB, bean interface{}, expected interface{})
- func AssertExistsAndLoadBean(t testing.TB, bean interface{}, conditions ...interface{}) interface{}
- func AssertExistsIf(t *testing.T, expected bool, bean interface{}, conditions ...interface{})
- func AssertInt64InRange(t testing.TB, low, high, value int64)
- func AssertNotExistsBean(t testing.TB, bean interface{}, conditions ...interface{})
- func AssertSuccessfulInsert(t testing.TB, beans ...interface{})
- func AttachmentRelativePath(uuid string) string
- func AvatarLink(email string) string
- func BeanExists(t testing.TB, bean interface{}, conditions ...interface{}) bool
- func BuildLabelNamesIssueIDsCondition(labelNames []string) *builder.Builder
- func CalculateTrustStatus(verification *CommitVerification, repository *Repository, ...) (err error)
- func CanBeAssigned(user *User, repo *Repository, isPull bool) (bool, error)
- func CanCreateOrgRepo(orgID, uid int64) (bool, error)
- func CanMarkConversation(issue *Issue, doer *User) (permResult bool, err error)
- func CancelStopwatch(user *User, issue *Issue) error
- func Cell2Int64(val xorm.Cell) int64
- func ChangeMilestoneAssign(issue *Issue, doer *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, newProjectID int64) error
- func ChangeProjectStatus(p *Project, isClosed bool) error
- func ChangeProjectStatusByRepoIDAndID(repoID, projectID int64, isClosed bool) error
- func ChangeRepositoryName(doer *User, repo *Repository, newRepoName string) (err error)
- func ChangeUserName(u *User, newUserName string) (err error)
- func CheckConsistencyFor(t *testing.T, beansToCheck ...interface{})
- func CheckConsistencyForAll(t *testing.T)
- func CheckCreateRepository(doer, u *User, name string, overwriteOrAdopt bool) error
- func CheckIssueWatch(user *User, issue *Issue) (bool, error)
- func CheckLFSAccessForRepo(u *User, repo *Repository, mode AccessMode) error
- func CheckPrincipalKeyString(user *User, content string) (_ string, err error)
- func CheckPublicKeyString(content string) (_ string, err error)
- func CheckRepoStats(ctx context.Context) error
- func CommentHashTag(id int64) string
- func CommentTypeIsRef(t CommentType) bool
- func ComposeHTTPSCloneURL(owner, repo string) string
- func Cond(query interface{}, args ...interface{}) interface{}
- func ConvertUtf8ToUtf8mb4() error
- func CopyLFS(ctx DBContext, newRepo, oldRepo *Repository) error
- func CopyLanguageStat(originalRepo, destRepo *Repository) error
- func Count(bean interface{}) (int64, error)
- func CountIssues(opts *IssuesOptions) (int64, error)
- func CountIssuesByRepo(opts *IssuesOptions) (map[int64]int64, error)
- func CountLFSLockByRepoID(repoID int64) (int64, error)
- func CountLoginSources() int64
- func CountMilestonesByRepoCond(repoCond builder.Cond, isClosed bool) (map[int64]int64, error)
- func CountNotices() int64
- func CountNullArchivedRepository() (int64, error)
- func CountOrgMembers(opts FindOrgMembersOpts) (int64, error)
- func CountOrganizations() int64
- func CountOrphanedIssues() (int64, error)
- func CountOrphanedLabels() (int64, error)
- func CountOrphanedObjects(subject, refobject, joinCond string) (int64, error)
- func CountRepoClosedMilestones(repoID int64) (int64, error)
- func CountRepositories(private bool) int64
- func CountUnread(user *User) int64
- func CountUserRepositories(userID int64, private bool) int64
- func CountUsers() int64
- func CreateHookTask(t *HookTask) error
- func CreateIssueDependency(user *User, issue, dep *Issue) error
- func CreateLoginSource(source *LoginSource) error
- func CreateNotice(tp NoticeType, desc string, args ...interface{}) error
- func CreateOrStopIssueStopwatch(user *User, issue *Issue) error
- func CreateOrUpdateIssueNotifications(issueID, commentID, notificationAuthorID, receiverID int64) error
- func CreateOrUpdateIssueWatch(userID, issueID int64, isWatching bool) error
- func CreateOrganization(org, owner *User) (err error)
- func CreateRefComment(doer *User, repo *Repository, issue *Issue, content, commitSHA string) error
- func CreateRepository(ctx DBContext, doer, u *User, repo *Repository, overwriteOrAdopt bool) (err error)
- func CreateRepositoryNotice(desc string, args ...interface{}) error
- func CreateTask(task *Task) error
- func CreateTemporaryPath(prefix string) (string, error)
- func CreateTestEngine(fixturesDir string) error
- func CreateUser(u *User) (err error)
- func CreateWebhook(w *Webhook) error
- func DeleteAccessTokenByID(id, userID int64) error
- func DeleteAllRecords(tableName string) error
- func DeleteAttachment(a *Attachment, remove bool) error
- func DeleteAttachments(attachments []*Attachment, remove bool) (int, error)
- func DeleteAttachmentsByComment(commentID int64, remove bool) (int, error)
- func DeleteAttachmentsByIssue(issueID int64, remove bool) (int, error)
- func DeleteAttachmentsByRelease(releaseID int64) error
- func DeleteComment(comment *Comment, doer *User) error
- func DeleteCommentReaction(doer *User, issue *Issue, comment *Comment, content string) error
- func DeleteDefaultSystemWebhook(id int64) error
- func DeleteDeployKey(doer *User, id int64) error
- func DeleteEmailAddress(email *EmailAddress) (err error)
- func DeleteEmailAddresses(emails []*EmailAddress) (err error)
- func DeleteGPGKey(doer *User, id int64) (err error)
- func DeleteInactiveUsers(ctx context.Context, olderThan time.Duration) (err error)
- func DeleteIssueLabel(issue *Issue, label *Label, doer *User) (err error)
- func DeleteIssueReaction(doer *User, issue *Issue, content string) error
- func DeleteIssueUserTimes(issue *Issue, user *User) error
- func DeleteLabel(id, labelID int64) error
- func DeleteMilestoneByRepoID(repoID, id int64) error
- func DeleteMirrorByRepoID(repoID int64) error
- func DeleteNotice(id int64) error
- func DeleteNotices(start, end int64) error
- func DeleteNoticesByIDs(ids []int64) error
- func DeleteOAuth2Application(id, userid int64) error
- func DeleteOldRepositoryArchives(ctx context.Context, olderThan time.Duration) error
- func DeleteOrganization(org *User) (err 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 DeletePublicKey(doer *User, id int64) (err error)
- func DeleteReaction(opts *ReactionOptions) error
- func DeleteRegistration(reg *U2FRegistration) error
- func DeleteReleaseByID(id int64) error
- func DeleteRepository(doer *User, uid, repoID int64) error
- func DeleteRepositoryArchives(ctx context.Context) error
- func DeleteReview(r *Review) error
- func DeleteSource(source *LoginSource) error
- func DeleteTeam(t *Team) error
- func DeleteTime(t *TrackedTime) error
- func DeleteTwoFactorByID(id, userID int64) error
- func DeleteUploadByUUID(uuid string) error
- func DeleteUploads(uploads ...*Upload) (err error)
- func DeleteUser(u *User) (err error)
- func DeleteUserOpenID(openid *UserOpenID) (err error)
- func DeleteWebhookByOrgID(orgID, id int64) error
- func DeleteWebhookByRepoID(repoID, id int64) error
- func DoctorUserStarNum() (err error)
- func DumpDatabase(filePath string, dbType string) error
- func ErrCancelledf(format string, args ...interface{}) error
- func FilterOutRepoIdsWithoutUnitAccess(u *User, repoIDs []int64, units ...UnitType) ([]int64, error)
- func FindByMaxID(maxID int64, limit int, results interface{}) error
- func FindRepoRecentCommitStatusContexts(repoID int64, before time.Duration) ([]string, error)
- func FindUserAccessibleRepoIDs(user *User) ([]int64, error)
- func FinishMigrateTask(task *Task) error
- func FixNullArchivedRepository() (int64, error)
- func FollowUser(userID, followID int64) (err error)
- func FullPushingEnvironment(author, committer *User, repo *Repository, repoName string, prID int64) []string
- func GPGKeyToEntity(k *GPGKey) (*openpgp.Entity, error)
- func GenerateAvatar(ctx DBContext, templateRepo, generateRepo *Repository) error
- func GenerateGitHooks(ctx DBContext, templateRepo, generateRepo *Repository) error
- func GenerateIssueLabels(ctx DBContext, templateRepo, generateRepo *Repository) error
- func GenerateLFSOid(content io.Reader) (string, error)
- func GenerateTopics(ctx DBContext, templateRepo, generateRepo *Repository) error
- func GenerateWebhooks(ctx DBContext, templateRepo, generateRepo *Repository) error
- func GetActiveOAuth2Providers() ([]string, map[string]OAuth2Provider, error)
- func GetAssigneeIDsByIssue(issueID int64) ([]int64, error)
- func GetCount(t testing.TB, bean interface{}, conditions ...interface{}) int
- func GetEmailForHash(md5Sum string) (string, error)
- func GetExternalLogin(externalLoginUser *ExternalLoginUser) (bool, error)
- func GetIssueIDsByRepoID(repoID int64) ([]int64, error)
- func GetIssueWatchersIDs(issueID int64, watching bool) ([]int64, error)
- func GetLabelIDsInOrgByNames(orgID int64, labelNames []string) ([]int64, error)
- func GetLabelIDsInOrgsByNames(orgIDs []int64, labelNames []string) ([]int64, error)
- func GetLabelIDsInRepoByNames(repoID int64, labelNames []string) ([]int64, error)
- func GetLabelTemplateFile(name string) ([][3]string, error)
- func GetMaxID(beanOrTableName interface{}) (maxID int64, err error)
- func GetNotificationCount(user *User, status NotificationStatus) (int64, error)
- func GetParticipantsIDsByIssueID(issueID int64) ([]int64, error)
- func GetPrivateRepositoryCount(u *User) (int64, error)
- func GetPublicRepositoryCount(u *User) (int64, error)
- func GetPullRequestIDsByCheckStatus(status PullRequestStatus) ([]int64, error)
- func GetReleaseAttachments(rels ...*Release) (err error)
- func GetReleaseCountByRepoID(repoID int64, opts FindReleasesOptions) (int64, error)
- func GetRepoIDsForIssuesOptions(opts *IssuesOptions, user *User) ([]int64, error)
- func GetRepoInitFile(tp, name string) ([]byte, error)
- func GetRepoIssueStats(repoID, uid int64, filterMode int, isPull bool) (numOpen int64, numClosed int64)
- func GetRepoWatchersIDs(repoID int64) ([]int64, error)
- func GetRepositoriesMapByIDs(ids []int64) (map[int64]*Repository, error)
- func GetRepositoryCount(u *User) (int64, error)
- func GetTeamIDsByNames(orgID int64, names []string, ignoreNonExistent bool) ([]int64, error)
- func GetTeamNamesByID(teamIDs []int64) ([]string, error)
- func GetTrackedSeconds(opts FindTrackedTimesOptions) (int64, error)
- func GetUnindexedRepos(indexerType RepoIndexerType, maxRepoID int64, page, pageSize int) ([]int64, error)
- func GetUser(user *User) (bool, error)
- func GetUserEmailsByNames(names []string) []string
- func GetUserIDByExternalUserID(provider string, userID string) (int64, error)
- func GetUserIDsByNames(names []string, ignoreNonExistent bool) ([]int64, error)
- func GetUserNamesByIDs(ids []int64) ([]string, error)
- func GetUserSalt() (string, error)
- func GetYamlFixturesAccess() (string, error)
- func GitConfigPath(repoPath string) string
- func HasAccess(userID int64, repo *Repository) (bool, error)
- func HasAccessUnit(user *User, repo *Repository, unitType UnitType, testMode AccessMode) (bool, error)
- func HasDeployKey(keyID, repoID int64) bool
- func HasIssueLabel(issueID, labelID int64) bool
- func HasOrgVisible(org *User, user *User) bool
- func HasOrgsVisible(orgs []*User, user *User) bool
- func HasTeamRepo(orgID, teamID, repoID int64) bool
- func IncrementRepoForkNum(ctx DBContext, repoID int64) error
- func InitFixtures(dir string) (err error)
- func InitOAuth2() error
- func InitializeLabels(ctx DBContext, repoID int64, labelTemplate string, isOrg bool) error
- func InsertIssueComments(comments []*Comment) error
- func InsertIssues(issues ...*Issue) error
- func InsertMilestones(ms ...*Milestone) (err error)
- func InsertMirror(mirror *Mirror) error
- func InsertPullRequests(prs ...*PullRequest) error
- func InsertRelease(rel *Release) error
- func InsertReleases(rels ...*Release) error
- func InsertReleasesContext(ctx DBContext, rels []*Release) error
- func InsertReviews(reviews []*Review) error
- func InternalPushingEnvironment(doer *User, repo *Repository) []string
- func IsContentEmptyErr(err error) bool
- func IsEmailUsed(email string) (bool, error)
- func IsErrAccessTokenEmpty(err error) bool
- func IsErrAccessTokenNotExist(err error) bool
- func IsErrAttachmentNotExist(err error) bool
- func IsErrBranchAlreadyExists(err error) bool
- func IsErrBranchDoesNotExist(err error) bool
- func IsErrBranchNameConflict(err error) bool
- func IsErrBranchesEqual(err error) bool
- func IsErrCancelled(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 IsErrDeployKeyAlreadyExist(err error) bool
- func IsErrDeployKeyNameAlreadyUsed(err error) bool
- func IsErrDeployKeyNotExist(err error) bool
- func IsErrEmailAlreadyUsed(err error) bool
- func IsErrEmailInvalid(err error) bool
- func IsErrErrPullRequestHeadRepoMissing(err error) bool
- func IsErrExternalLoginUserAlreadyExist(err error) bool
- func IsErrExternalLoginUserNotExist(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 IsErrGPGKeyAccessDenied(err error) bool
- func IsErrGPGKeyIDAlreadyUsed(err error) bool
- func IsErrGPGKeyImportNotExist(err error) bool
- func IsErrGPGKeyNotExist(err error) bool
- func IsErrGPGKeyParsing(err error) bool
- func IsErrGPGNoEmailFound(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 IsErrKeyAccessDenied(err error) bool
- func IsErrKeyAlreadyExist(err error) bool
- func IsErrKeyNameAlreadyUsed(err error) bool
- func IsErrKeyNotExist(err error) bool
- func IsErrKeyUnableVerify(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 IsErrLoginSourceAlreadyExist(err error) bool
- func IsErrLoginSourceInUse(err error) bool
- func IsErrLoginSourceNotExist(err error) bool
- func IsErrMergeConflicts(err error) bool
- func IsErrMergeUnrelatedHistories(err error) bool
- func IsErrMigrationNotAllowed(err error) bool
- func IsErrMilestoneNotExist(err error) bool
- func IsErrNameCharsNotAllowed(err error) bool
- func IsErrNamePatternNotAllowed(err error) bool
- func IsErrNameReserved(err error) bool
- func IsErrNewIssueInsert(err error) bool
- func IsErrNotAllowedToMerge(err error) bool
- func IsErrNotExist(err error) bool
- func IsErrNotValidReviewRequest(err error) bool
- func IsErrOAuthApplicationNotFound(err error) bool
- func IsErrOauthClientIDInvalid(err error) bool
- func IsErrOpenIDAlreadyUsed(err error) bool
- func IsErrOpenIDConnectInitialize(err error) bool
- func IsErrOrgLabelNotExist(err error) bool
- func IsErrOrgNotExist(err error) bool
- func IsErrProjectBoardNotExist(err error) bool
- func IsErrProjectNotExist(err error) bool
- func IsErrPullRequestAlreadyExists(err error) bool
- func IsErrPullRequestHasMerged(err error) bool
- func IsErrPullRequestNotExist(err error) bool
- func IsErrPullWasClosed(err error) bool
- func IsErrReachLimitOfRepo(err error) bool
- func IsErrReactionAlreadyExist(err error) bool
- func IsErrRebaseConflicts(err error) bool
- func IsErrReleaseAlreadyExist(err error) bool
- func IsErrReleaseNotExist(err error) bool
- func IsErrRepoAlreadyExist(err error) bool
- func IsErrRepoFileAlreadyExists(err error) bool
- func IsErrRepoFileDoesNotExist(err error) bool
- func IsErrRepoFilesAlreadyExist(err error) bool
- func IsErrRepoLabelNotExist(err error) bool
- func IsErrRepoNotExist(err error) bool
- func IsErrRepoRedirectNotExist(err error) bool
- func IsErrReviewNotExist(err error) bool
- func IsErrSHADoesNotMatch(err error) bool
- func IsErrSHANotFound(err error) bool
- func IsErrSHAOrCommitIDNotProvided(err error) bool
- func IsErrSSHDisabled(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 IsErrTopicNotExist(err error) bool
- func IsErrTrackedTimeNotExist(err error) bool
- func IsErrTwoFactorNotEnrolled(err error) bool
- func IsErrU2FRegistrationNotExist(err error) bool
- func IsErrUnitTypeNotExist(err error) bool
- func IsErrUnknownDependencyType(err error) bool
- func IsErrUpdateTaskNotExist(err error) bool
- func IsErrUploadNotExist(err error) bool
- func IsErrUserAlreadyExist(err error) bool
- func IsErrUserCannotCommit(err error) bool
- func IsErrUserDoesNotHaveAccessToRepo(err error) bool
- func IsErrUserHasOrgs(err error) bool
- func IsErrUserInactive(err error) bool
- func IsErrUserNotAllowedCreateOrg(err error) bool
- func IsErrUserNotExist(err error) bool
- func IsErrUserOwnRepos(err error) bool
- func IsErrUserProhibitLogin(err error) bool
- func IsErrWebhookNotExist(err error) bool
- func IsErrWikiAlreadyExist(err error) bool
- func IsErrWikiInvalidFileName(err error) bool
- func IsErrWikiReservedName(err error) bool
- func IsErrWontSign(err error) bool
- func IsFollowing(userID, followID int64) bool
- func IsOfficialReviewer(issue *Issue, reviewers ...*User) (bool, error)
- func IsOfficialReviewerTeam(issue *Issue, team *Team) (bool, error)
- func IsOpenIDUsed(openid string) (bool, error)
- func IsOrganizationMember(orgID, uid int64) (bool, error)
- func IsOrganizationOwner(orgID, uid int64) (bool, error)
- func IsProjectBoardTypeValid(p ProjectBoardType) bool
- func IsProjectTypeValid(p ProjectType) bool
- func IsPublicMembership(orgID, uid int64) (bool, error)
- func IsReleaseExist(repoID int64, tagName string) (bool, error)
- func IsRepositoryExist(u *User, repoName string) (bool, error)
- func IsSSPIEnabled() bool
- func IsStaring(userID, repoID int64) bool
- func IsTableNotEmpty(tableName string) (bool, error)
- func IsTeamMember(orgID, teamID, userID int64) (bool, error)
- func IsUsableRepoName(name string) error
- func IsUsableTeamName(name string) error
- func IsUsableUsername(name string) error
- func IsUserAssignedToIssue(issue *Issue, user *User) (isAssigned bool, err error)
- func IsUserExist(uid int64, name string) (bool, error)
- func IsUserInTeams(userID int64, teamIDs []int64) (bool, error)
- func IsUserParticipantsOfIssue(user *User, issue *Issue) bool
- func IsUserRealRepoAdmin(repo *Repository, user *User) (bool, error)
- func IsUserRepoAdmin(repo *Repository, user *User) (bool, error)
- func IsValidHookContentType(name string) bool
- func IsValidHookTaskType(name string) bool
- func IsWatching(userID, repoID int64) bool
- func IssueNoDependenciesLeft(issue *Issue) (bool, error)
- func Iterate(ctx DBContext, tableBean interface{}, cond builder.Cond, ...) error
- func IterateAttachment(f func(attach *Attachment) error) error
- func IterateLFS(f func(mo *LFSMetaObject) error) error
- func IterateRepository(f func(repo *Repository) error) error
- func IterateUser(f func(user *User) error) error
- func LFSAutoAssociate(metas []*LFSMetaObject, user *User, repoID int64) error
- func LFSObjectAccessible(user *User, oid string) (bool, error)
- func LinkExternalToUser(user *User, externalLoginUser *ExternalLoginUser) error
- func LoadFixtures() error
- func LoadLabelsFormatted(labelTemplate string) (string, error)
- func LocalCopyPath() string
- func LockIssue(opts *IssueLockOptions) error
- func LookupRepoRedirect(ownerID int64, repoName string) (int64, error)
- func MainTest(m *testing.M, pathToGiteaRoot string)
- func MakeEmailPrimary(email *EmailAddress) error
- func MakeIDsFromAPIAssigneesToAdd(oneAssignee string, multipleAssignees []string) (assigneeIDs []int64, err error)
- func MarkConversation(comment *Comment, doer *User, isResolve bool) (err error)
- func MarkReviewsAsNotStale(issueID int64, commitID string) (err error)
- func MarkReviewsAsStale(issueID int64) (err error)
- func MaxBatchInsertSize(bean interface{}) int
- func MirrorsIterate(f func(idx int, bean interface{}) error) error
- func MoveIssueAcrossProjectBoards(issue *Issue, board *ProjectBoard) error
- func NamesToBean(names ...string) ([]interface{}, error)
- func NewAccessToken(t *AccessToken) error
- func NewCommitStatus(opts NewCommitStatusOptions) error
- func NewEngine(ctx context.Context, migrateFunc func(*xorm.Engine) error) (err error)
- func NewIssue(repo *Repository, issue *Issue, labelIDs []int64, uuids []string) (err error)
- func NewIssueLabel(issue *Issue, label *Label, doer *User) (err error)
- func NewIssueLabels(issue *Issue, labels []*Label, doer *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 *Repository, pull *Issue, labelIDs []int64, uuids []string, ...) (err error)
- func NewRepoContext()
- func NewRepoRedirect(ctx DBContext, ownerID, repoID int64, oldRepoName, newRepoName string) error
- func NewTeam(t *Team) (err error)
- func NewTestEngine() (err error)
- func NewTwoFactor(t *TwoFactor) error
- func NewXORMLogger(showSQL bool) xormlog.Logger
- func NotifyWatchers(actions ...*Action) error
- func NotifyWatchersActions(acts []*Action) error
- func ParseCommitsWithSignature(oldCommits *list.List, repository *Repository) *list.List
- func ParseCommitsWithStatus(oldCommits *list.List, repo *Repository) *list.List
- func Ping() error
- func PrepareTestDatabase() error
- func PrepareTestEnv(t testing.TB)
- func PublicSigningKey(repoPath string) (string, error)
- func PushUpdateDeleteTag(repo *Repository, tagName string) error
- func PushUpdateDeleteTagsContext(ctx DBContext, repo *Repository, tags []string) error
- func PushingEnvironment(doer *User, repo *Repository) []string
- func RegeneratePrincipalKeys(t io.StringWriter) error
- func RegeneratePublicKeys(t io.StringWriter) error
- func RemoveAccountLink(user *User, loginSourceID int64) (int64, error)
- func RemoveAllWithNotice(title, path string)
- func RemoveDeletedBranch(repoID int64, branch string) error
- func RemoveIssueDependency(user *User, issue *Issue, dep *Issue, depType DependencyType) (err error)
- func RemoveOldDeletedBranches(ctx context.Context, olderThan time.Duration)
- func RemoveOrgUser(orgID, userID int64) error
- func RemoveRandomAvatars(ctx context.Context) error
- func RemoveStorageWithNotice(bucket storage.ObjectStorage, title, path string)
- func RemoveTeamMember(team *Team, userID int64) error
- func RemoveTemporaryPath(basePath string) error
- func RepoPath(userName, repoName string) string
- func ResetOAuth2() error
- func ReviewExists(issue *Issue, treePath string, line int64) (bool, error)
- func RevokeOAuth2Grant(grantID, userID int64) error
- func RewriteAllPrincipalKeys() error
- func RewriteAllPublicKeys() error
- func SMTPAuth(a smtp.Auth, cfg *SMTPConfig) error
- func SSHKeyGenParsePublicKey(key string) (string, int, error)
- func SSHNativeParsePublicKey(keyLine string) (string, int, error)
- func SanitizeAndValidateTopics(topics []string) (validTopics []string, invalidTopics []string)
- func SaveOrUpdateTag(repo *Repository, newRel *Release) error
- func SaveTopics(repoID int64, topicNames ...string) error
- func SearchIssueIDsByKeyword(kw string, repoIDs []int64, limit, start int) (int64, []int64, error)
- func SearchRepositoryCondition(opts *SearchRepoOptions) builder.Cond
- func SecToTime(duration int64) string
- func SetEngine() (err error)
- func SetNotificationStatus(notificationID int64, user *User, status NotificationStatus) error
- func SignInitialCommit(repoPath string, u *User) (bool, string, *git.Signature, error)
- func SigningKey(repoPath string) (string, *git.Signature)
- func SortReleases(rels []*Release)
- func StarRepo(userID, repoID int64, star bool) error
- func StopwatchExists(userID int64, issueID int64) bool
- func SubmitReview(doer *User, issue *Issue, reviewType ReviewType, content, commitID string, ...) (*Review, *Comment, error)
- func SyncExternalUsers(ctx context.Context, updateExisting bool) error
- func ToggleUserOpenIDVisibility(id int64) (err error)
- func TotalTimes(options FindTrackedTimesOptions) (map[*User]string, error)
- func TransferOwnership(doer *User, newOwnerName string, repo *Repository) (err error)
- func TxDBContext() (DBContext, Committer, error)
- func UnfollowUser(userID, followID int64) (err error)
- func UnlockIssue(opts *IssueLockOptions) error
- func UpdateAccessToken(t *AccessToken) error
- func UpdateAttachment(atta *Attachment) error
- func UpdateComment(c *Comment, doer *User) error
- func UpdateCommentsMigrationsByType(tp structs.GitServiceType, originalAuthorID string, posterID int64) error
- func UpdateDeployKey(key *DeployKey) error
- func UpdateDeployKeyCols(key *DeployKey, cols ...string) error
- func UpdateExternalUser(user *User, gothUser goth.User) error
- func UpdateHookTask(t *HookTask) error
- func UpdateIssueDeadline(issue *Issue, deadlineUnix timeutil.TimeStamp, doer *User) (err error)
- func UpdateIssueMentions(ctx DBContext, issueID int64, mentions []*User) error
- func UpdateIssueUserByRead(uid, issueID int64) error
- func UpdateIssueUsersByMentions(ctx DBContext, issueID int64, uids []int64) error
- func UpdateIssuesMigrationsByType(gitServiceType structs.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 UpdateMirror(m *Mirror) error
- func UpdateNotificationStatuses(user *User, currentStatus NotificationStatus, desiredStatus NotificationStatus) error
- func UpdateProject(p *Project) error
- func UpdateProjectBoard(board *ProjectBoard) error
- func UpdateProtectBranch(repo *Repository, protectBranch *ProtectedBranch, opts WhitelistOptions) (err error)
- func UpdatePublicKeyUpdated(id int64) error
- func UpdateReactionsMigrationsByType(gitServiceType structs.GitServiceType, originalAuthorID string, userID int64) error
- func UpdateRelease(ctx DBContext, rel *Release) error
- func UpdateReleasesMigrationsByType(gitServiceType structs.GitServiceType, originalAuthorID string, posterID int64) error
- func UpdateRepository(repo *Repository, visibilityChanged bool) (err error)
- func UpdateRepositoryCols(repo *Repository, cols ...string) error
- func UpdateRepositoryCtx(ctx DBContext, repo *Repository, visibilityChanged bool) error
- func UpdateRepositoryUnits(repo *Repository, units []RepoUnit, deleteUnitTypes []UnitType) (err error)
- func UpdateRepositoryUpdatedTime(repoID int64, updateTime time.Time) error
- func UpdateReviewsMigrationsByType(tp structs.GitServiceType, originalAuthorID string, posterID int64) error
- func UpdateSource(source *LoginSource) error
- func UpdateTeam(t *Team, authChanged bool, includeAllChanged bool) (err error)
- func UpdateTeamUnits(team *Team, units []TeamUnit) (err error)
- func UpdateTwoFactor(t *TwoFactor) error
- func UpdateUser(u *User) error
- func UpdateUserCols(u *User, cols ...string) error
- func UpdateUserSetting(u *User) (err error)
- func UpdateWebhook(w *Webhook) error
- func UpdateWebhookLastStatus(w *Webhook) error
- func UploadLocalPath(uuid string) string
- func UserPath(userName string) string
- func UsersInTeamsCount(userIDs []int64, teamIDs []int64) (int64, error)
- func ValidateCommitsWithEmails(oldCommits *list.List) *list.List
- func ValidateEmail(email string) error
- func ValidateTopic(topic string) bool
- func WatchIfAuto(userID int64, repoID int64, isWrite bool) error
- func WatchRepo(userID, repoID int64, watch bool) (err error)
- func WatchRepoMode(userID, repoID int64, mode RepoWatchMode) (err error)
- func WikiPath(userName, repoName string) string
- func WithContext(f func(ctx DBContext) error) error
- func WithTx(f func(ctx DBContext) error) error
- type Access
- type AccessMode
- type AccessToken
- type AccessibleReposEnvironment
- type Action
- func (a *Action) GetActAvatar() string
- 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) GetRepoLink() string
- func (a *Action) GetRepoName() string
- func (a *Action) GetRepoPath() string
- func (a *Action) GetRepoUserName() string
- 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 Attachment
- func GetAttachmentByID(id int64) (*Attachment, error)
- func GetAttachmentByReleaseIDFileName(releaseID int64, fileName string) (*Attachment, error)
- func GetAttachmentByUUID(uuid string) (*Attachment, error)
- func GetAttachmentsByCommentID(commentID int64) ([]*Attachment, error)
- func GetAttachmentsByIssueID(issueID int64) ([]*Attachment, error)
- func GetAttachmentsByUUIDs(uuids []string) ([]*Attachment, error)
- func NewAttachment(attach *Attachment, buf []byte, file io.Reader) (_ *Attachment, err error)
- type CloneLink
- type CodeComments
- type Collaboration
- type Collaborator
- type Comment
- func AddReviewRequest(issue *Issue, reviewer, doer *User) (*Comment, error)
- func AddTeamReviewRequest(issue *Issue, reviewer *Team, doer *User) (*Comment, error)
- func CreateComment(opts *CreateCommentOptions) (comment *Comment, err error)
- func CreatePushPullComment(pusher *User, pr *PullRequest, oldCommitID, newCommitID string) (comment *Comment, err error)
- func FindComments(opts FindCommentsOptions) ([]*Comment, error)
- func GetCommentByID(id int64) (*Comment, error)
- func RemoveReviewRequest(issue *Issue, reviewer, doer *User) (*Comment, error)
- func RemoveTeamReviewRequest(issue *Issue, reviewer *Team, doer *User) (*Comment, error)
- func UpdateIssueByAPI(issue *Issue, doer *User) (statusChangeComment *Comment, titleChanged bool, err error)
- func (c *Comment) APIFormat() *api.Comment
- 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, 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 *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) 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 CommentTag
- type CommentType
- type CommitStatus
- type CommitStatusOptions
- type CommitVerification
- type Committer
- type ContentEmptyErr
- type CreateCommentOptions
- type CreateOAuth2ApplicationOptions
- type CreateRepoOptions
- type CreateReviewOptions
- type DBContext
- type DeletedBranch
- type DependencyInfo
- type DependencyType
- type DeployKey
- func AddDeployKey(repoID int64, name, content string, readOnly bool) (*DeployKey, error)
- func GetDeployKeyByID(id int64) (*DeployKey, error)
- func GetDeployKeyByRepo(keyID, repoID int64) (*DeployKey, error)
- func ListDeployKeys(repoID int64, listOptions ListOptions) ([]*DeployKey, error)
- func SearchDeployKeys(repoID int64, keyID int64, fingerprint string) ([]*DeployKey, error)
- type EmailAddress
- type EmailHash
- type Engine
- type ErrAccessTokenEmpty
- type ErrAccessTokenNotExist
- type ErrAttachmentNotExist
- type ErrBranchAlreadyExists
- type ErrBranchDoesNotExist
- type ErrBranchNameConflict
- type ErrBranchesEqual
- type ErrCancelled
- type ErrCircularDependency
- type ErrCommentNotExist
- type ErrCommitIDDoesNotMatch
- type ErrDependenciesLeft
- type ErrDependencyExists
- type ErrDependencyNotExists
- type ErrDeployKeyAlreadyExist
- type ErrDeployKeyNameAlreadyUsed
- type ErrDeployKeyNotExist
- type ErrEmailAlreadyUsed
- type ErrEmailInvalid
- type ErrExternalLoginUserAlreadyExist
- type ErrExternalLoginUserNotExist
- type ErrFilePathInvalid
- type ErrFilePathProtected
- type ErrFilenameInvalid
- type ErrForbiddenIssueReaction
- type ErrForkAlreadyExist
- type ErrGPGKeyAccessDenied
- type ErrGPGKeyIDAlreadyUsed
- type ErrGPGKeyImportNotExist
- type ErrGPGKeyNotExist
- type ErrGPGKeyParsing
- type ErrGPGNoEmailFound
- type ErrInvalidCloneAddr
- type ErrInvalidMergeStyle
- type ErrInvalidTagName
- type ErrIssueIsClosed
- type ErrIssueLabelTemplateLoad
- type ErrIssueNotExist
- type ErrIssueWasClosed
- type ErrKeyAccessDenied
- type ErrKeyAlreadyExist
- type ErrKeyNameAlreadyUsed
- type ErrKeyNotExist
- type ErrKeyUnableVerify
- type ErrLFSFileLocked
- type ErrLFSLockAlreadyExist
- type ErrLFSLockNotExist
- type ErrLFSUnauthorizedAction
- type ErrLabelNotExist
- type ErrLastOrgOwner
- type ErrLoginSourceAlreadyExist
- type ErrLoginSourceInUse
- type ErrLoginSourceNotExist
- type ErrMergeConflicts
- type ErrMergeUnrelatedHistories
- type ErrMigrationNotAllowed
- type ErrMilestoneNotExist
- type ErrNameCharsNotAllowed
- type ErrNamePatternNotAllowed
- type ErrNameReserved
- type ErrNewIssueInsert
- type ErrNotAllowedToMerge
- type ErrNotExist
- type ErrNotValidReviewRequest
- type ErrOAuthApplicationNotFound
- type ErrOAuthClientIDInvalid
- type ErrOpenIDAlreadyUsed
- type ErrOpenIDConnectInitialize
- type ErrOrgLabelNotExist
- type ErrOrgNotExist
- type ErrProjectBoardNotExist
- type ErrProjectNotExist
- type ErrPullRequestAlreadyExists
- type ErrPullRequestHasMerged
- type ErrPullRequestHeadRepoMissing
- type ErrPullRequestNotExist
- type ErrPullWasClosed
- type ErrReachLimitOfRepo
- type ErrReactionAlreadyExist
- type ErrRebaseConflicts
- type ErrReleaseAlreadyExist
- type ErrReleaseNotExist
- type ErrRepoAlreadyExist
- type ErrRepoFileAlreadyExists
- type ErrRepoFileDoesNotExist
- type ErrRepoFilesAlreadyExist
- type ErrRepoLabelNotExist
- type ErrRepoNotExist
- type ErrRepoRedirectNotExist
- type ErrReviewNotExist
- type ErrSHADoesNotMatch
- type ErrSHANotFound
- type ErrSHAOrCommitIDNotProvided
- type ErrSSHDisabled
- type ErrStopwatchNotExist
- type ErrTagAlreadyExists
- type ErrTaskDoesNotExist
- type ErrTeamAlreadyExist
- type ErrTeamNotExist
- type ErrTopicNotExist
- type ErrTrackedTimeNotExist
- type ErrTwoFactorNotEnrolled
- type ErrU2FRegistrationNotExist
- type ErrUnitTypeNotExist
- type ErrUnknownDependencyType
- type ErrUpdateTaskNotExist
- type ErrUploadNotExist
- type ErrUserAlreadyExist
- type ErrUserCannotCommit
- type ErrUserDoesNotHaveAccessToRepo
- type ErrUserHasOrgs
- type ErrUserInactive
- type ErrUserNotAllowedCreateOrg
- type ErrUserNotExist
- type ErrUserOwnRepos
- type ErrUserProhibitLogin
- type ErrWebhookNotExist
- type ErrWikiAlreadyExist
- type ErrWikiInvalidFileName
- type ErrWikiReservedName
- type ErrWontSign
- type ExternalLoginUser
- type ExternalTrackerConfig
- type ExternalWikiConfig
- type FindCommentsOptions
- type FindExternalUserOptions
- type FindNotificationOptions
- type FindOrgMembersOpts
- type FindReactionsOptions
- type FindReleasesOptions
- type FindReviewOptions
- type FindTaskOptions
- type FindTopicOptions
- type FindTrackedTimesOptions
- type Follow
- type GPGKey
- type GPGKeyImport
- type GenerateRepoOptions
- type GetFeedsOptions
- type GetMilestonesOption
- type GiteaTemplate
- type HookContentType
- type HookEvent
- type HookEventType
- type HookEvents
- type HookRequest
- type HookResponse
- type HookStatus
- type HookTask
- type HookTaskType
- 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, content string) (err error)
- func (issue *Issue) ChangeRef(doer *User, oldRef string) (err error)
- func (issue *Issue) ChangeStatus(doer *User, isClosed bool) (*Comment, error)
- func (issue *Issue) ChangeTitle(doer *User, oldTitle string) (err error)
- func (issue *Issue) ClearLabels(doer *User) (err error)
- func (issue *Issue) DiffURL() string
- func (issue *Issue) FindAndUpdateIssueMentions(ctx DBContext, doer *User, content string) (mentions []*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) 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) (err error)
- func (issue *Issue) ReplyReference() string
- func (issue *Issue) ResolveMentionsByVisibility(ctx DBContext, doer *User, mentions []string) (users []*User, err error)
- func (issue *Issue) State() api.StateType
- func (issue *Issue) ToggleAssignee(doer *User, assigneeID int64) (removed bool, comment *Comment, err error)
- func (issue *Issue) UpdateAttachments(uuids []string) (err error)
- type IssueAssignees
- type IssueDependency
- 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) LoadRepositories() ([]*Repository, error)
- type IssueLockOptions
- type IssueStats
- type IssueStatsOptions
- type IssueUser
- type IssueWatch
- type IssueWatchList
- type IssuesConfig
- type IssuesOptions
- type KeyType
- type LDAPConfig
- type LFSLock
- func CreateLFSLock(lock *LFSLock) (*LFSLock, error)
- func DeleteLFSLockByID(id int64, u *User, force bool) (*LFSLock, error)
- func GetLFSLock(repo *Repository, path string) (*LFSLock, error)
- func GetLFSLockByID(id int64) (*LFSLock, error)
- func GetLFSLockByRepoID(repoID int64, page, pageSize int) ([]*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 ListOptions) ([]*Label, error)
- func GetLabelsByRepoID(repoID int64, sortType string, listOptions 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 LanguageStat
- type LanguageStatList
- type ListAccessTokensOptions
- type ListOptions
- type LoginSource
- func ActiveLoginSources(loginType LoginType) ([]*LoginSource, error)
- func GetActiveOAuth2LoginSourceByName(name string) (*LoginSource, error)
- func GetActiveOAuth2ProviderLoginSources() ([]*LoginSource, error)
- func GetLoginSourceByID(id int64) (*LoginSource, error)
- func LoginSources() ([]*LoginSource, error)
- func LoginSourcesByType(loginType LoginType) ([]*LoginSource, error)
- func (source *LoginSource) BeforeSet(colName string, val xorm.Cell)
- func (source *LoginSource) HasTLS() bool
- func (source *LoginSource) IsDLDAP() bool
- func (source *LoginSource) IsLDAP() bool
- func (source *LoginSource) IsOAuth2() bool
- func (source *LoginSource) IsPAM() bool
- func (source *LoginSource) IsSMTP() bool
- func (source *LoginSource) IsSSPI() bool
- func (source *LoginSource) LDAP() *LDAPConfig
- func (source *LoginSource) OAuth2() *OAuth2Config
- func (source *LoginSource) PAM() *PAMConfig
- func (source *LoginSource) SMTP() *SMTPConfig
- func (source *LoginSource) SSPI() *SSPIConfig
- func (source *LoginSource) SkipVerify() bool
- func (source *LoginSource) TypeName() string
- func (source *LoginSource) UseTLS() bool
- type LoginType
- type MergeStyle
- type Milestone
- type MilestoneList
- type MilestonesStats
- type Mirror
- type MirrorRepositoryList
- type NewCommitStatusOptions
- type NewIssueOptions
- type Notice
- type NoticeType
- type Notification
- type NotificationList
- func (nl NotificationList) APIFormat() []*api.NotificationThread
- 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 OAuth2Application
- func CreateOAuth2Application(opts CreateOAuth2ApplicationOptions) (*OAuth2Application, error)
- func GetOAuth2ApplicationByClientID(clientID string) (app *OAuth2Application, err error)
- func GetOAuth2ApplicationByID(id int64) (app *OAuth2Application, err error)
- func GetOAuth2ApplicationsByUserID(userID int64) (apps []*OAuth2Application, err error)
- func ListOAuth2Applications(uid int64, listOptions ListOptions) ([]*OAuth2Application, error)
- func UpdateOAuth2Application(opts UpdateOAuth2ApplicationOptions) (*OAuth2Application, error)
- func (app *OAuth2Application) ContainsRedirectURI(redirectURI string) bool
- func (app *OAuth2Application) CreateGrant(userID int64) (*OAuth2Grant, error)
- func (app *OAuth2Application) GenerateClientSecret() (string, error)
- func (app *OAuth2Application) GetGrantByUserID(userID int64) (*OAuth2Grant, error)
- func (app *OAuth2Application) LoadUser() (err error)
- func (app *OAuth2Application) PrimaryRedirectURI() string
- func (app *OAuth2Application) TableName() string
- func (app *OAuth2Application) ValidateClientSecret(secret []byte) bool
- type OAuth2AuthorizationCode
- type OAuth2Config
- type OAuth2Grant
- type OAuth2Provider
- type OAuth2Token
- type OAuth2TokenType
- type OrgUser
- type PAMConfig
- type Permission
- func (p *Permission) CanAccess(mode AccessMode, unitType UnitType) bool
- func (p *Permission) CanAccessAny(mode AccessMode, unitTypes ...UnitType) bool
- func (p *Permission) CanRead(unitType UnitType) bool
- func (p *Permission) CanReadAny(unitTypes ...UnitType) bool
- func (p *Permission) CanReadIssuesOrPulls(isPull bool) bool
- func (p *Permission) CanWrite(unitType UnitType) 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 UnitType) 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) HasEnoughApprovals(pr *PullRequest) bool
- func (protectBranch *ProtectedBranch) IsProtected() bool
- func (protectBranch *ProtectedBranch) IsProtectedFile(patterns []glob.Glob, path string) bool
- func (protectBranch *ProtectedBranch) IsUserMergeWhitelisted(userID int64, permissionInRepo Permission) bool
- func (protectBranch *ProtectedBranch) IsUserOfficialReviewer(user *User) (bool, error)
- func (protectBranch *ProtectedBranch) MergeBlockedByOutdatedBranch(pr *PullRequest) bool
- func (protectBranch *ProtectedBranch) MergeBlockedByProtectedFiles(pr *PullRequest) bool
- func (protectBranch *ProtectedBranch) MergeBlockedByRejectedReview(pr *PullRequest) bool
- type PublicKey
- func AddPrincipalKey(ownerID int64, content string, loginSourceID int64) (*PublicKey, error)
- func AddPublicKey(ownerID int64, name, content string, loginSourceID int64) (*PublicKey, error)
- func GetPublicKeyByID(keyID int64) (*PublicKey, error)
- func ListPrincipalKeys(uid int64, listOptions ListOptions) ([]*PublicKey, error)
- func ListPublicKeys(uid int64, listOptions ListOptions) ([]*PublicKey, error)
- func ListPublicLdapSSHKeys(uid int64, loginSourceID int64) ([]*PublicKey, error)
- func SearchPublicKey(uid int64, fingerprint string) ([]*PublicKey, error)
- func SearchPublicKeyByContent(content string) (*PublicKey, error)
- func SearchPublicKeyByContentExact(content string) (*PublicKey, error)
- type PullRequest
- func GetLatestPullRequestByHeadInfo(repoID int64, branch string) (*PullRequest, error)
- func GetPullRequestByID(id int64) (*PullRequest, error)
- func GetPullRequestByIndex(repoID int64, 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) GetDefaultMergeMessage() string
- func (pr *PullRequest) GetDefaultSquashMessage() string
- func (pr *PullRequest) GetGitRefName() string
- func (pr *PullRequest) GetWorkInProgressPrefix() string
- func (pr *PullRequest) IsChecking() 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) SignMerge(u *User, tmpBasePath, baseCommit, headCommit string) (bool, string, *git.Signature, 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 PullRequestList
- type PullRequestStatus
- type PullRequestType
- type PullRequestsConfig
- type PullRequestsOptions
- type PushActionContent
- type Reaction
- type ReactionList
- 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 DBContext, repoID int64, tagNames []string) (rels []*Release, err error)
- type RepoIndexerStatus
- type RepoIndexerType
- type RepoRedirect
- type RepoTopic
- type RepoUnit
- func (r *RepoUnit) BeforeSet(colName string, val xorm.Cell)
- func (r *RepoUnit) CodeConfig() *UnitConfig
- func (r *RepoUnit) ExternalTrackerConfig() *ExternalTrackerConfig
- func (r *RepoUnit) ExternalWikiConfig() *ExternalWikiConfig
- func (r *RepoUnit) IssuesConfig() *IssuesConfig
- func (r *RepoUnit) PullRequestsConfig() *PullRequestsConfig
- func (r *RepoUnit) ReleasesConfig() *UnitConfig
- func (r *RepoUnit) Unit() Unit
- type RepoWatchMode
- type Repository
- func GetRepositoriesByForkID(forkID int64) ([]*Repository, error)
- func GetRepositoryByID(id int64) (*Repository, error)
- func GetRepositoryByIDCtx(ctx DBContext, id int64) (*Repository, error)
- func GetRepositoryByName(ownerID int64, name string) (*Repository, error)
- func GetRepositoryByOwnerAndName(ownerName, repoName string) (*Repository, error)
- func GetRepositoryFromMatch(ownerName string, repoName string) (*Repository, error)
- func GetStarredRepos(userID int64, private bool, listOptions ListOptions) ([]*Repository, error)
- func GetUserMirrorRepositories(userID int64) ([]*Repository, error)
- func GetUserRepositories(opts *SearchRepoOptions) ([]*Repository, int64, error)
- func GetWatchedRepos(userID int64, private bool, listOptions ListOptions) ([]*Repository, error)
- func HasForkedRepo(ownerID, repoID int64) (*Repository, bool)
- func (repo *Repository) APIFormat(mode AccessMode) *api.Repository
- func (repo *Repository) APIURL() string
- func (repo *Repository) AddCollaborator(u *User) error
- func (repo *Repository) AddDeletedBranch(branchName, commit string, deletedByID int64) error
- func (repo *Repository) AfterLoad()
- func (repo *Repository) AllowOnlyContributorsToTrackTime() bool
- func (repo *Repository) AllowsPulls() bool
- func (repo *Repository) AvatarLink() string
- func (repo *Repository) CanCreateBranch() bool
- func (repo *Repository) CanEnableEditor() bool
- func (repo *Repository) CanEnablePulls() bool
- func (repo *Repository) CanEnableTimetracker() bool
- func (repo *Repository) CanUserDelete(user *User) (bool, error)
- func (repo *Repository) CanUserFork(user *User) (bool, error)
- func (repo *Repository) ChangeCollaborationAccessMode(uid int64, mode AccessMode) error
- func (repo *Repository) CheckUnitUser(user *User, unitType UnitType) bool
- func (repo *Repository) CloneLink() (cl *CloneLink)
- func (repo *Repository) ColorFormat(s fmt.State)
- func (repo *Repository) CommitLink(commitID string) (result string)
- func (repo *Repository) ComposeCompareURL(oldCommitID, newCommitID string) string
- func (repo *Repository) ComposeDocumentMetas() map[string]string
- func (repo *Repository) ComposeMetas() map[string]string
- func (repo *Repository) CountLFSMetaObjects() (int64, error)
- func (repo *Repository) CustomAvatarRelativePath() string
- func (repo *Repository) DeleteAvatar() error
- func (repo *Repository) DeleteCollaboration(uid int64) (err error)
- func (repo *Repository) DeleteProtectedBranch(id int64) (err error)
- func (repo *Repository) DeleteWiki() error
- func (repo *Repository) DescriptionHTML() template.HTML
- func (repo *Repository) FullName() string
- func (repo *Repository) GetAssignees() (_ []*User, err error)
- func (repo *Repository) GetBaseRepo() (err error)
- func (repo *Repository) GetBranchProtection(branchName string) (*ProtectedBranch, error)
- func (repo *Repository) GetCollaborators(listOptions ListOptions) ([]*Collaborator, error)
- func (repo *Repository) GetCommitsCountCacheKey(contextName string, isRef bool) string
- func (repo *Repository) GetDeletedBranchByID(id int64) (*DeletedBranch, error)
- func (repo *Repository) GetDeletedBranches() ([]*DeletedBranch, error)
- func (repo *Repository) GetForks(listOptions ListOptions) ([]*Repository, error)
- func (repo *Repository) GetIndexerStatus(indexerType RepoIndexerType) (*RepoIndexerStatus, error)
- func (repo *Repository) GetLFSMetaObjectByOid(oid string) (*LFSMetaObject, error)
- func (repo *Repository) GetLFSMetaObjects(page, pageSize int) ([]*LFSMetaObject, error)
- func (repo *Repository) GetLanguageStats() (LanguageStatList, error)
- func (repo *Repository) GetMilestoneByID(milestoneID int64) (*Milestone, error)
- func (repo *Repository) GetMirror() (err error)
- func (repo *Repository) GetOriginalURLHostname() string
- func (repo *Repository) GetOwner() error
- func (repo *Repository) GetProtectedBranches() ([]*ProtectedBranch, error)
- func (repo *Repository) GetReaders() (_ []*User, err error)
- func (repo *Repository) GetRepoTeams() ([]*Team, error)
- func (repo *Repository) GetReviewerTeams() ([]*Team, error)
- func (repo *Repository) GetReviewers(doerID, posterID int64) ([]*User, error)
- func (repo *Repository) GetStargazers(opts ListOptions) ([]*User, error)
- func (repo *Repository) GetTemplateRepo() (err error)
- func (repo *Repository) GetTopLanguageStats(limit int) (LanguageStatList, error)
- func (repo *Repository) GetTreePathLock(treePath string) (*LFSLock, error)
- func (repo *Repository) GetTrustModel() TrustModelType
- func (repo *Repository) GetUnit(tp UnitType) (*RepoUnit, error)
- func (repo *Repository) GetUserFork(userID int64) (*Repository, error)
- func (repo *Repository) GetWatchers(opts ListOptions) ([]*User, error)
- func (repo *Repository) GetWriters() (_ []*User, err error)
- func (repo *Repository) GitConfigPath() string
- func (repo *Repository) HTMLURL() string
- func (repo *Repository) HasWiki() bool
- func (repo *Repository) IsBeingCreated() bool
- func (repo *Repository) IsBeingMigrated() bool
- func (repo *Repository) IsCollaborator(userID int64) (bool, error)
- func (repo *Repository) IsDependenciesEnabled() bool
- func (repo *Repository) IsGenerated() bool
- func (repo *Repository) IsOwnedBy(userID int64) bool
- func (repo *Repository) IsOwnerMemberCollaborator(userID int64) (bool, error)
- func (repo *Repository) IsProtectedBranch(branchName string, doer *User) (bool, error)
- func (repo *Repository) IsProtectedBranchForPush(branchName string, doer *User) (bool, error)
- func (repo *Repository) IsReader(userID int64) (bool, error)
- func (repo *Repository) IsTimetrackerEnabled() bool
- func (repo *Repository) IssueStats(uid int64, filterMode int, isPull bool) (int64, int64)
- func (repo *Repository) Link() string
- func (repo *Repository) MustGetUnit(tp UnitType) *RepoUnit
- func (repo *Repository) MustOwner() *User
- func (repo *Repository) RecalculateAccesses() error
- func (repo *Repository) RelAvatarLink() string
- func (repo *Repository) RelLink() string
- func (repo *Repository) RemoveDeletedBranch(id int64) (err error)
- func (repo *Repository) RemoveLFSMetaObjectByOid(oid string) (int64, error)
- func (repo *Repository) RepoPath() string
- func (repo *Repository) SanitizedOriginalURL() string
- func (repo *Repository) SetArchiveRepoState(isArchived bool) (err error)
- func (repo *Repository) SignCRUDAction(u *User, tmpBasePath, parentCommit string) (bool, string, *git.Signature, error)
- func (repo *Repository) SignWikiCommit(u *User) (bool, string, *git.Signature, error)
- func (repo *Repository) UnitEnabled(tp UnitType) bool
- func (repo *Repository) UpdateDefaultBranch() error
- func (repo *Repository) UpdateIndexerStatus(indexerType RepoIndexerType, sha string) error
- func (repo *Repository) UpdateLanguageStats(commitID string, stats map[string]int64) error
- func (repo *Repository) UpdateSize(ctx DBContext) error
- func (repo *Repository) UploadAvatar(data []byte) error
- func (repo *Repository) WikiCloneLink() *CloneLink
- func (repo *Repository) WikiPath() string
- type RepositoryList
- func RepositoryListOfMap(repoMap map[int64]*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 RepositoryStatus
- type Review
- func CreateReview(opts CreateReviewOptions) (*Review, error)
- func FindReviews(opts FindReviewOptions) ([]*Review, error)
- func GetCurrentReview(reviewer *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 SMTPConfig
- type SSPIConfig
- type SearchEmailOptions
- type SearchEmailOrderBy
- type SearchEmailResult
- type SearchMembersOptions
- type SearchOrderBy
- type SearchOrganizationsOptions
- type SearchRepoOptions
- type SearchTeamOptions
- type SearchUserOptions
- type SignCommit
- type SignCommitWithStatuses
- type Star
- type Statistic
- type Stopwatch
- type Task
- type Team
- func GetTeam(orgID int64, name string) (*Team, error)
- func GetTeamByID(teamID int64) (*Team, error)
- func GetTeamsWithAccessToRepo(orgID, repoID int64, mode AccessMode) ([]*Team, error)
- func GetUserOrgTeams(orgID, userID int64) ([]*Team, error)
- func GetUserTeams(userID int64, listOptions ListOptions) ([]*Team, error)
- func SearchTeam(opts *SearchTeamOptions) ([]*Team, int64, error)
- func (t *Team) AddAllRepositories() (err error)
- func (t *Team) AddMember(userID int64) error
- func (t *Team) AddRepository(repo *Repository) (err error)
- func (t *Team) ColorFormat(s fmt.State)
- func (t *Team) GetMembers(opts *SearchMembersOptions) (err error)
- func (t *Team) GetRepositories(opts *SearchTeamOptions) error
- func (t *Team) GetUnitNames() (res []string)
- func (t *Team) GetUnits() error
- func (t *Team) HasRepository(repoID int64) bool
- func (t *Team) HasWriteAccess() 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) UnitEnabled(tp UnitType) bool
- type TeamRepo
- type TeamUnit
- type TeamUser
- type Topic
- func AddTopic(repoID int64, topicName string) (*Topic, error)
- func DeleteTopic(repoID int64, topicName string) (*Topic, error)
- func FindTopics(opts *FindTopicOptions) (topics []*Topic, err error)
- func GetRepoTopicByName(repoID int64, topicName string) (*Topic, error)
- func GetTopicByName(name string) (*Topic, error)
- type TrackedTime
- type TrackedTimeList
- type TrustModelType
- type TwoFactor
- type U2FRegistration
- type U2FRegistrationList
- type Unit
- type UnitConfig
- type UnitType
- type UpdateOAuth2ApplicationOptions
- type Upload
- type User
- func ExternalUserLogin(user *User, login, password string, source *LoginSource) (*User, error)
- func GetAssigneesByIssue(issue *Issue) (assignees []*User, err error)
- func GetMaileableUsersByIDs(ids []int64, isMention bool) ([]*User, error)
- func GetOrgByName(name string) (*User, error)
- func GetOrgsByUserID(userID int64, showAll bool) ([]*User, error)
- func GetOrgsCanCreateRepoByUserID(userID int64) ([]*User, error)
- func GetOwnedOrgsByUserID(userID int64) ([]*User, error)
- func GetOwnedOrgsByUserIDDesc(userID int64, desc string) ([]*User, error)
- func GetTeamMembers(teamID int64) ([]*User, error)
- func GetUserByEmail(email string) (*User, error)
- func GetUserByEmailContext(ctx DBContext, email string) (*User, error)
- func GetUserByID(id int64) (*User, error)
- func GetUserByName(name string) (*User, error)
- func GetUserByOpenID(uri string) (*User, error)
- func LoginViaLDAP(user *User, login, password string, source *LoginSource) (*User, error)
- func LoginViaPAM(user *User, login, password string, sourceID int64, cfg *PAMConfig) (*User, error)
- func LoginViaSMTP(user *User, login, password string, sourceID int64, cfg *SMTPConfig) (*User, error)
- func NewGhostUser() *User
- func NewReplaceUser(name string) *User
- func SearchUsers(opts *SearchUserOptions) (users []*User, _ int64, _ error)
- func UserSignIn(username, password string) (*User, error)
- func ValidateCommitWithEmail(c *git.Commit) *User
- func VerifyUserActiveCode(code string) (user *User)
- func (u *User) APIFormat() *api.User
- func (org *User) AccessibleReposEnv(userID int64) (AccessibleReposEnvironment, error)
- func (org *User) AddMember(uid int64) error
- func (u *User) AfterLoad()
- func (u *User) AvatarLink() string
- func (u *User) BeforeUpdate()
- func (org *User) CanCreateOrgRepo(uid int64) (bool, error)
- func (u *User) CanCreateOrganization() bool
- func (u *User) CanCreateRepo() bool
- func (u *User) CanEditGitHook() bool
- func (u *User) CanImportLocal() bool
- func (u *User) ColorFormat(s fmt.State)
- func (u *User) CustomAvatarRelativePath() string
- func (u *User) DashboardLink() string
- func (u *User) DeleteAvatar() error
- func (u *User) DisplayName() string
- func (u *User) EmailNotifications() string
- func (u *User) GenerateActivateCode() string
- func (u *User) GenerateEmailActivateCode(email string) string
- func (u *User) GenerateRandomAvatar() error
- func (u *User) GetAccessRepoIDs(units ...UnitType) ([]int64, error)
- func (user *User) GetAccessibleRepositories(limit int) (repos []*Repository, _ error)
- func (u *User) GetDisplayName() string
- func (u *User) GetEmail() string
- func (u *User) GetFollowers(listOptions ListOptions) ([]*User, error)
- func (u *User) GetFollowing(listOptions ListOptions) ([]*User, error)
- func (org *User) GetMembers() (err error)
- func (u *User) GetMirrorRepositories() ([]*Repository, error)
- func (u *User) GetOrgRepositoryIDs(units ...UnitType) ([]int64, error)
- func (u *User) GetOrganizationCount() (int64, error)
- func (u *User) GetOrganizations(opts *SearchOrganizationsOptions) error
- func (u *User) GetOwnedOrganizations() (err error)
- func (org *User) GetOwnerTeam() (*Team, error)
- func (u *User) GetRepositories(listOpts ListOptions, names ...string) (err error)
- func (user *User) GetRepositoryAccesses() (map[*Repository]AccessMode, error)
- func (u *User) GetRepositoryIDs(units ...UnitType) ([]int64, error)
- func (u *User) GetStarredRepoCount(private bool) (int64, error)
- func (u *User) GetStarredRepos(private bool, page, pageSize int, orderBy string) (repos RepositoryList, err error)
- func (org *User) GetTeam(name string) (*Team, error)
- func (org *User) GetTeams(opts *SearchTeamOptions) error
- func (org *User) GetUserTeamIDs(userID int64) ([]int64, error)
- func (org *User) GetUserTeams(userID int64) ([]*Team, error)
- func (u *User) GitName() string
- func (u *User) HTMLURL() string
- func (u *User) HasForkedRepo(repoID int64) bool
- func (u *User) HasMemberWithUserID(userID int64) bool
- func (u *User) HashPassword(passwd string)
- func (u *User) HomeLink() string
- func (u *User) IsFollowing(followID int64) bool
- func (u *User) IsGhost() bool
- func (u *User) IsLocal() bool
- func (u *User) IsMailable() bool
- func (u *User) IsOAuth2() bool
- func (org *User) IsOrgMember(uid int64) (bool, error)
- func (u *User) IsOrganization() bool
- func (org *User) IsOwnedBy(uid int64) (bool, error)
- func (u *User) IsPasswordSet() bool
- func (u *User) IsPublicMember(orgID int64) bool
- func (u *User) IsUserOrgOwner(orgID int64) bool
- func (u *User) MaxCreationLimit() int
- func (u *User) NewGitSig() *git.Signature
- func (u *User) RealSizedAvatarLink(size int) string
- func (u *User) RelAvatarLink() string
- func (org *User) RemoveMember(uid int64) error
- func (org *User) RemoveOrgRepo(repoID int64) error
- func (u *User) SetEmailNotifications(set string) error
- func (u *User) SetLastLogin()
- func (u *User) ShortName(length int) string
- func (u *User) SizedRelAvatarLink(size int) string
- func (org *User) TeamsWithAccessToRepo(repoID int64, mode AccessMode) ([]*Team, error)
- func (u *User) UpdateDiffViewStyle(style string) error
- func (u *User) UpdateTheme(themeName string) error
- func (u *User) UploadAvatar(data []byte) error
- func (u *User) ValidatePassword(passwd string) bool
- type UserCommit
- type UserHeatmapData
- type UserIDCount
- type UserIssueStatsOptions
- type UserList
- type UserOpenID
- type UserType
- type Watch
- type Webhook
- func GetActiveWebhooksByOrgID(orgID int64) (ws []*Webhook, err error)
- func GetActiveWebhooksByRepoID(repoID int64) ([]*Webhook, error)
- func GetDefaultWebhook(id int64) (*Webhook, error)
- func GetDefaultWebhooks() ([]*Webhook, error)
- func GetSystemWebhook(id int64) (*Webhook, error)
- func GetSystemWebhooks() ([]*Webhook, error)
- func GetWebhookByID(id int64) (*Webhook, error)
- func GetWebhookByOrgID(orgID, id int64) (*Webhook, error)
- func GetWebhookByRepoID(repoID, id int64) (*Webhook, error)
- func GetWebhooksByOrgID(orgID int64, listOptions ListOptions) ([]*Webhook, error)
- func GetWebhooksByRepoID(repoID int64, listOptions ListOptions) ([]*Webhook, error)
- func (w *Webhook) AfterLoad()
- func (w *Webhook) EventCheckers() []struct{ ... }
- func (w *Webhook) EventsArray() []string
- func (w *Webhook) HasCreateEvent() bool
- func (w *Webhook) HasDeleteEvent() bool
- func (w *Webhook) HasForkEvent() bool
- func (w *Webhook) HasIssueCommentEvent() bool
- func (w *Webhook) HasIssuesAssignEvent() bool
- func (w *Webhook) HasIssuesEvent() bool
- func (w *Webhook) HasIssuesLabelEvent() bool
- func (w *Webhook) HasIssuesMilestoneEvent() bool
- func (w *Webhook) HasPullRequestApprovedEvent() bool
- func (w *Webhook) HasPullRequestAssignEvent() bool
- func (w *Webhook) HasPullRequestCommentEvent() bool
- func (w *Webhook) HasPullRequestEvent() bool
- func (w *Webhook) HasPullRequestLabelEvent() bool
- func (w *Webhook) HasPullRequestMilestoneEvent() bool
- func (w *Webhook) HasPullRequestRejectedEvent() bool
- func (w *Webhook) HasPullRequestReviewCommentEvent() bool
- func (w *Webhook) HasPullRequestSyncEvent() bool
- func (w *Webhook) HasPushEvent() bool
- func (w *Webhook) HasReleaseEvent() bool
- func (w *Webhook) HasRepositoryEvent() bool
- func (w *Webhook) History(page int) ([]*HookTask, error)
- func (w *Webhook) UpdateEvent() error
- type WhitelistOptions
- type XORMLogBridge
- func (l *XORMLogBridge) Debug(v ...interface{})
- func (l *XORMLogBridge) Debugf(format string, v ...interface{})
- func (l *XORMLogBridge) Error(v ...interface{})
- func (l *XORMLogBridge) Errorf(format string, v ...interface{})
- func (l *XORMLogBridge) Info(v ...interface{})
- func (l *XORMLogBridge) Infof(format string, v ...interface{})
- func (l *XORMLogBridge) IsShowSQL() bool
- func (l *XORMLogBridge) Level() xormlog.LogLevel
- func (l *XORMLogBridge) Log(skip int, level log.Level, format string, v ...interface{}) error
- func (l *XORMLogBridge) SetLevel(lvl xormlog.LogLevel)
- func (l *XORMLogBridge) ShowSQL(show ...bool)
- func (l *XORMLogBridge) Warn(v ...interface{})
- func (l *XORMLogBridge) Warnf(format string, v ...interface{})
Constants ¶
const ( // BadSignature is used as the reason when the signature has a KeyID that is in the db // but no key that has that ID verifies the signature. This is a suspicious failure. BadSignature = "gpg.error.probable_bad_signature" // BadDefaultSignature is used as the reason when the signature has a KeyID that matches the // default Key but is not verified by the default key. This is a suspicious failure. BadDefaultSignature = "gpg.error.probable_bad_default_signature" // NoKeyFound is used as the reason when no key can be found to verify the signature. NoKeyFound = "gpg.error.no_gpg_keys_found" )
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 )
Filter modes.
const ( // LFSMetaFileIdentifier is the string appearing at the first line of LFS pointer files. // https://github.com/git-lfs/git-lfs/blob/master/docs/spec.md LFSMetaFileIdentifier = "version https://git-lfs.github.com/spec/v1" // LFSMetaFileOidPrefix appears in LFS pointer files on a line before the sha256 hash. LFSMetaFileOidPrefix = "oid sha256:" )
const ( SMTPPlain = "PLAIN" SMTPLogin = "LOGIN" )
SMTP authentication type names.
const ( // KeyTypeUser specifies the user key KeyTypeUser = iota + 1 // KeyTypeDeploy specifies the deploy key KeyTypeDeploy // KeyTypePrincipal specifies the authorized principal key KeyTypePrincipal )
const ( // EmailNotificationsEnabled indicates that the user would like to receive all email notifications EmailNotificationsEnabled = "enabled" // EmailNotificationsOnMention indicates that the user would like to be notified via email when mentioned. EmailNotificationsOnMention = "onmention" // EmailNotificationsDisabled indicates that the user would not like to be notified via email. EmailNotificationsDisabled = "disabled" )
const ( HookStatusNone = iota HookStatusSucceed HookStatusFail )
Possible statuses of a web hook
const NonexistentID = int64(math.MaxInt64)
NonexistentID an ID that will never exist
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 ( // ErrMirrorNotExist mirror does not exist error ErrMirrorNotExist = errors.New("Mirror does not exist") // ErrNameEmpty name is empty error ErrNameEmpty = errors.New("Name is empty") )
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 ( // AllRepoUnitTypes contains all the unit types AllRepoUnitTypes = []UnitType{ UnitTypeCode, UnitTypeIssues, UnitTypePullRequests, UnitTypeReleases, UnitTypeWiki, UnitTypeExternalWiki, UnitTypeExternalTracker, UnitTypeProjects, } // DefaultRepoUnits contains the default unit types DefaultRepoUnits = []UnitType{ UnitTypeCode, UnitTypeIssues, UnitTypePullRequests, UnitTypeReleases, UnitTypeWiki, UnitTypeProjects, } // NotAllowedDefaultRepoUnits contains units that can't be default NotAllowedDefaultRepoUnits = []UnitType{ UnitTypeExternalWiki, UnitTypeExternalTracker, } // MustRepoUnits contains the units could not be disabled currently MustRepoUnits = []UnitType{ UnitTypeCode, UnitTypeReleases, } // DisabledRepoUnits contains the units that have been globally disabled DisabledRepoUnits = []UnitType{} )
var ( UnitCode = Unit{ UnitTypeCode, "repo.code", "/", "repo.code.desc", 0, } UnitIssues = Unit{ UnitTypeIssues, "repo.issues", "/issues", "repo.issues.desc", 1, } UnitExternalTracker = Unit{ UnitTypeExternalTracker, "repo.ext_issues", "/issues", "repo.ext_issues.desc", 1, } UnitPullRequests = Unit{ UnitTypePullRequests, "repo.pulls", "/pulls", "repo.pulls.desc", 2, } UnitReleases = Unit{ UnitTypeReleases, "repo.releases", "/releases", "repo.releases.desc", 3, } UnitWiki = Unit{ UnitTypeWiki, "repo.wiki", "/wiki", "repo.wiki.desc", 4, } UnitExternalWiki = Unit{ UnitTypeExternalWiki, "repo.ext_wiki", "/wiki", "repo.ext_wiki.desc", 4, } UnitProjects = Unit{ UnitTypeProjects, "repo.projects", "/projects", "repo.projects.desc", 5, } // Units contains all the units Units = map[UnitType]Unit{ UnitTypeCode: UnitCode, UnitTypeIssues: UnitIssues, UnitTypeExternalTracker: UnitExternalTracker, UnitTypePullRequests: UnitPullRequests, UnitTypeReleases: UnitReleases, UnitTypeWiki: UnitWiki, UnitTypeExternalWiki: UnitExternalWiki, UnitTypeProjects: UnitProjects, } )
Enumerate all the units
var ( // ErrUserNotKeyOwner user does not own this key error ErrUserNotKeyOwner = errors.New("User does not own this public key") // ErrEmailNotExist e-mail does not exist error ErrEmailNotExist = errors.New("E-mail does not exist") // ErrEmailNotActivated e-mail address has not been activated error ErrEmailNotActivated = errors.New("E-mail address has not been activated") // ErrUserNameIllegal user name contains illegal characters error ErrUserNameIllegal = errors.New("User name contains illegal characters") // ErrLoginSourceNotActived login source is not actived error ErrLoginSourceNotActived = errors.New("Login source is not actived") // ErrUnsupportedLoginType login source is unknown error ErrUnsupportedLoginType = errors.New("Login source is unknown") )
var ( // ErrEmailAddressNotExist email address not exist ErrEmailAddressNotExist = errors.New("Email address does not exist") )
var ( // ErrLFSObjectNotExist is returned from lfs models functions in order // to differentiate between database and missing object errors. ErrLFSObjectNotExist = errors.New("LFS Meta object does not exist") )
var ( // ErrOpenIDNotExist openid is not known ErrOpenIDNotExist = errors.New("OpenID is unknown") )
var ( // HasEngine specifies if we have a xorm.Engine HasEngine bool )
var LabelColorPattern = regexp.MustCompile("^#[0-9a-fA-F]{6}$")
LabelColorPattern is a regexp witch can validate LabelColor
var LoginNames = map[LoginType]string{ LoginLDAP: "LDAP (via BindDN)", LoginDLDAP: "LDAP (simple auth)", LoginSMTP: "SMTP", LoginPAM: "PAM", LoginOAuth2: "OAuth2", LoginSSPI: "SPNEGO with SSPI", }
LoginNames contains the name of LoginType values.
var OAuth2DefaultCustomURLMappings = map[string]*oauth2.CustomURLMapping{ "github": OAuth2Providers["github"].CustomURLMapping, "gitlab": OAuth2Providers["gitlab"].CustomURLMapping, "gitea": OAuth2Providers["gitea"].CustomURLMapping, "nextcloud": OAuth2Providers["nextcloud"].CustomURLMapping, }
OAuth2DefaultCustomURLMappings contains the map of default URL's for OAuth2 providers that are allowed to have custom urls key is used to map the OAuth2Provider value is the mapping as defined for the OAuth2Provider
var OAuth2Providers = map[string]OAuth2Provider{ "bitbucket": {Name: "bitbucket", DisplayName: "Bitbucket", Image: "/img/auth/bitbucket.png"}, "dropbox": {Name: "dropbox", DisplayName: "Dropbox", Image: "/img/auth/dropbox.png"}, "facebook": {Name: "facebook", DisplayName: "Facebook", Image: "/img/auth/facebook.png"}, "github": {Name: "github", DisplayName: "GitHub", Image: "/img/auth/github.png", CustomURLMapping: &oauth2.CustomURLMapping{ TokenURL: oauth2.GetDefaultTokenURL("github"), AuthURL: oauth2.GetDefaultAuthURL("github"), ProfileURL: oauth2.GetDefaultProfileURL("github"), EmailURL: oauth2.GetDefaultEmailURL("github"), }, }, "gitlab": {Name: "gitlab", DisplayName: "GitLab", Image: "/img/auth/gitlab.png", CustomURLMapping: &oauth2.CustomURLMapping{ TokenURL: oauth2.GetDefaultTokenURL("gitlab"), AuthURL: oauth2.GetDefaultAuthURL("gitlab"), ProfileURL: oauth2.GetDefaultProfileURL("gitlab"), }, }, "gplus": {Name: "gplus", DisplayName: "Google", Image: "/img/auth/google.png"}, "openidConnect": {Name: "openidConnect", DisplayName: "OpenID Connect", Image: "/img/auth/openid_connect.svg"}, "twitter": {Name: "twitter", DisplayName: "Twitter", Image: "/img/auth/twitter.png"}, "discord": {Name: "discord", DisplayName: "Discord", Image: "/img/auth/discord.png"}, "gitea": {Name: "gitea", DisplayName: "Gitea", Image: "/img/auth/gitea.png", CustomURLMapping: &oauth2.CustomURLMapping{ TokenURL: oauth2.GetDefaultTokenURL("gitea"), AuthURL: oauth2.GetDefaultAuthURL("gitea"), ProfileURL: oauth2.GetDefaultProfileURL("gitea"), }, }, "nextcloud": {Name: "nextcloud", DisplayName: "Nextcloud", Image: "/img/auth/nextcloud.png", CustomURLMapping: &oauth2.CustomURLMapping{ TokenURL: oauth2.GetDefaultTokenURL("nextcloud"), AuthURL: oauth2.GetDefaultAuthURL("nextcloud"), ProfileURL: oauth2.GetDefaultProfileURL("nextcloud"), }, }, "yandex": {Name: "yandex", DisplayName: "Yandex", Image: "/img/auth/yandex.png"}, }
OAuth2Providers contains the map of registered OAuth2 providers in Gitea (based on goth) key is used to map the OAuth2Provider with the goth provider type (also in LoginSource.OAuth2Config.Provider) value is used to store display data
var SMTPAuths = []string{SMTPPlain, SMTPLogin}
SMTPAuths contains available SMTP authentication type names.
var SecurityProtocolNames = map[ldap.SecurityProtocol]string{ ldap.SecurityProtocolUnencrypted: "Unencrypted", ldap.SecurityProtocolLDAPS: "LDAPS", ldap.SecurityProtocolStartTLS: "StartTLS", }
SecurityProtocolNames contains the name of SecurityProtocol values.
Functions ¶
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
AccessibleRepoIDsQuery queries accessible repository ids. Usable as a subquery wherever repo ids need to be filtered.
func ActivateUserEmail ¶ added in v1.11.2
ActivateUserEmail will change the activated state of an email address, either primary (in the user table) or secondary (in the email_address table)
func AddDeletePRBranchComment ¶ added in v1.1.0
func AddDeletePRBranchComment(doer *User, repo *Repository, issueID int64, branchName string) error
AddDeletePRBranchComment adds delete branch comment for pull request issue
func AddEmailAddress ¶
func AddEmailAddress(email *EmailAddress) error
AddEmailAddress adds an email address to given user.
func AddEmailAddresses ¶
func AddEmailAddresses(emails []*EmailAddress) error
AddEmailAddresses adds an email address to given user.
func AddOrgUser ¶
AddOrgUser adds new user to given organization.
func AddReleaseAttachments ¶ added in v1.10.0
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 AddUserOpenID ¶ added in v1.2.0
func AddUserOpenID(openid *UserOpenID) error
AddUserOpenID adds an pre-verified/normalized OpenID URI to given user.
func AssertCount ¶ added in v1.2.0
AssertCount assert the count of a bean
func AssertExistsAndLoadBean ¶ added in v1.2.0
AssertExistsAndLoadBean assert that a bean exists and load it from the test database
func AssertExistsIf ¶ added in v1.4.0
AssertExistsIf asserts that a bean exists or does not exist, depending on what is expected.
func AssertInt64InRange ¶ added in v1.2.0
AssertInt64InRange assert value is in range [low, high]
func AssertNotExistsBean ¶ added in v1.2.0
AssertNotExistsBean assert that a bean does not exist in the test database
func AssertSuccessfulInsert ¶ added in v1.2.0
AssertSuccessfulInsert assert that beans is successfully inserted
func AttachmentRelativePath ¶ added in v1.13.0
AttachmentRelativePath returns the relative path
func AvatarLink ¶ added in v1.12.0
AvatarLink returns an avatar link for a provided email
func BeanExists ¶ added in v1.2.0
BeanExists for testing, check if a bean exists
func BuildLabelNamesIssueIDsCondition ¶ added in v1.12.0
BuildLabelNamesIssueIDsCondition returns a builder where get issue ids match label names
func CalculateTrustStatus ¶ added in v1.11.2
func CalculateTrustStatus(verification *CommitVerification, repository *Repository, keyMap *map[string]bool) (err error)
CalculateTrustStatus will calculate the TrustStatus for a commit verification within a repository
func CanBeAssigned ¶ added in v1.11.0
func CanBeAssigned(user *User, repo *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
CanMarkConversation Add or remove Conversation mark for a code comment permission check the PR writer , offfcial reviewer and poster can do it
func CancelStopwatch ¶ added in v1.3.0
CancelStopwatch removes the given stopwatch and logs it into issue's timeline.
func Cell2Int64 ¶
Cell2Int64 converts a xorm.Cell type to int64, and handles possible irregular cases.
func ChangeMilestoneAssign ¶
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
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 ChangeRepositoryName ¶
func ChangeRepositoryName(doer *User, repo *Repository, newRepoName string) (err error)
ChangeRepositoryName changes all corresponding setting from old repository name to new one.
func ChangeUserName ¶
ChangeUserName changes all corresponding setting from old user name to new one.
func CheckConsistencyFor ¶ added in v1.2.0
CheckConsistencyFor test that all matching database entries are consistent
func CheckConsistencyForAll ¶ added in v1.2.0
CheckConsistencyForAll test that the entire database is consistent
func CheckCreateRepository ¶ added in v1.10.0
CheckCreateRepository check if could created a repository
func CheckIssueWatch ¶ added in v1.12.0
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(u *User, repo *Repository, mode AccessMode) error
CheckLFSAccessForRepo check needed access mode base on action
func CheckPrincipalKeyString ¶ added in v1.13.0
CheckPrincipalKeyString strips spaces and returns an error if the given principal contains newlines
func CheckPublicKeyString ¶
CheckPublicKeyString checks if the given public key string is recognized by SSH. It returns the actual public key line on success.
func CheckRepoStats ¶
CheckRepoStats checks the repository stats
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 ComposeHTTPSCloneURL ¶
ComposeHTTPSCloneURL returns HTTPS clone URL based on given owner and repository name.
func Cond ¶ added in v1.2.0
func Cond(query interface{}, args ...interface{}) interface{}
Cond create a condition with arguments for a test
func ConvertUtf8ToUtf8mb4 ¶ added in v1.9.0
func ConvertUtf8ToUtf8mb4() error
ConvertUtf8ToUtf8mb4 converts database and tables from utf8 to utf8mb4 if it's mysql and set ROW_FORMAT=dynamic
func CopyLFS ¶ added in v1.11.0
func CopyLFS(ctx DBContext, newRepo, oldRepo *Repository) error
CopyLFS copies LFS data from one repo to another
func CopyLanguageStat ¶ added in v1.12.0
func CopyLanguageStat(originalRepo, destRepo *Repository) error
CopyLanguageStat Copy originalRepo language stat information to destRepo (use for forked repo)
func Count ¶ added in v1.10.0
Count returns records number according struct's fields as database query conditions
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 CountLoginSources ¶
func CountLoginSources() int64
CountLoginSources returns number of login sources.
func CountMilestonesByRepoCond ¶ added in v1.12.0
CountMilestonesByRepoCond map from repo conditions to number of milestones matching the options`
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 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 CountRepoClosedMilestones ¶
CountRepoClosedMilestones returns number of closed milestones in given repository.
func CountRepositories ¶
CountRepositories returns number of repositories. Argument private only takes effect when it is false, set it true to count all repositories.
func CountUnread ¶ added in v1.12.0
CountUnread count unread notifications for a user
func CountUserRepositories ¶
CountUserRepositories returns number of repositories user owns. Argument private only takes effect when it is false, set it true to count all repositories.
func CreateHookTask ¶
CreateHookTask creates a new hook task, it handles conversion from Payload to PayloadContent.
func CreateIssueDependency ¶ added in v1.6.0
CreateIssueDependency creates a new dependency for an issue
func CreateLoginSource ¶
func CreateLoginSource(source *LoginSource) error
CreateLoginSource inserts a LoginSource in the DB if not already existing with the given name.
func CreateNotice ¶
func CreateNotice(tp NoticeType, desc string, args ...interface{}) error
CreateNotice creates new system notice.
func CreateOrStopIssueStopwatch ¶ added in v1.3.0
CreateOrStopIssueStopwatch will create or remove a stopwatch and will log it into issue's timeline.
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 reciver, else send to all watcher
func CreateOrUpdateIssueWatch ¶ added in v1.2.0
CreateOrUpdateIssueWatch set watching for a user and issue
func CreateOrganization ¶
CreateOrganization creates record of a new organization.
func CreateRefComment ¶
func CreateRefComment(doer *User, repo *Repository, issue *Issue, content, commitSHA string) error
CreateRefComment creates a commit reference comment to issue.
func CreateRepository ¶
func CreateRepository(ctx DBContext, doer, u *User, repo *Repository, overwriteOrAdopt bool) (err error)
CreateRepository creates a repository for the user/organization.
func CreateRepositoryNotice ¶
CreateRepositoryNotice creates new system notice with type NoticeRepository.
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 CreateTestEngine ¶ added in v1.2.0
CreateTestEngine creates a memory database and loads the fixture data from fixturesDir
func DeleteAccessTokenByID ¶
DeleteAccessTokenByID deletes access token by given ID.
func DeleteAllRecords ¶ added in v1.11.0
DeleteAllRecords will delete all the records of this table
func DeleteAttachment ¶
func DeleteAttachment(a *Attachment, remove bool) error
DeleteAttachment deletes the given attachment and optionally the associated file.
func DeleteAttachments ¶
func DeleteAttachments(attachments []*Attachment, remove bool) (int, error)
DeleteAttachments deletes the given attachments and optionally the associated files.
func DeleteAttachmentsByComment ¶
DeleteAttachmentsByComment deletes all attachments associated with the given comment.
func DeleteAttachmentsByIssue ¶
DeleteAttachmentsByIssue deletes all attachments associated with the given issue.
func DeleteAttachmentsByRelease ¶ added in v1.10.0
DeleteAttachmentsByRelease deletes all attachments associated with the given release.
func DeleteComment ¶ added in v1.1.0
DeleteComment deletes the comment
func DeleteCommentReaction ¶ added in v1.4.0
DeleteCommentReaction deletes a reaction on comment.
func DeleteDefaultSystemWebhook ¶ added in v1.12.0
DeleteDefaultSystemWebhook deletes an admin-configured default or system webhook (where Org and Repo ID both 0)
func DeleteDeployKey ¶
DeleteDeployKey deletes deploy key from its repository authorized_keys file if needed.
func DeleteEmailAddress ¶
func DeleteEmailAddress(email *EmailAddress) (err error)
DeleteEmailAddress deletes an email address of given user.
func DeleteEmailAddresses ¶
func DeleteEmailAddresses(emails []*EmailAddress) (err error)
DeleteEmailAddresses deletes multiple email addresses
func DeleteGPGKey ¶ added in v1.2.0
DeleteGPGKey deletes GPG key information in database.
func DeleteInactiveUsers ¶ added in v1.12.0
DeleteInactiveUsers deletes all inactive users and email addresses.
func DeleteIssueLabel ¶
DeleteIssueLabel deletes issue-label relation.
func DeleteIssueReaction ¶ added in v1.4.0
DeleteIssueReaction deletes a reaction on issue.
func DeleteIssueUserTimes ¶ added in v1.11.0
DeleteIssueUserTimes deletes times for issue
func DeleteMilestoneByRepoID ¶
DeleteMilestoneByRepoID deletes a milestone from a repository.
func DeleteMirrorByRepoID ¶
DeleteMirrorByRepoID deletes a mirror by repoID
func DeleteNotice ¶
DeleteNotice deletes a system notice by given ID.
func DeleteNotices ¶
DeleteNotices deletes all notices with ID from start to end (inclusive).
func DeleteNoticesByIDs ¶
DeleteNoticesByIDs deletes notices by given IDs.
func DeleteOAuth2Application ¶ added in v1.8.0
DeleteOAuth2Application deletes the application with the given id and the grants and auth codes related to it. It checks if the userid was the creator of the app.
func DeleteOldRepositoryArchives ¶ added in v1.1.0
DeleteOldRepositoryArchives deletes old repository archives.
func DeleteOrganization ¶
DeleteOrganization completely and permanently deletes everything of organization.
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 DeletePublicKey ¶
DeletePublicKey deletes SSH key information both in database and authorized_keys file.
func DeleteReaction ¶ added in v1.4.0
func DeleteReaction(opts *ReactionOptions) error
DeleteReaction deletes reaction for issue or comment.
func DeleteRegistration ¶ added in v1.5.0
func DeleteRegistration(reg *U2FRegistration) error
DeleteRegistration will delete U2FRegistration
func DeleteReleaseByID ¶
DeleteReleaseByID deletes a release from database by given ID.
func DeleteRepository ¶
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 DeleteRepositoryArchives ¶
DeleteRepositoryArchives deletes all repositories' archives.
func DeleteReview ¶ added in v1.12.0
DeleteReview delete a review and it's code comments
func DeleteSource ¶
func DeleteSource(source *LoginSource) error
DeleteSource deletes a LoginSource record in DB.
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 DeleteTwoFactorByID ¶ added in v1.1.0
DeleteTwoFactorByID deletes two-factor authentication token by given ID.
func DeleteUploadByUUID ¶
DeleteUploadByUUID deletes a upload by UUID
func DeleteUploads ¶
DeleteUploads deletes multiple uploads
func DeleteUser ¶
DeleteUser completely and permanently deletes everything of a user, but issues/comments/pulls will be kept and shown as someone has been deleted.
func DeleteUserOpenID ¶ added in v1.2.0
func DeleteUserOpenID(openid *UserOpenID) (err error)
DeleteUserOpenID deletes an openid address of given user.
func DeleteWebhookByOrgID ¶
DeleteWebhookByOrgID deletes webhook of organization by given ID.
func DeleteWebhookByRepoID ¶
DeleteWebhookByRepoID deletes webhook of repository by given ID.
func DoctorUserStarNum ¶ added in v1.12.2
func DoctorUserStarNum() (err error)
DoctorUserStarNum recalculate Stars number for all user
func DumpDatabase ¶
DumpDatabase dumps all data from database according the special database SQL syntax to file system.
func ErrCancelledf ¶ added in v1.12.0
ErrCancelledf returns an ErrCancelled for the provided format and args
func FilterOutRepoIdsWithoutUnitAccess ¶ added in v1.11.0
func FilterOutRepoIdsWithoutUnitAccess(u *User, repoIDs []int64, units ...UnitType) ([]int64, error)
FilterOutRepoIdsWithoutUnitAccess filter out repos where user has no access to repositories
func FindByMaxID ¶ added in v1.11.0
FindByMaxID filled results as the condition from database
func FindRepoRecentCommitStatusContexts ¶ added in v1.10.0
FindRepoRecentCommitStatusContexts returns repository's recent commit status contexts
func FindUserAccessibleRepoIDs ¶ added in v1.5.0
FindUserAccessibleRepoIDs find all accessible repositories' ID by user's id
func FinishMigrateTask ¶ added in v1.10.0
FinishMigrateTask updates database when migrate task finished
func FixNullArchivedRepository ¶ added in v1.12.0
FixNullArchivedRepository sets is_archived to false where it is null
func FollowUser ¶
FollowUser marks someone be another's follower.
func FullPushingEnvironment ¶ added in v1.9.0
func FullPushingEnvironment(author, committer *User, repo *Repository, repoName string, prID int64) []string
FullPushingEnvironment returns an os environment to allow hooks to work on push
func GPGKeyToEntity ¶ added in v1.9.0
GPGKeyToEntity retrieve the imported key and the traducted entity
func GenerateAvatar ¶ added in v1.11.0
func GenerateAvatar(ctx DBContext, templateRepo, generateRepo *Repository) error
GenerateAvatar generates the avatar from a template repository
func GenerateGitHooks ¶ added in v1.11.0
func GenerateGitHooks(ctx DBContext, templateRepo, generateRepo *Repository) error
GenerateGitHooks generates git hooks from a template repository
func GenerateIssueLabels ¶ added in v1.11.0
func GenerateIssueLabels(ctx DBContext, templateRepo, generateRepo *Repository) error
GenerateIssueLabels generates issue labels from a template repository
func GenerateLFSOid ¶ added in v1.8.0
GenerateLFSOid generates a Sha256Sum to represent an oid for arbitrary content
func GenerateTopics ¶ added in v1.11.0
func GenerateTopics(ctx DBContext, templateRepo, generateRepo *Repository) error
GenerateTopics generates topics from a template repository
func GenerateWebhooks ¶ added in v1.11.0
func GenerateWebhooks(ctx DBContext, templateRepo, generateRepo *Repository) error
GenerateWebhooks generates webhooks from a template repository
func GetActiveOAuth2Providers ¶ added in v1.1.0
func GetActiveOAuth2Providers() ([]string, map[string]OAuth2Provider, error)
GetActiveOAuth2Providers returns the map of configured active OAuth2 providers key is used as technical name (like in the callbackURL) values to display
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 GetEmailForHash ¶ added in v1.12.0
GetEmailForHash converts a provided md5sum to the email
func GetExternalLogin ¶ added in v1.1.0
func GetExternalLogin(externalLoginUser *ExternalLoginUser) (bool, error)
GetExternalLogin checks if a externalID in loginSourceID scope already exists
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 GetLabelIDsInOrgsByNames ¶ added in v1.12.0
GetLabelIDsInOrgsByNames returns a list of labelIDs by names in one of the given organization. it silently ignores label names that do not belong to the 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 GetNotificationCount ¶ added in v1.1.0
func GetNotificationCount(user *User, status NotificationStatus) (int64, error)
GetNotificationCount returns the notification count for 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 GetPrivateRepositoryCount ¶ added in v1.1.0
GetPrivateRepositoryCount returns the total number of private repositories of user.
func GetPublicRepositoryCount ¶ added in v1.1.0
GetPublicRepositoryCount returns the total number of public repositories of user.
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 GetRepoIDsForIssuesOptions ¶ added in v1.12.0
func GetRepoIDsForIssuesOptions(opts *IssuesOptions, user *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 ¶
func GetRepoIssueStats(repoID, uid int64, filterMode int, isPull bool) (numOpen int64, numClosed int64)
GetRepoIssueStats returns number of open and closed repository issues by given filter mode.
func GetRepoWatchersIDs ¶ added in v1.11.0
GetRepoWatchersIDs returns IDs of watchers for a given repo ID but avoids joining with `user` for performance reasons User permissions must be verified elsewhere if required
func GetRepositoriesMapByIDs ¶ added in v1.5.0
func GetRepositoriesMapByIDs(ids []int64) (map[int64]*Repository, error)
GetRepositoriesMapByIDs returns the repositories by given id slice.
func GetRepositoryCount ¶
GetRepositoryCount returns the total number of repositories of user.
func GetTeamIDsByNames ¶ added in v1.12.0
GetTeamIDsByNames returns a slice of team ids corresponds to names.
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 GetUnindexedRepos ¶ added in v1.11.0
func GetUnindexedRepos(indexerType RepoIndexerType, maxRepoID int64, page, pageSize int) ([]int64, error)
GetUnindexedRepos returns repos which do not have an indexer status
func GetUserEmailsByNames ¶
GetUserEmailsByNames returns a list of e-mails corresponds to names of users that have their email notifications set to enabled or onmention.
func GetUserIDByExternalUserID ¶ added in v1.10.0
GetUserIDByExternalUserID get user id according to provider and userID
func GetUserIDsByNames ¶
GetUserIDsByNames returns a slice of ids corresponds to names.
func GetUserNamesByIDs ¶ added in v1.12.0
GetUserNamesByIDs returns usernames for all resolved users from a list of Ids.
func GetYamlFixturesAccess ¶ added in v1.12.0
GetYamlFixturesAccess returns a string containing the contents for the access table, as recalculated using repo.RecalculateAccesses()
func GitConfigPath ¶ added in v1.3.1
GitConfigPath returns the path to a repository's git config/ directory
func HasAccess ¶
func HasAccess(userID int64, repo *Repository) (bool, error)
HasAccess returns true if user has access to repo
func HasAccessUnit ¶ added in v1.7.0
func HasAccessUnit(user *User, repo *Repository, unitType UnitType, testMode AccessMode) (bool, error)
HasAccessUnit returns ture if user has testMode to the unit of the repository
func HasDeployKey ¶
HasDeployKey returns true if public key is a deploy key of given repository.
func HasIssueLabel ¶
HasIssueLabel returns true if issue has been labeled.
func HasOrgVisible ¶ added in v1.8.0
HasOrgVisible tells if the given user can see the given org
func HasOrgsVisible ¶ added in v1.8.0
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 IncrementRepoForkNum ¶ added in v1.12.0
IncrementRepoForkNum increment repository fork number
func InitFixtures ¶ added in v1.2.0
InitFixtures initialize test fixtures for a test database
func InitOAuth2 ¶ added in v1.1.0
func InitOAuth2() error
InitOAuth2 initialize the OAuth2 lib and register all active OAuth2 providers in the library
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 InsertMirror ¶ added in v1.11.0
InsertMirror inserts a mirror 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, repo *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 IsContentEmptyErr ¶ added in v1.11.0
IsContentEmptyErr returns true if err is a ContentEmptyErr
func IsEmailUsed ¶
IsEmailUsed returns true if the email has been used.
func IsErrAccessTokenEmpty ¶
IsErrAccessTokenEmpty checks if an error is a ErrAccessTokenEmpty.
func IsErrAccessTokenNotExist ¶
IsErrAccessTokenNotExist checks if an error is a ErrAccessTokenNotExist.
func IsErrAttachmentNotExist ¶
IsErrAttachmentNotExist checks if an error is a ErrAttachmentNotExist.
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 IsErrCancelled ¶ added in v1.12.0
IsErrCancelled checks if an error is a ErrCancelled.
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 IsErrDeployKeyAlreadyExist ¶
IsErrDeployKeyAlreadyExist checks if an error is a ErrDeployKeyAlreadyExist.
func IsErrDeployKeyNameAlreadyUsed ¶
IsErrDeployKeyNameAlreadyUsed checks if an error is a ErrDeployKeyNameAlreadyUsed.
func IsErrDeployKeyNotExist ¶
IsErrDeployKeyNotExist checks if an error is a ErrDeployKeyNotExist.
func IsErrEmailAlreadyUsed ¶
IsErrEmailAlreadyUsed checks if an error is a ErrEmailAlreadyUsed.
func IsErrEmailInvalid ¶ added in v1.13.0
IsErrEmailInvalid checks if an error is an ErrEmailInvalid
func IsErrErrPullRequestHeadRepoMissing ¶ added in v1.9.0
IsErrErrPullRequestHeadRepoMissing checks if an error is a ErrPullRequestHeadRepoMissing.
func IsErrExternalLoginUserAlreadyExist ¶ added in v1.1.0
IsErrExternalLoginUserAlreadyExist checks if an error is a ExternalLoginUserAlreadyExist.
func IsErrExternalLoginUserNotExist ¶ added in v1.1.0
IsErrExternalLoginUserNotExist checks if an error is a ExternalLoginUserNotExist.
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 IsErrGPGKeyAccessDenied ¶ added in v1.2.0
IsErrGPGKeyAccessDenied checks if an error is a ErrGPGKeyAccessDenied.
func IsErrGPGKeyIDAlreadyUsed ¶ added in v1.2.0
IsErrGPGKeyIDAlreadyUsed checks if an error is a ErrKeyNameAlreadyUsed.
func IsErrGPGKeyImportNotExist ¶ added in v1.9.0
IsErrGPGKeyImportNotExist checks if an error is a ErrGPGKeyImportNotExist.
func IsErrGPGKeyNotExist ¶ added in v1.2.0
IsErrGPGKeyNotExist checks if an error is a ErrGPGKeyNotExist.
func IsErrGPGKeyParsing ¶ added in v1.2.0
IsErrGPGKeyParsing checks if an error is a ErrGPGKeyParsing.
func IsErrGPGNoEmailFound ¶ added in v1.2.3
IsErrGPGNoEmailFound checks if an error is a ErrGPGNoEmailFound.
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 IsErrKeyAccessDenied ¶
IsErrKeyAccessDenied checks if an error is a ErrKeyAccessDenied.
func IsErrKeyAlreadyExist ¶
IsErrKeyAlreadyExist checks if an error is a ErrKeyAlreadyExist.
func IsErrKeyNameAlreadyUsed ¶
IsErrKeyNameAlreadyUsed checks if an error is a ErrKeyNameAlreadyUsed.
func IsErrKeyNotExist ¶
IsErrKeyNotExist checks if an error is a ErrKeyNotExist.
func IsErrKeyUnableVerify ¶
IsErrKeyUnableVerify checks if an error is a ErrKeyUnableVerify.
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 IsErrLoginSourceAlreadyExist ¶
IsErrLoginSourceAlreadyExist checks if an error is a ErrLoginSourceAlreadyExist.
func IsErrLoginSourceInUse ¶
IsErrLoginSourceInUse checks if an error is a ErrLoginSourceInUse.
func IsErrLoginSourceNotExist ¶
IsErrLoginSourceNotExist checks if an error is a ErrLoginSourceNotExist.
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 IsErrMigrationNotAllowed ¶ added in v1.13.0
IsErrMigrationNotAllowed checks if an error is a ErrMigrationNotAllowed
func IsErrMilestoneNotExist ¶
IsErrMilestoneNotExist checks if an error is a ErrMilestoneNotExist.
func IsErrNameCharsNotAllowed ¶ added in v1.11.2
IsErrNameCharsNotAllowed checks if an error is an ErrNameCharsNotAllowed.
func IsErrNamePatternNotAllowed ¶
IsErrNamePatternNotAllowed checks if an error is an ErrNamePatternNotAllowed.
func IsErrNameReserved ¶
IsErrNameReserved checks if an error is a ErrNameReserved.
func IsErrNewIssueInsert ¶ added in v1.10.0
IsErrNewIssueInsert checks if an error is a ErrNewIssueInsert.
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 IsErrOAuthApplicationNotFound ¶ added in v1.8.0
IsErrOAuthApplicationNotFound checks if an error is a ErrReviewNotExist.
func IsErrOauthClientIDInvalid ¶ added in v1.8.0
IsErrOauthClientIDInvalid checks if an error is a ErrReviewNotExist.
func IsErrOpenIDAlreadyUsed ¶ added in v1.2.0
IsErrOpenIDAlreadyUsed checks if an error is a ErrOpenIDAlreadyUsed.
func IsErrOpenIDConnectInitialize ¶ added in v1.2.0
IsErrOpenIDConnectInitialize checks if an error is a ExternalLoginUserAlreadyExist.
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 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 IsErrReachLimitOfRepo ¶
IsErrReachLimitOfRepo checks if an error is a ErrReachLimitOfRepo.
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 IsErrRepoAlreadyExist ¶
IsErrRepoAlreadyExist checks if an error is a ErrRepoAlreadyExist.
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 IsErrRepoFilesAlreadyExist ¶ added in v1.13.0
IsErrRepoFilesAlreadyExist checks if an error is a ErrRepoAlreadyExist.
func IsErrRepoLabelNotExist ¶ added in v1.12.0
IsErrRepoLabelNotExist checks if an error is a RepoErrLabelNotExist.
func IsErrRepoNotExist ¶
IsErrRepoNotExist checks if an error is a ErrRepoNotExist.
func IsErrRepoRedirectNotExist ¶ added in v1.1.0
IsErrRepoRedirectNotExist check if an error is an ErrRepoRedirectNotExist.
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 IsErrSSHDisabled ¶ added in v1.4.0
IsErrSSHDisabled checks if an error is a ErrSSHDisabled.
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 IsErrTopicNotExist ¶ added in v1.5.0
IsErrTopicNotExist checks if an error is an ErrTopicNotExist.
func IsErrTrackedTimeNotExist ¶ added in v1.3.0
IsErrTrackedTimeNotExist checks if an error is a ErrTrackedTimeNotExist.
func IsErrTwoFactorNotEnrolled ¶ added in v1.1.0
IsErrTwoFactorNotEnrolled checks if an error is a ErrTwoFactorNotEnrolled.
func IsErrU2FRegistrationNotExist ¶ added in v1.5.0
IsErrU2FRegistrationNotExist checks if an error is a ErrU2FRegistrationNotExist.
func IsErrUnitTypeNotExist ¶ added in v1.9.0
IsErrUnitTypeNotExist checks if an error is a ErrUnitNotExist.
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 IsErrUserAlreadyExist ¶
IsErrUserAlreadyExist checks if an error is a ErrUserAlreadyExists.
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 IsErrUserInactive ¶ added in v1.7.3
IsErrUserInactive checks if an error is a ErrUserInactive
func IsErrUserNotAllowedCreateOrg ¶ added in v1.1.0
IsErrUserNotAllowedCreateOrg checks if an error is an ErrUserNotAllowedCreateOrg.
func IsErrUserNotExist ¶
IsErrUserNotExist checks if an error is a ErrUserNotExist.
func IsErrUserOwnRepos ¶
IsErrUserOwnRepos checks if an error is a ErrUserOwnRepos.
func IsErrUserProhibitLogin ¶ added in v1.7.3
IsErrUserProhibitLogin checks if an error is a ErrUserProhibitLogin
func IsErrWebhookNotExist ¶
IsErrWebhookNotExist checks if an error is a ErrWebhookNotExist.
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 IsErrWontSign ¶ added in v1.12.0
IsErrWontSign checks if an error is a ErrWontSign
func IsFollowing ¶
IsFollowing returns true if user is following followID.
func IsOfficialReviewer ¶ added in v1.11.0
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 IsOpenIDUsed ¶ added in v1.2.0
IsOpenIDUsed returns true if the openid has been used.
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 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 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 IsRepositoryExist ¶
IsRepositoryExist returns true if the repository with given name under user has already existed.
func IsSSPIEnabled ¶ added in v1.11.0
func IsSSPIEnabled() bool
IsSSPIEnabled returns true if there is at least one activated login source of type LoginSSPI
func IsTableNotEmpty ¶ added in v1.11.0
IsTableNotEmpty returns true if table has at least one record
func IsTeamMember ¶
IsTeamMember returns true if given user is a member of team.
func IsUsableRepoName ¶
IsUsableRepoName returns true when repository is usable
func IsUsableTeamName ¶ added in v1.0.0
IsUsableTeamName tests if a name could be as team name
func IsUsableUsername ¶
IsUsableUsername returns an error when a username is reserved
func IsUserAssignedToIssue ¶ added in v1.5.0
IsUserAssignedToIssue returns true when the user is assigned to the issue
func IsUserExist ¶
IsUserExist checks if given user name exist, the user name should be noncased unique. If uid is presented, then check will rule out that one, it is used when update a user name in settings page.
func IsUserInTeams ¶ added in v1.3.0
IsUserInTeams returns if a user in some teams
func IsUserParticipantsOfIssue ¶ added in v1.12.0
IsUserParticipantsOfIssue return true if user is participants of an issue
func IsUserRealRepoAdmin ¶ added in v1.13.0
func IsUserRealRepoAdmin(repo *Repository, user *User) (bool, error)
IsUserRealRepoAdmin check if this user is real repo admin
func IsUserRepoAdmin ¶ added in v1.7.0
func IsUserRepoAdmin(repo *Repository, user *User) (bool, error)
IsUserRepoAdmin return true if user has admin right of a repo
func IsValidHookContentType ¶
IsValidHookContentType returns true if given name is a valid hook content type.
func IsValidHookTaskType ¶
IsValidHookTaskType returns true if given name is a valid hook task type.
func IsWatching ¶
IsWatching checks if user has watched given repository.
func IssueNoDependenciesLeft ¶ added in v1.6.0
IssueNoDependenciesLeft checks if issue can be closed
func Iterate ¶ added in v1.11.5
func Iterate(ctx DBContext, tableBean interface{}, cond builder.Cond, fun func(idx int, bean interface{}) error) error
Iterate iterates the databases and doing something
func IterateAttachment ¶ added in v1.13.0
func IterateAttachment(f func(attach *Attachment) error) error
IterateAttachment iterates attachments; it should not be used when Gitea is servicing users.
func IterateLFS ¶ added in v1.13.0
func IterateLFS(f func(mo *LFSMetaObject) error) error
IterateLFS iterates lfs object
func IterateRepository ¶ added in v1.13.0
func IterateRepository(f func(repo *Repository) error) error
IterateRepository iterate repositories
func IterateUser ¶ added in v1.13.0
IterateUser iterate users
func LFSAutoAssociate ¶ added in v1.11.0
func LFSAutoAssociate(metas []*LFSMetaObject, user *User, repoID int64) error
LFSAutoAssociate auto associates accessible LFSMetaObjects
func LFSObjectAccessible ¶ added in v1.11.0
LFSObjectAccessible checks if a provided Oid is accessible to the user
func LinkExternalToUser ¶ added in v1.10.0
func LinkExternalToUser(user *User, externalLoginUser *ExternalLoginUser) error
LinkExternalToUser link the external user to the user
func LoadFixtures ¶ added in v1.2.0
func LoadFixtures() error
LoadFixtures load fixtures for a test database
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 LookupRepoRedirect ¶ added in v1.1.0
LookupRepoRedirect look up if a repository has a redirect name
func MainTest ¶ added in v1.4.0
MainTest a reusable TestMain(..) function for unit tests that need to use a test database. Creates the test database, and sets necessary settings.
func MakeEmailPrimary ¶
func MakeEmailPrimary(email *EmailAddress) error
MakeEmailPrimary sets primary email address of given user.
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
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 MaxBatchInsertSize ¶ added in v1.9.0
func MaxBatchInsertSize(bean interface{}) int
MaxBatchInsertSize returns the table's max batch insert size
func MirrorsIterate ¶ added in v1.10.0
MirrorsIterate iterates all mirror repositories.
func MoveIssueAcrossProjectBoards ¶ added in v1.13.0
func MoveIssueAcrossProjectBoards(issue *Issue, board *ProjectBoard) error
MoveIssueAcrossProjectBoards move a card from one board to another
func NamesToBean ¶ added in v1.13.0
NamesToBean return a list of beans or an error
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 NewEngine ¶
NewEngine initializes a new xorm.Engine This function must never call .Sync2() if the provided migration function fails. When called from the "doctor" command, the migration function is a version check that prevents the doctor from fixing anything in the database if the migration level is different from the expected value.
func NewIssue ¶
func NewIssue(repo *Repository, issue *Issue, labelIDs []int64, uuids []string) (err error)
NewIssue creates new issue with labels for repository.
func NewIssueLabel ¶
NewIssueLabel creates a new issue-label relation.
func NewIssueLabels ¶
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 *Repository, pull *Issue, labelIDs []int64, uuids []string, pr *PullRequest) (err error)
NewPullRequest creates new pull request with labels for repository.
func NewRepoRedirect ¶ added in v1.1.0
NewRepoRedirect create a new repo redirect
func NewTeam ¶
NewTeam creates a record of new team. It's caller's responsibility to assign organization ID.
func NewTwoFactor ¶ added in v1.1.0
NewTwoFactor creates a new two-factor authentication token.
func NewXORMLogger ¶ added in v1.9.0
NewXORMLogger inits a log bridge for xorm
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 ParseCommitsWithSignature ¶ added in v1.2.0
func ParseCommitsWithSignature(oldCommits *list.List, repository *Repository) *list.List
ParseCommitsWithSignature checks if signaute of commits are corresponding to users gpg keys.
func ParseCommitsWithStatus ¶ added in v1.2.0
func ParseCommitsWithStatus(oldCommits *list.List, repo *Repository) *list.List
ParseCommitsWithStatus checks commits latest statuses and calculates its worst status state
func PrepareTestDatabase ¶ added in v1.2.0
func PrepareTestDatabase() error
PrepareTestDatabase load test fixtures into test database
func PrepareTestEnv ¶ added in v1.4.0
PrepareTestEnv prepares the environment for unit tests. Can only be called by tests that use the above MainTest(..) function.
func PublicSigningKey ¶ added in v1.11.0
PublicSigningKey gets the public signing key within a provided repository directory
func PushUpdateDeleteTag ¶ added in v1.10.0
func PushUpdateDeleteTag(repo *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 DBContext, repo *Repository, tags []string) error
PushUpdateDeleteTagsContext updates a number of delete tags with context
func PushingEnvironment ¶ added in v1.9.0
func PushingEnvironment(doer *User, repo *Repository) []string
PushingEnvironment returns an os environment to allow hooks to work on push
func RegeneratePrincipalKeys ¶ added in v1.13.0
func RegeneratePrincipalKeys(t io.StringWriter) error
RegeneratePrincipalKeys regenerates the authorized_principals file
func RegeneratePublicKeys ¶ added in v1.11.5
func RegeneratePublicKeys(t io.StringWriter) error
RegeneratePublicKeys regenerates the authorized_keys file
func RemoveAccountLink ¶ added in v1.1.0
RemoveAccountLink will remove all external login sources for the given user
func RemoveAllWithNotice ¶
func RemoveAllWithNotice(title, path string)
RemoveAllWithNotice removes all directories in given path and creates a system notice when error occurs.
func RemoveDeletedBranch ¶ added in v1.10.2
RemoveDeletedBranch removes all deleted branches
func RemoveIssueDependency ¶ added in v1.6.0
func RemoveIssueDependency(user *User, issue *Issue, dep *Issue, depType DependencyType) (err error)
RemoveIssueDependency removes a dependency from an issue
func RemoveOldDeletedBranches ¶ added in v1.3.0
RemoveOldDeletedBranches removes old deleted branches
func RemoveOrgUser ¶
RemoveOrgUser removes user from given organization.
func RemoveRandomAvatars ¶ added in v1.9.0
RemoveRandomAvatars removes the randomly generated avatars that were created for repositories
func RemoveStorageWithNotice ¶ added in v1.13.0
func RemoveStorageWithNotice(bucket storage.ObjectStorage, title, path string)
RemoveStorageWithNotice removes a file from the storage and creates a system notice when error occurs.
func RemoveTeamMember ¶
RemoveTeamMember removes member from given team of given organization.
func RemoveTemporaryPath ¶ added in v1.9.0
RemoveTemporaryPath removes the temporary path
func ResetOAuth2 ¶ added in v1.13.1
func ResetOAuth2() error
ResetOAuth2 clears existing OAuth2 providers and loads them from DB
func ReviewExists ¶ added in v1.11.0
ReviewExists returns whether a review exists for a particular line of code in the PR
func RevokeOAuth2Grant ¶ added in v1.9.0
RevokeOAuth2Grant deletes the grant with grantID and userID
func RewriteAllPrincipalKeys ¶ added in v1.13.0
func RewriteAllPrincipalKeys() error
RewriteAllPrincipalKeys removes any authorized principal and rewrite all keys from database again. Note: x.Iterate does not get latest data after insert/delete, so we have to call this function outside any session scope independently.
func RewriteAllPublicKeys ¶
func RewriteAllPublicKeys() error
RewriteAllPublicKeys removes any authorized key and rewrite all keys from database again. Note: x.Iterate does not get latest data after insert/delete, so we have to call this function outside any session scope independently.
func SMTPAuth ¶
func SMTPAuth(a smtp.Auth, cfg *SMTPConfig) error
SMTPAuth performs an SMTP authentication.
func SSHKeyGenParsePublicKey ¶
SSHKeyGenParsePublicKey extracts key type and length using ssh-keygen.
func SSHNativeParsePublicKey ¶
SSHNativeParsePublicKey extracts the key type and length using the golang SSH library.
func SanitizeAndValidateTopics ¶ added in v1.10.0
SanitizeAndValidateTopics sanitizes and checks an array or topics
func SaveOrUpdateTag ¶ added in v1.12.0
func SaveOrUpdateTag(repo *Repository, newRel *Release) error
SaveOrUpdateTag must be called for any push actions to add tag
func SaveTopics ¶ added in v1.5.0
SaveTopics save topics to a repository
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 SecToTime ¶ added in v1.5.0
SecToTime converts an amount of seconds to a human-readable string (example: 66s -> 1min 6s)
func SetNotificationStatus ¶ added in v1.1.0
func SetNotificationStatus(notificationID int64, user *User, status NotificationStatus) error
SetNotificationStatus change the notification status
func SignInitialCommit ¶ added in v1.11.0
SignInitialCommit determines if we should sign the initial commit to this repository
func SigningKey ¶ added in v1.13.0
SigningKey returns the KeyID and git Signature for the repo
func SortReleases ¶
func SortReleases(rels []*Release)
SortReleases sorts releases by number of commits and created time.
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, issue *Issue, reviewType ReviewType, content, commitID string, stale bool) (*Review, *Comment, error)
SubmitReview creates a review out of the existing pending review or creates a new one if no pending review exist
func SyncExternalUsers ¶ added in v1.2.0
SyncExternalUsers is used to synchronize users with external authorization source
func ToggleUserOpenIDVisibility ¶ added in v1.2.0
ToggleUserOpenIDVisibility toggles visibility of an openid address of given user.
func TotalTimes ¶ added in v1.3.0
func TotalTimes(options FindTrackedTimesOptions) (map[*User]string, error)
TotalTimes returns the spent time for each user by an issue
func TransferOwnership ¶
func TransferOwnership(doer *User, newOwnerName string, repo *Repository) (err error)
TransferOwnership transfers all corresponding setting from old user to new one.
func TxDBContext ¶ added in v1.10.0
TxDBContext represents a transaction DBContext
func UnfollowUser ¶
UnfollowUser unmarks someone as another's follower.
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 UpdateAttachment ¶ added in v1.5.0
func UpdateAttachment(atta *Attachment) error
UpdateAttachment updates the given attachment in database
func UpdateComment ¶
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 UpdateDeployKey ¶
UpdateDeployKey updates deploy key information.
func UpdateDeployKeyCols ¶ added in v1.4.0
UpdateDeployKeyCols updates deploy key information in the specified columns.
func UpdateExternalUser ¶ added in v1.10.0
UpdateExternalUser updates external user's information
func UpdateHookTask ¶
UpdateHookTask updates information of hook task.
func UpdateIssueDeadline ¶ added in v1.5.0
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 structs.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, currentStatus NotificationStatus, 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 the title of a project board
func UpdateProtectBranch ¶ added in v1.3.0
func UpdateProtectBranch(repo *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 UpdatePublicKeyUpdated ¶ added in v1.2.0
UpdatePublicKeyUpdated updates public key use time.
func UpdateReactionsMigrationsByType ¶ added in v1.12.0
func UpdateReactionsMigrationsByType(gitServiceType structs.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 UpdateRepository ¶
func UpdateRepository(repo *Repository, visibilityChanged bool) (err error)
UpdateRepository updates a repository
func UpdateRepositoryCols ¶ added in v1.10.2
func UpdateRepositoryCols(repo *Repository, cols ...string) error
UpdateRepositoryCols updates repository's columns
func UpdateRepositoryCtx ¶ added in v1.12.0
func UpdateRepositoryCtx(ctx DBContext, repo *Repository, visibilityChanged bool) error
UpdateRepositoryCtx updates a repository with db context
func UpdateRepositoryUnits ¶ added in v1.1.0
func UpdateRepositoryUnits(repo *Repository, units []RepoUnit, deleteUnitTypes []UnitType) (err error)
UpdateRepositoryUnits updates a repository's units
func UpdateRepositoryUpdatedTime ¶ added in v1.10.0
UpdateRepositoryUpdatedTime updates a repository's updated time
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 UpdateSource ¶
func UpdateSource(source *LoginSource) error
UpdateSource updates a LoginSource record in DB.
func UpdateTeam ¶
UpdateTeam updates information of team.
func UpdateTeamUnits ¶ added in v1.5.0
UpdateTeamUnits updates a teams's units
func UpdateTwoFactor ¶ added in v1.1.0
UpdateTwoFactor updates a two-factor authentication token.
func UpdateUserCols ¶ added in v1.2.0
UpdateUserCols update user according special columns
func UpdateUserSetting ¶ added in v1.1.0
UpdateUserSetting updates user's settings.
func UpdateWebhook ¶
UpdateWebhook updates information of webhook.
func UpdateWebhookLastStatus ¶ added in v1.3.0
UpdateWebhookLastStatus updates last status of webhook.
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
func ValidateCommitsWithEmails ¶
ValidateCommitsWithEmails checks if authors' e-mails of commits are corresponding to users.
func ValidateEmail ¶ added in v1.13.0
ValidateEmail check if email is a allowed address
func ValidateTopic ¶ added in v1.5.0
ValidateTopic checks a topic by length and match pattern rules
func WatchIfAuto ¶ added in v1.11.0
WatchIfAuto subscribes to repo if AutoWatchOnChanges is set
func WatchRepoMode ¶ added in v1.11.0
func WatchRepoMode(userID, repoID int64, mode RepoWatchMode) (err error)
WatchRepoMode watch repository in specific mode.
func WithContext ¶ added in v1.10.0
WithContext represents executing database operations
Types ¶
type Access ¶
type Access struct { ID int64 `xorm:"pk autoincr"` UserID int64 `xorm:"UNIQUE(s)"` RepoID int64 `xorm:"UNIQUE(s)"` Mode 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 AccessMode ¶
type AccessMode int
AccessMode specifies the users access mode
const ( // AccessModeNone no access AccessModeNone AccessMode = iota // 0 // AccessModeRead read access AccessModeRead // 1 // AccessModeWrite write access AccessModeWrite // 2 // AccessModeAdmin admin access AccessModeAdmin // 3 // AccessModeOwner owner access AccessModeOwner // 4 )
func AccessLevel ¶
func AccessLevel(user *User, repo *Repository) (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, repo *Repository, unitType UnitType) (AccessMode, error)
AccessLevelUnit returns the Access a user has to a repository's. Will return NoneAccess if the user does not have access.
func ParseAccessMode ¶
func ParseAccessMode(permission string) AccessMode
ParseAccessMode returns corresponding access mode to given permission string.
func (AccessMode) ColorFormat ¶ added in v1.9.0
func (mode AccessMode) ColorFormat(s fmt.State)
ColorFormat provides a ColorFormatted version of this AccessMode
func (AccessMode) String ¶
func (mode AccessMode) String() string
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) ([]*Repository, error) MirrorRepos() ([]*Repository, error) AddKeyword(keyword string) SetSort(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 `xorm:"-"` RepoID int64 `xorm:"INDEX"` Repo *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) GetActAvatar ¶ added in v1.2.0
GetActAvatar the action's user's avatar link
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) 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) 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() ([]*Repository, error)
LoadRepositories loads actions' all repositories
func (ActionList) LoadUsers ¶ added in v1.4.0
func (actions ActionList) LoadUsers() ([]*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 )
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 *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 *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 Attachment ¶
type Attachment struct { ID int64 `xorm:"pk autoincr"` UUID string `xorm:"uuid UNIQUE"` IssueID int64 `xorm:"INDEX"` ReleaseID int64 `xorm:"INDEX"` UploaderID int64 `xorm:"INDEX DEFAULT 0"` // Notice: will be zero before this column added CommentID int64 Name string DownloadCount int64 `xorm:"DEFAULT 0"` Size int64 `xorm:"DEFAULT 0"` CreatedUnix timeutil.TimeStamp `xorm:"created"` }
Attachment represent a attachment of issue/comment/release.
func GetAttachmentByID ¶ added in v1.5.0
func GetAttachmentByID(id int64) (*Attachment, error)
GetAttachmentByID returns attachment by given id
func GetAttachmentByReleaseIDFileName ¶ added in v1.8.0
func GetAttachmentByReleaseIDFileName(releaseID int64, fileName string) (*Attachment, error)
GetAttachmentByReleaseIDFileName returns attachment by given releaseId and fileName.
func GetAttachmentByUUID ¶
func GetAttachmentByUUID(uuid string) (*Attachment, error)
GetAttachmentByUUID returns attachment by given UUID.
func GetAttachmentsByCommentID ¶
func GetAttachmentsByCommentID(commentID int64) ([]*Attachment, error)
GetAttachmentsByCommentID returns all attachments if comment by given ID.
func GetAttachmentsByIssueID ¶
func GetAttachmentsByIssueID(issueID int64) ([]*Attachment, error)
GetAttachmentsByIssueID returns all attachments of an issue.
func GetAttachmentsByUUIDs ¶ added in v1.11.0
func GetAttachmentsByUUIDs(uuids []string) ([]*Attachment, error)
GetAttachmentsByUUIDs returns attachment by given UUID list.
func NewAttachment ¶
func NewAttachment(attach *Attachment, buf []byte, file io.Reader) (_ *Attachment, err error)
NewAttachment creates a new attachment object.
func (*Attachment) APIFormat ¶ added in v1.5.0
func (a *Attachment) APIFormat() *api.Attachment
APIFormat converts models.Attachment to api.Attachment
func (*Attachment) DownloadURL ¶ added in v1.5.0
func (a *Attachment) DownloadURL() string
DownloadURL returns the download url of the attached file
func (*Attachment) IncreaseDownloadCount ¶ added in v1.2.0
func (a *Attachment) IncreaseDownloadCount() error
IncreaseDownloadCount is update download count + 1
func (*Attachment) LinkedRepository ¶ added in v1.11.0
func (a *Attachment) LinkedRepository() (*Repository, UnitType, error)
LinkedRepository returns the linked repo if any
func (*Attachment) RelativePath ¶ added in v1.13.0
func (a *Attachment) RelativePath() string
RelativePath returns the relative path of the attachment
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) (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 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 Collaboration *Collaboration }
Collaborator represents a user with collaboration details.
type Comment ¶
type Comment struct { ID int64 `xorm:"pk autoincr"` Type CommentType `xorm:"INDEX"` PosterID int64 `xorm:"INDEX"` Poster *User `xorm:"-"` OriginalAuthor string OriginalAuthorID int64 IssueID int64 `xorm:"INDEX"` Issue *Issue `xorm:"-"` LabelID int64 Label *Label `xorm:"-"` OldProjectID int64 ProjectID int64 OldProject *Project `xorm:"-"` Project *Project `xorm:"-"` OldMilestoneID int64 MilestoneID int64 OldMilestone *Milestone `xorm:"-"` Milestone *Milestone `xorm:"-"` AssigneeID int64 RemovedAssignee bool Assignee *User `xorm:"-"` AssigneeTeamID int64 `xorm:"NOT NULL DEFAULT 0"` AssigneeTeam *Team `xorm:"-"` ResolveDoerID int64 ResolveDoer *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:"TEXT"` RenderedContent string `xorm:"-"` // Path represents the 4 lines of code cemented by this comment Patch string `xorm:"-"` PatchQuoted string `xorm:"TEXT patch"` CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"` UpdatedUnix timeutil.TimeStamp `xorm:"INDEX updated"` // Reference issue in commit message CommitSHA string `xorm:"VARCHAR(40)"` Attachments []*Attachment `xorm:"-"` Reactions ReactionList `xorm:"-"` // For view issue page. ShowTag CommentTag `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 hapens if RefIssueID resolves RefIsPull bool RefRepo *Repository `xorm:"-"` RefIssue *Issue `xorm:"-"` RefComment *Comment `xorm:"-"` Commits *list.List `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
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, pr *PullRequest, oldCommitID, newCommitID string) (comment *Comment, err error)
CreatePushPullComment create push code to pull base commend
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
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) (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
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
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 *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) 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 CommentTag ¶
type CommentTag int
CommentTag defines comment tag type
const ( CommentTagNone CommentTag = iota CommentTagPoster CommentTagWriter CommentTagOwner )
Enumerate all the comment tag types
type CommentType ¶
type CommentType int
CommentType defines whether a comment is just a simple comment, an action (like close) or a reference.
const ( // Plain comment, can be associated with a commit (CommitID > 0) and a line (LineNum > 0) CommentTypeComment CommentType = iota CommentTypeReopen CommentTypeClose // References. CommentTypeIssueRef // Reference from a commit (not part of a pull request) CommentTypeCommitRef // Reference from a comment CommentTypeCommentRef // Reference from a pull request CommentTypePullRef // Labels changed CommentTypeLabel // Milestone changed CommentTypeMilestone // Assignees changed CommentTypeAssignees // Change Title CommentTypeChangeTitle // Delete Branch CommentTypeDeleteBranch // Start a stopwatch for time tracking CommentTypeStartTracking // Stop a stopwatch for time tracking CommentTypeStopTracking // Add time manual for time tracking CommentTypeAddTimeManual // Cancel a stopwatch for time tracking CommentTypeCancelTracking // Added a due date CommentTypeAddedDeadline // Modified the due date CommentTypeModifiedDeadline // Removed a due date CommentTypeRemovedDeadline // Dependency added CommentTypeAddDependency //Dependency removed CommentTypeRemoveDependency // Comment a line of code CommentTypeCode // Reviews a pull request by giving general feedback CommentTypeReview // Lock an issue, giving only collaborators access CommentTypeLock // Unlocks a previously locked issue CommentTypeUnlock // Change pull request's target branch CommentTypeChangeTargetBranch // Delete time manual for time tracking CommentTypeDeleteTimeManual // add or remove Request from one CommentTypeReviewRequest // merge pull request CommentTypeMergePull // push to PR head branch CommentTypePullPush // Project changed CommentTypeProject // Project board changed CommentTypeProjectBoard )
Enumerate all the comment types
const (
CommentTypeUnknown CommentType = -1
)
define unknown comment type
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 *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 `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 *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(repo *Repository, sha string, page int) ([]*CommitStatus, error)
GetLatestCommitStatus returns all statuses with a unique context for a given commit.
func (*CommitStatus) APIFormat ¶ added in v1.2.0
func (status *CommitStatus) APIFormat() *api.Status
APIFormat assumes some fields assigned with values: Required - Repo, Creator
func (*CommitStatus) APIURL ¶ added in v1.2.0
func (status *CommitStatus) APIURL() string
APIURL returns the absolute APIURL to this commit-status.
type CommitStatusOptions ¶ added in v1.10.0
type CommitStatusOptions struct { ListOptions State string SortType string }
CommitStatusOptions holds the options for query commit statuses
type CommitVerification ¶ added in v1.2.0
type CommitVerification struct { Verified bool Warning bool Reason string SigningUser *User CommittingUser *User SigningEmail string SigningKey *GPGKey TrustStatus string }
CommitVerification represents a commit validation of signature
func ParseCommitWithSignature ¶ added in v1.2.0
func ParseCommitWithSignature(c *git.Commit) *CommitVerification
ParseCommitWithSignature check if signature is good against keystore.
type Committer ¶ added in v1.10.0
Committer represents an interface to Commit or Close the dbcontext
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 Repo *Repository Issue *Issue Label *Label DependentIssueID int64 OldMilestoneID int64 MilestoneID int64 OldProjectID int64 ProjectID 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 CreateOAuth2ApplicationOptions ¶ added in v1.8.0
CreateOAuth2ApplicationOptions holds options to create an oauth2 application
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 RepositoryStatus TrustModel TrustModelType }
CreateRepoOptions contains the create repository options
type CreateReviewOptions ¶ added in v1.6.0
type CreateReviewOptions struct { Content string Type ReviewType Issue *Issue Reviewer *User ReviewerTeam *Team Official bool CommitID string Stale bool }
CreateReviewOptions represent the options to create a review. Type, Issue and Reviewer are required.
type DBContext ¶ added in v1.10.0
type DBContext struct {
// contains filtered or unexported fields
}
DBContext represents a db context
func DefaultDBContext ¶ added in v1.10.0
func DefaultDBContext() DBContext
DefaultDBContext represents a DBContext with default Engine
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 `xorm:"-"` DeletedUnix timeutil.TimeStamp `xorm:"INDEX created"` }
DeletedBranch struct
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 NewGhostUser
type DependencyInfo ¶ added in v1.11.0
type DependencyInfo struct { Issue `xorm:"extends"` 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 DeployKey ¶
type DeployKey struct { ID int64 `xorm:"pk autoincr"` KeyID int64 `xorm:"UNIQUE(s) INDEX"` RepoID int64 `xorm:"UNIQUE(s) INDEX"` Name string Fingerprint string Content string `xorm:"-"` Mode AccessMode `xorm:"NOT NULL DEFAULT 1"` CreatedUnix timeutil.TimeStamp `xorm:"created"` UpdatedUnix timeutil.TimeStamp `xorm:"updated"` HasRecentActivity bool `xorm:"-"` HasUsed bool `xorm:"-"` }
DeployKey represents deploy key information and its relation with repository.
func AddDeployKey ¶
AddDeployKey add new deploy key to database and authorized_keys file.
func GetDeployKeyByID ¶
GetDeployKeyByID returns deploy key by given ID.
func GetDeployKeyByRepo ¶
GetDeployKeyByRepo returns deploy key by given public key ID and repository ID.
func ListDeployKeys ¶
func ListDeployKeys(repoID int64, listOptions ListOptions) ([]*DeployKey, error)
ListDeployKeys returns all deploy keys by given repository ID.
func SearchDeployKeys ¶ added in v1.7.0
SearchDeployKeys returns a list of deploy keys matching the provided arguments.
func (*DeployKey) AfterLoad ¶ added in v1.3.0
func (key *DeployKey) AfterLoad()
AfterLoad is invoked from XORM after setting the values of all fields of this object.
func (*DeployKey) GetContent ¶
GetContent gets associated public key content.
func (*DeployKey) IsReadOnly ¶ added in v1.4.0
IsReadOnly checks if the key can only be used for read operations
type EmailAddress ¶
type EmailAddress struct { ID int64 `xorm:"pk autoincr"` UID int64 `xorm:"INDEX NOT NULL"` Email string `xorm:"UNIQUE NOT NULL"` IsActivated bool IsPrimary bool `xorm:"-"` }
EmailAddress is the list of all email addresses of a user. Can contain the primary email address, but is not obligatory.
func GetEmailAddressByID ¶ added in v1.11.2
func GetEmailAddressByID(uid, id int64) (*EmailAddress, error)
GetEmailAddressByID gets a user's email address by ID
func GetEmailAddresses ¶
func GetEmailAddresses(uid int64) ([]*EmailAddress, error)
GetEmailAddresses returns all email addresses belongs to given user.
func VerifyActiveEmailCode ¶
func VerifyActiveEmailCode(code, email string) *EmailAddress
VerifyActiveEmailCode verifies active email code when active account
func (*EmailAddress) Activate ¶
func (email *EmailAddress) Activate() error
Activate activates the email address to given user.
type Engine ¶
type Engine interface { Table(tableNameOrBean interface{}) *xorm.Session Count(...interface{}) (int64, error) Decr(column string, arg ...interface{}) *xorm.Session Delete(interface{}) (int64, error) Exec(...interface{}) (sql.Result, error) Find(interface{}, ...interface{}) error Get(interface{}) (bool, error) ID(interface{}) *xorm.Session In(string, ...interface{}) *xorm.Session Incr(column string, arg ...interface{}) *xorm.Session Insert(...interface{}) (int64, error) InsertOne(interface{}) (int64, error) Iterate(interface{}, xorm.IterFunc) error Join(joinOperator string, tablename interface{}, condition string, args ...interface{}) *xorm.Session SQL(interface{}, ...interface{}) *xorm.Session Where(interface{}, ...interface{}) *xorm.Session Asc(colNames ...string) *xorm.Session Desc(colNames ...string) *xorm.Session Limit(limit int, start ...int) *xorm.Session SumInt(bean interface{}, columnName string) (res int64, err error) }
Engine represents a xorm engine or session.
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 ErrAttachmentNotExist ¶
ErrAttachmentNotExist represents a "AttachmentNotExist" kind of error.
func (ErrAttachmentNotExist) Error ¶
func (err ErrAttachmentNotExist) 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 ErrCancelled ¶ added in v1.12.0
type ErrCancelled struct {
Message string
}
ErrCancelled represents an error due to context cancellation
func (ErrCancelled) Error ¶ added in v1.12.0
func (err ErrCancelled) 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 ErrDeployKeyAlreadyExist ¶
ErrDeployKeyAlreadyExist represents a "DeployKeyAlreadyExist" kind of error.
func (ErrDeployKeyAlreadyExist) Error ¶
func (err ErrDeployKeyAlreadyExist) Error() string
type ErrDeployKeyNameAlreadyUsed ¶
ErrDeployKeyNameAlreadyUsed represents a "DeployKeyNameAlreadyUsed" kind of error.
func (ErrDeployKeyNameAlreadyUsed) Error ¶
func (err ErrDeployKeyNameAlreadyUsed) Error() string
type ErrDeployKeyNotExist ¶
ErrDeployKeyNotExist represents a "DeployKeyNotExist" kind of error.
func (ErrDeployKeyNotExist) Error ¶
func (err ErrDeployKeyNotExist) Error() string
type ErrEmailAlreadyUsed ¶
type ErrEmailAlreadyUsed struct {
Email string
}
ErrEmailAlreadyUsed represents a "EmailAlreadyUsed" kind of error.
func (ErrEmailAlreadyUsed) Error ¶
func (err ErrEmailAlreadyUsed) Error() string
type ErrEmailInvalid ¶ added in v1.13.0
type ErrEmailInvalid struct {
Email string
}
ErrEmailInvalid represents an error where the email address does not comply with RFC 5322
func (ErrEmailInvalid) Error ¶ added in v1.13.0
func (err ErrEmailInvalid) Error() string
type ErrExternalLoginUserAlreadyExist ¶ added in v1.1.0
ErrExternalLoginUserAlreadyExist represents a "ExternalLoginUserAlreadyExist" kind of error.
func (ErrExternalLoginUserAlreadyExist) Error ¶ added in v1.1.0
func (err ErrExternalLoginUserAlreadyExist) Error() string
type ErrExternalLoginUserNotExist ¶ added in v1.1.0
ErrExternalLoginUserNotExist represents a "ExternalLoginUserNotExist" kind of error.
func (ErrExternalLoginUserNotExist) Error ¶ added in v1.1.0
func (err ErrExternalLoginUserNotExist) 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 ErrGPGKeyAccessDenied ¶ added in v1.2.0
ErrGPGKeyAccessDenied represents a "GPGKeyAccessDenied" kind of Error.
func (ErrGPGKeyAccessDenied) Error ¶ added in v1.2.0
func (err ErrGPGKeyAccessDenied) Error() string
Error pretty-prints an error of type ErrGPGKeyAccessDenied.
type ErrGPGKeyIDAlreadyUsed ¶ added in v1.2.0
type ErrGPGKeyIDAlreadyUsed struct {
KeyID string
}
ErrGPGKeyIDAlreadyUsed represents a "GPGKeyIDAlreadyUsed" kind of error.
func (ErrGPGKeyIDAlreadyUsed) Error ¶ added in v1.2.0
func (err ErrGPGKeyIDAlreadyUsed) Error() string
type ErrGPGKeyImportNotExist ¶ added in v1.9.0
type ErrGPGKeyImportNotExist struct {
ID string
}
ErrGPGKeyImportNotExist represents a "GPGKeyImportNotExist" kind of error.
func (ErrGPGKeyImportNotExist) Error ¶ added in v1.9.0
func (err ErrGPGKeyImportNotExist) Error() string
type ErrGPGKeyNotExist ¶ added in v1.2.0
type ErrGPGKeyNotExist struct {
ID int64
}
ErrGPGKeyNotExist represents a "GPGKeyNotExist" kind of error.
func (ErrGPGKeyNotExist) Error ¶ added in v1.2.0
func (err ErrGPGKeyNotExist) Error() string
type ErrGPGKeyParsing ¶ added in v1.2.0
type ErrGPGKeyParsing struct {
ParseError error
}
ErrGPGKeyParsing represents a "ErrGPGKeyParsing" kind of error.
func (ErrGPGKeyParsing) Error ¶ added in v1.2.0
func (err ErrGPGKeyParsing) Error() string
type ErrGPGNoEmailFound ¶ added in v1.2.3
type ErrGPGNoEmailFound struct {
FailedEmails []string
}
ErrGPGNoEmailFound represents a "ErrGPGNoEmailFound" kind of error.
func (ErrGPGNoEmailFound) Error ¶ added in v1.2.3
func (err ErrGPGNoEmailFound) Error() string
type ErrInvalidCloneAddr ¶
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 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 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 ErrKeyAccessDenied ¶
ErrKeyAccessDenied represents a "KeyAccessDenied" kind of error.
func (ErrKeyAccessDenied) Error ¶
func (err ErrKeyAccessDenied) Error() string
type ErrKeyAlreadyExist ¶
ErrKeyAlreadyExist represents a "KeyAlreadyExist" kind of error.
func (ErrKeyAlreadyExist) Error ¶
func (err ErrKeyAlreadyExist) Error() string
type ErrKeyNameAlreadyUsed ¶
ErrKeyNameAlreadyUsed represents a "KeyNameAlreadyUsed" kind of error.
func (ErrKeyNameAlreadyUsed) Error ¶
func (err ErrKeyNameAlreadyUsed) Error() string
type ErrKeyNotExist ¶
type ErrKeyNotExist struct {
ID int64
}
ErrKeyNotExist represents a "KeyNotExist" kind of error.
func (ErrKeyNotExist) Error ¶
func (err ErrKeyNotExist) Error() string
type ErrKeyUnableVerify ¶
type ErrKeyUnableVerify struct {
Result string
}
ErrKeyUnableVerify represents a "KeyUnableVerify" kind of error.
func (ErrKeyUnableVerify) Error ¶
func (err ErrKeyUnableVerify) 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 ErrLoginSourceAlreadyExist ¶
type ErrLoginSourceAlreadyExist struct {
Name string
}
ErrLoginSourceAlreadyExist represents a "LoginSourceAlreadyExist" kind of error.
func (ErrLoginSourceAlreadyExist) Error ¶
func (err ErrLoginSourceAlreadyExist) Error() string
type ErrLoginSourceInUse ¶
type ErrLoginSourceInUse struct {
ID int64
}
ErrLoginSourceInUse represents a "LoginSourceInUse" kind of error.
func (ErrLoginSourceInUse) Error ¶
func (err ErrLoginSourceInUse) Error() string
type ErrLoginSourceNotExist ¶
type ErrLoginSourceNotExist struct {
ID int64
}
ErrLoginSourceNotExist represents a "LoginSourceNotExist" kind of error.
func (ErrLoginSourceNotExist) Error ¶
func (err ErrLoginSourceNotExist) Error() string
type ErrMergeConflicts ¶ added in v1.11.0
type ErrMergeConflicts struct { Style 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 ErrMigrationNotAllowed ¶ added in v1.13.0
ErrMigrationNotAllowed explains why a migration from an url is not allowed
func (*ErrMigrationNotAllowed) Error ¶ added in v1.13.0
func (e *ErrMigrationNotAllowed) Error() string
type ErrMilestoneNotExist ¶
ErrMilestoneNotExist represents a "MilestoneNotExist" kind of error.
func (ErrMilestoneNotExist) Error ¶
func (err ErrMilestoneNotExist) Error() string
type ErrNameCharsNotAllowed ¶ added in v1.11.2
type ErrNameCharsNotAllowed struct {
Name string
}
ErrNameCharsNotAllowed represents a "character not allowed in name" error.
func (ErrNameCharsNotAllowed) Error ¶ added in v1.11.2
func (err ErrNameCharsNotAllowed) Error() string
type ErrNamePatternNotAllowed ¶
type ErrNamePatternNotAllowed struct {
Pattern string
}
ErrNamePatternNotAllowed represents a "pattern not allowed" error.
func (ErrNamePatternNotAllowed) Error ¶
func (err ErrNamePatternNotAllowed) Error() string
type ErrNameReserved ¶
type ErrNameReserved struct {
Name string
}
ErrNameReserved represents a "reserved name" error.
func (ErrNameReserved) Error ¶
func (err ErrNameReserved) 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 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 ErrOAuthApplicationNotFound ¶ added in v1.8.0
type ErrOAuthApplicationNotFound struct {
ID int64
}
ErrOAuthApplicationNotFound will be thrown if id cannot be found
func (ErrOAuthApplicationNotFound) Error ¶ added in v1.8.0
func (err ErrOAuthApplicationNotFound) Error() string
Error returns the error message
type ErrOAuthClientIDInvalid ¶ added in v1.8.0
type ErrOAuthClientIDInvalid struct {
ClientID string
}
ErrOAuthClientIDInvalid will be thrown if client id cannot be found
func (ErrOAuthClientIDInvalid) Error ¶ added in v1.8.0
func (err ErrOAuthClientIDInvalid) Error() string
Error returns the error message
type ErrOpenIDAlreadyUsed ¶ added in v1.2.0
type ErrOpenIDAlreadyUsed struct {
OpenID string
}
ErrOpenIDAlreadyUsed represents a "OpenIDAlreadyUsed" kind of error.
func (ErrOpenIDAlreadyUsed) Error ¶ added in v1.2.0
func (err ErrOpenIDAlreadyUsed) Error() string
type ErrOpenIDConnectInitialize ¶ added in v1.2.0
type ErrOpenIDConnectInitialize struct { OpenIDConnectAutoDiscoveryURL string ProviderName string Cause error }
ErrOpenIDConnectInitialize represents a "OpenIDConnectInitialize" kind of error.
func (ErrOpenIDConnectInitialize) Error ¶ added in v1.2.0
func (err ErrOpenIDConnectInitialize) 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 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 ErrReachLimitOfRepo ¶
type ErrReachLimitOfRepo struct {
Limit int
}
ErrReachLimitOfRepo represents a "ReachLimitOfRepo" kind of error.
func (ErrReachLimitOfRepo) Error ¶
func (err ErrReachLimitOfRepo) 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 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 ErrRepoAlreadyExist ¶
ErrRepoAlreadyExist represents a "RepoAlreadyExist" kind of error.
func (ErrRepoAlreadyExist) Error ¶
func (err ErrRepoAlreadyExist) 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 ErrRepoFilesAlreadyExist ¶ added in v1.13.0
ErrRepoFilesAlreadyExist represents a "RepoFilesAlreadyExist" kind of error.
func (ErrRepoFilesAlreadyExist) Error ¶ added in v1.13.0
func (err ErrRepoFilesAlreadyExist) 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 ErrRepoNotExist ¶
ErrRepoNotExist represents a "RepoNotExist" kind of error.
func (ErrRepoNotExist) Error ¶
func (err ErrRepoNotExist) Error() string
type ErrRepoRedirectNotExist ¶ added in v1.1.0
ErrRepoRedirectNotExist represents a "RepoRedirectNotExist" kind of error.
func (ErrRepoRedirectNotExist) Error ¶ added in v1.1.0
func (err ErrRepoRedirectNotExist) 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 ErrSSHDisabled ¶ added in v1.4.0
type ErrSSHDisabled struct { }
ErrSSHDisabled represents an "SSH disabled" error.
func (ErrSSHDisabled) Error ¶ added in v1.4.0
func (err ErrSSHDisabled) 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 ErrTopicNotExist ¶ added in v1.5.0
type ErrTopicNotExist struct {
Name string
}
ErrTopicNotExist represents an error that a topic is not exist
func (ErrTopicNotExist) Error ¶ added in v1.5.0
func (err ErrTopicNotExist) Error() string
Error implements error interface
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 ErrTwoFactorNotEnrolled ¶ added in v1.1.0
type ErrTwoFactorNotEnrolled struct {
UID int64
}
ErrTwoFactorNotEnrolled indicates that a user is not enrolled in two-factor authentication.
func (ErrTwoFactorNotEnrolled) Error ¶ added in v1.1.0
func (err ErrTwoFactorNotEnrolled) Error() string
type ErrU2FRegistrationNotExist ¶ added in v1.5.0
type ErrU2FRegistrationNotExist struct {
ID int64
}
ErrU2FRegistrationNotExist represents a "ErrU2FRegistrationNotExist" kind of error.
func (ErrU2FRegistrationNotExist) Error ¶ added in v1.5.0
func (err ErrU2FRegistrationNotExist) Error() string
type ErrUnitTypeNotExist ¶ added in v1.9.0
type ErrUnitTypeNotExist struct {
UT UnitType
}
ErrUnitTypeNotExist represents a "UnitTypeNotExist" kind of error.
func (ErrUnitTypeNotExist) Error ¶ added in v1.9.0
func (err ErrUnitTypeNotExist) 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 ErrUserAlreadyExist ¶
type ErrUserAlreadyExist struct {
Name string
}
ErrUserAlreadyExist represents a "user already exists" error.
func (ErrUserAlreadyExist) Error ¶
func (err ErrUserAlreadyExist) 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 ErrUserInactive ¶ added in v1.7.3
ErrUserInactive represents a "ErrUserInactive" kind of error.
func (ErrUserInactive) Error ¶ added in v1.7.3
func (err ErrUserInactive) 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 ErrUserNotExist ¶
ErrUserNotExist represents a "UserNotExist" kind of error.
func (ErrUserNotExist) Error ¶
func (err ErrUserNotExist) 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 ErrUserProhibitLogin ¶ added in v1.7.3
ErrUserProhibitLogin represents a "ErrUserProhibitLogin" kind of error.
func (ErrUserProhibitLogin) Error ¶ added in v1.7.3
func (err ErrUserProhibitLogin) Error() string
type ErrWebhookNotExist ¶
type ErrWebhookNotExist struct {
ID int64
}
ErrWebhookNotExist represents a "WebhookNotExist" kind of error.
func (ErrWebhookNotExist) Error ¶
func (err ErrWebhookNotExist) 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 ErrWontSign ¶ added in v1.12.0
type ErrWontSign struct {
Reason signingMode
}
ErrWontSign explains the first reason why a commit would not be signed There may be other reasons - this is just the first reason found
func (*ErrWontSign) Error ¶ added in v1.12.0
func (e *ErrWontSign) Error() string
type ExternalLoginUser ¶ added in v1.1.0
type ExternalLoginUser struct { ExternalID string `xorm:"pk NOT NULL"` UserID int64 `xorm:"INDEX NOT NULL"` LoginSourceID int64 `xorm:"pk NOT NULL"` RawData map[string]interface{} `xorm:"TEXT JSON"` Provider string `xorm:"index VARCHAR(25)"` Email string Name string FirstName string LastName string NickName string Description string AvatarURL string Location string AccessToken string `xorm:"TEXT"` AccessTokenSecret string `xorm:"TEXT"` RefreshToken string `xorm:"TEXT"` ExpiresAt time.Time }
ExternalLoginUser makes the connecting between some existing user and additional external login sources
func FindExternalUsersByProvider ¶ added in v1.10.0
func FindExternalUsersByProvider(opts FindExternalUserOptions) ([]ExternalLoginUser, error)
FindExternalUsersByProvider represents external users via provider
func ListAccountLinks ¶ added in v1.1.0
func ListAccountLinks(user *User) ([]*ExternalLoginUser, error)
ListAccountLinks returns a map with the ExternalLoginUser and its LoginSource
type ExternalTrackerConfig ¶ added in v1.1.0
type ExternalTrackerConfig struct { ExternalTrackerURL string ExternalTrackerFormat string ExternalTrackerStyle string }
ExternalTrackerConfig describes external tracker config
func (*ExternalTrackerConfig) FromDB ¶ added in v1.1.0
func (cfg *ExternalTrackerConfig) FromDB(bs []byte) error
FromDB fills up a ExternalTrackerConfig from serialized format.
func (*ExternalTrackerConfig) ToDB ¶ added in v1.1.0
func (cfg *ExternalTrackerConfig) ToDB() ([]byte, error)
ToDB exports a ExternalTrackerConfig to a serialized format.
type ExternalWikiConfig ¶ added in v1.1.0
type ExternalWikiConfig struct {
ExternalWikiURL string
}
ExternalWikiConfig describes external wiki config
func (*ExternalWikiConfig) FromDB ¶ added in v1.1.0
func (cfg *ExternalWikiConfig) FromDB(bs []byte) error
FromDB fills up a ExternalWikiConfig from serialized format.
func (*ExternalWikiConfig) ToDB ¶ added in v1.1.0
func (cfg *ExternalWikiConfig) ToDB() ([]byte, error)
ToDB exports a ExternalWikiConfig to a serialized format.
type FindCommentsOptions ¶ added in v1.2.0
type FindCommentsOptions struct { 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 FindExternalUserOptions ¶ added in v1.10.0
FindExternalUserOptions represents an options to find external users
type FindNotificationOptions ¶ added in v1.12.0
type FindNotificationOptions struct { ListOptions UserID int64 RepoID int64 IssueID int64 Status []NotificationStatus 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 { ListOptions OrgID int64 PublicOnly bool }
FindOrgMembersOpts represensts find org members condtions
type FindReactionsOptions ¶ added in v1.4.0
type FindReactionsOptions struct { 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 { ListOptions IncludeDrafts bool IncludeTags bool TagNames []string }
FindReleasesOptions describes the conditions to Find releases
type FindReviewOptions ¶ added in v1.6.0
type FindReviewOptions struct { 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 FindTopicOptions ¶ added in v1.5.0
type FindTopicOptions struct { ListOptions RepoID int64 Keyword string }
FindTopicOptions represents the options when fdin topics
type FindTrackedTimesOptions ¶ added in v1.3.0
type FindTrackedTimesOptions struct { 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.
func (*FindTrackedTimesOptions) ToCond ¶ added in v1.3.0
func (opts *FindTrackedTimesOptions) ToCond() builder.Cond
ToCond will convert each condition into a xorm-Cond
func (*FindTrackedTimesOptions) ToSession ¶ added in v1.5.0
func (opts *FindTrackedTimesOptions) ToSession(e Engine) Engine
ToSession will convert the given options to a xorm Session by using the conditions from ToCond and joining with issue table if required
type Follow ¶
type Follow struct { ID int64 `xorm:"pk autoincr"` UserID int64 `xorm:"UNIQUE(follow)"` FollowID int64 `xorm:"UNIQUE(follow)"` CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"` }
Follow represents relations of user and his/her followers.
type GPGKey ¶ added in v1.2.0
type GPGKey struct { ID int64 `xorm:"pk autoincr"` OwnerID int64 `xorm:"INDEX NOT NULL"` KeyID string `xorm:"INDEX CHAR(16) NOT NULL"` PrimaryKeyID string `xorm:"CHAR(16)"` Content string `xorm:"TEXT NOT NULL"` CreatedUnix timeutil.TimeStamp `xorm:"created"` ExpiredUnix timeutil.TimeStamp AddedUnix timeutil.TimeStamp SubsKey []*GPGKey `xorm:"-"` Emails []*EmailAddress CanSign bool CanEncryptComms bool CanEncryptStorage bool CanCertify bool }
GPGKey represents a GPG key.
func GetGPGKeyByID ¶ added in v1.2.0
GetGPGKeyByID returns public key by given ID.
func GetGPGKeysByKeyID ¶ added in v1.11.0
GetGPGKeysByKeyID returns public key by given ID.
func ListGPGKeys ¶ added in v1.2.0
func ListGPGKeys(uid int64, listOptions ListOptions) ([]*GPGKey, error)
ListGPGKeys returns a list of public keys belongs to given user.
func (*GPGKey) AfterLoad ¶ added in v1.3.0
AfterLoad is invoked from XORM after setting the values of all fields of this object.
func (*GPGKey) BeforeInsert ¶ added in v1.2.0
func (key *GPGKey) BeforeInsert()
BeforeInsert will be invoked by XORM before inserting a record
type GPGKeyImport ¶ added in v1.9.0
type GPGKeyImport struct { KeyID string `xorm:"pk CHAR(16) NOT NULL"` Content string `xorm:"TEXT NOT NULL"` }
GPGKeyImport the original import of key
func GetGPGImportByKeyID ¶ added in v1.9.0
func GetGPGImportByKeyID(keyID string) (*GPGKeyImport, error)
GetGPGImportByKeyID returns the import public armored key by given KeyID.
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 // the user we want activity for Actor *User // the user viewing the activity IncludePrivate bool // include private actions OnlyPerformedBy bool // only actions performed by requested user IncludeDeleted bool // include deleted actions }
GetFeedsOptions options for retrieving feeds
type GetMilestonesOption ¶ added in v1.13.0
type GetMilestonesOption struct { ListOptions RepoID int64 State api.StateType Name string SortType string }
GetMilestonesOption contain options to get milestones
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 HookContentType ¶
type HookContentType int
HookContentType is the content type of a web hook
const ( // ContentTypeJSON is a JSON payload for web hooks ContentTypeJSON HookContentType = iota + 1 // ContentTypeForm is an url-encoded form payload for web hook ContentTypeForm )
func ToHookContentType ¶
func ToHookContentType(name string) HookContentType
ToHookContentType returns HookContentType by given name.
func (HookContentType) Name ¶
func (t HookContentType) Name() string
Name returns the name of a given web hook's content type
type HookEvent ¶
type HookEvent struct { PushOnly bool `json:"push_only"` SendEverything bool `json:"send_everything"` ChooseEvents bool `json:"choose_events"` BranchFilter string `json:"branch_filter"` HookEvents `json:"events"` }
HookEvent represents events that will delivery hook.
type HookEventType ¶
type HookEventType string
HookEventType is the type of an hook event
const ( HookEventCreate HookEventType = "create" HookEventDelete HookEventType = "delete" HookEventFork HookEventType = "fork" HookEventPush HookEventType = "push" HookEventIssues HookEventType = "issues" HookEventIssueAssign HookEventType = "issue_assign" HookEventIssueLabel HookEventType = "issue_label" HookEventIssueMilestone HookEventType = "issue_milestone" HookEventIssueComment HookEventType = "issue_comment" HookEventPullRequest HookEventType = "pull_request" HookEventPullRequestAssign HookEventType = "pull_request_assign" HookEventPullRequestLabel HookEventType = "pull_request_label" HookEventPullRequestMilestone HookEventType = "pull_request_milestone" HookEventPullRequestComment HookEventType = "pull_request_comment" HookEventPullRequestReviewApproved HookEventType = "pull_request_review_approved" HookEventPullRequestReviewRejected HookEventType = "pull_request_review_rejected" HookEventPullRequestReviewComment HookEventType = "pull_request_review_comment" HookEventPullRequestSync HookEventType = "pull_request_sync" HookEventRepository HookEventType = "repository" HookEventRelease HookEventType = "release" )
Types of hook events
func (HookEventType) Event ¶ added in v1.12.0
func (h HookEventType) Event() string
Event returns the HookEventType as an event string
type HookEvents ¶
type HookEvents struct { Create bool `json:"create"` Delete bool `json:"delete"` Fork bool `json:"fork"` Issues bool `json:"issues"` IssueAssign bool `json:"issue_assign"` IssueLabel bool `json:"issue_label"` IssueMilestone bool `json:"issue_milestone"` IssueComment bool `json:"issue_comment"` Push bool `json:"push"` PullRequest bool `json:"pull_request"` PullRequestAssign bool `json:"pull_request_assign"` PullRequestLabel bool `json:"pull_request_label"` PullRequestMilestone bool `json:"pull_request_milestone"` PullRequestComment bool `json:"pull_request_comment"` PullRequestReview bool `json:"pull_request_review"` PullRequestSync bool `json:"pull_request_sync"` Repository bool `json:"repository"` Release bool `json:"release"` }
HookEvents is a set of web hook events
type HookRequest ¶
HookRequest represents hook task request information.
type HookResponse ¶
type HookResponse struct { Status int `json:"status"` Headers map[string]string `json:"headers"` Body string `json:"body"` }
HookResponse represents hook task response information.
type HookTask ¶
type HookTask struct { ID int64 `xorm:"pk autoincr"` RepoID int64 `xorm:"INDEX"` HookID int64 UUID string Type HookTaskType URL string `xorm:"TEXT"` Signature string `xorm:"TEXT"` api.Payloader `xorm:"-"` PayloadContent string `xorm:"TEXT"` HTTPMethod string `xorm:"http_method"` ContentType HookContentType EventType HookEventType IsSSL bool IsDelivered bool Delivered int64 DeliveredString string `xorm:"-"` // History info. IsSucceed bool RequestContent string `xorm:"TEXT"` RequestInfo *HookRequest `xorm:"-"` ResponseContent string `xorm:"TEXT"` ResponseInfo *HookResponse `xorm:"-"` }
HookTask represents a hook task.
func FindRepoUndeliveredHookTasks ¶ added in v1.11.0
FindRepoUndeliveredHookTasks represents find the undelivered hook tasks of one repository
func FindUndeliveredHookTasks ¶ added in v1.11.0
FindUndeliveredHookTasks represents find the undelivered hook tasks
func (*HookTask) AfterLoad ¶ added in v1.3.0
func (t *HookTask) AfterLoad()
AfterLoad updates the webhook object upon setting a column
func (*HookTask) BeforeUpdate ¶
func (t *HookTask) BeforeUpdate()
BeforeUpdate will be invoked by XORM before updating a record representing this object
type HookTaskType ¶
type HookTaskType int
HookTaskType is the type of an hook task
const ( GOGS HookTaskType = iota + 1 SLACK GITEA DISCORD DINGTALK TELEGRAM MSTEAMS FEISHU MATRIX )
Types of hook tasks
func ToHookTaskType ¶
func ToHookTaskType(name string) HookTaskType
ToHookTaskType returns HookTaskType by given name.
func (HookTaskType) Name ¶
func (t HookTaskType) Name() string
Name returns the name of an hook task type
type Issue ¶
type Issue struct { ID int64 `xorm:"pk autoincr"` RepoID int64 `xorm:"INDEX UNIQUE(repo_index)"` Repo *Repository `xorm:"-"` Index int64 `xorm:"UNIQUE(repo_index)"` // Index in one repository. PosterID int64 `xorm:"INDEX"` Poster *User `xorm:"-"` OriginalAuthor string OriginalAuthorID int64 `xorm:"index"` Title string `xorm:"name"` Content string `xorm:"TEXT"` RenderedContent string `xorm:"-"` Labels []*Label `xorm:"-"` MilestoneID int64 `xorm:"INDEX"` Milestone *Milestone `xorm:"-"` Project *Project `xorm:"-"` Priority int AssigneeID int64 `xorm:"-"` Assignee *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 []*Attachment `xorm:"-"` Comments []*Comment `xorm:"-"` Reactions ReactionList `xorm:"-"` TotalTrackedTime int64 `xorm:"-"` Assignees []*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. ShowTag CommentTag `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 ¶
ChangeContent changes issue content, as the given user.
func (*Issue) ChangeRef ¶ added in v1.13.0
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 ¶
ChangeTitle changes the title of this issue, as the given user.
func (*Issue) ClearLabels ¶
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 DBContext, doer *User, content string) (mentions []*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 ¶
ReplaceLabels removes all current labels and add new labels to the issue. Triggers appropriate WebHooks, if any.
func (*Issue) ReplyReference ¶ added in v1.10.0
ReplyReference returns tokenized address to use for email reply headers
func (*Issue) ResolveMentionsByVisibility ¶ added in v1.9.5
func (issue *Issue) ResolveMentionsByVisibility(ctx DBContext, doer *User, mentions []string) (users []*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, 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 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 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) LoadRepositories ¶ added in v1.1.0
func (issues IssueList) LoadRepositories() ([]*Repository, error)
LoadRepositories loads issues' all repositories
type IssueLockOptions ¶ added in v1.8.0
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
}
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 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 ListOptions) (IssueWatchList, error)
GetIssueWatchers returns watchers/unwatchers of a given issue
type IssuesConfig ¶ added in v1.3.0
type IssuesConfig struct { EnableTimetracker bool AllowOnlyContributorsToTrackTime bool EnableDependencies bool }
IssuesConfig describes issues config
func (*IssuesConfig) FromDB ¶ added in v1.3.0
func (cfg *IssuesConfig) FromDB(bs []byte) error
FromDB fills up a IssuesConfig from serialized format.
func (*IssuesConfig) ToDB ¶ added in v1.3.0
func (cfg *IssuesConfig) ToDB() ([]byte, error)
ToDB exports a IssuesConfig to a serialized format.
type IssuesOptions ¶
type IssuesOptions struct { ListOptions RepoIDs []int64 // include all repos if empty AssigneeID int64 PosterID int64 MentionedID int64 MilestoneIDs []int64 ProjectID int64 ProjectBoardID int64 IsClosed util.OptionalBool IsPull util.OptionalBool LabelIDs []int64 IncludedLabelNames []string ExcludedLabelNames []string SortType string IssueIDs []int64 // prioritize issues from this repo PriorityRepoID int64 }
IssuesOptions represents options of an issue.
type LDAPConfig ¶
LDAPConfig holds configuration for LDAP login source.
func (*LDAPConfig) FromDB ¶
func (cfg *LDAPConfig) FromDB(bs []byte) error
FromDB fills up a LDAPConfig from serialized format.
func (*LDAPConfig) SecurityProtocolName ¶
func (cfg *LDAPConfig) SecurityProtocolName() string
SecurityProtocolName returns the name of configured security protocol.
func (*LDAPConfig) ToDB ¶
func (cfg *LDAPConfig) ToDB() ([]byte, error)
ToDB exports a LDAPConfig to a serialized format.
type LFSLock ¶ added in v1.4.0
type LFSLock struct { ID int64 `xorm:"pk autoincr"` Repo *Repository `xorm:"-"` RepoID int64 `xorm:"INDEX NOT NULL"` Owner *User `xorm:"-"` 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
CreateLFSLock creates a new lock.
func DeleteLFSLockByID ¶ added in v1.4.0
DeleteLFSLockByID deletes a lock by given ID.
func GetLFSLock ¶ added in v1.4.0
func GetLFSLock(repo *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 (*LFSLock) AfterLoad ¶ added in v1.4.0
AfterLoad is invoked from XORM after setting the values of all fields of this object.
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"` Oid string `xorm:"UNIQUE(s) INDEX NOT NULL"` Size int64 `xorm:"NOT NULL"` RepositoryID int64 `xorm:"UNIQUE(s) INDEX NOT NULL"` Existing bool `xorm:"-"` CreatedUnix timeutil.TimeStamp `xorm:"created"` }
LFSMetaObject stores metadata for LFS tracked files.
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.
func (*LFSMetaObject) Pointer ¶ added in v1.8.0
func (m *LFSMetaObject) Pointer() string
Pointer returns the string representation of an LFS pointer file
func (*LFSMetaObject) RelativePath ¶ added in v1.13.0
func (m *LFSMetaObject) RelativePath() string
RelativePath returns the relative path of the lfs object
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
func GetLabelsByOrgID(orgID int64, sortType string, listOptions ListOptions) ([]*Label, error)
GetLabelsByOrgID returns all labels that belong to given organization by ID.
func GetLabelsByRepoID ¶
func GetLabelsByRepoID(repoID int64, sortType string, listOptions ListOptions) ([]*Label, error)
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 LanguageStat ¶ added in v1.12.0
type LanguageStat struct { ID int64 `xorm:"pk autoincr"` RepoID int64 `xorm:"UNIQUE(s) INDEX NOT NULL"` CommitID string IsPrimary bool Language string `xorm:"VARCHAR(50) UNIQUE(s) INDEX NOT NULL"` Percentage float32 `xorm:"-"` Size int64 `xorm:"NOT NULL DEFAULT 0"` Color string `xorm:"-"` CreatedUnix timeutil.TimeStamp `xorm:"INDEX CREATED"` }
LanguageStat describes language statistics of a repository
type LanguageStatList ¶ added in v1.12.0
type LanguageStatList []*LanguageStat
LanguageStatList defines a list of language statistics
type ListAccessTokensOptions ¶ added in v1.13.0
type ListAccessTokensOptions struct { ListOptions Name string UserID int64 }
ListAccessTokensOptions contain filter options
type ListOptions ¶ added in v1.12.0
ListOptions options to paginate results
func (*ListOptions) GetStartEnd ¶ added in v1.13.0
func (opts *ListOptions) GetStartEnd() (start, end int)
GetStartEnd returns the start and end of the ListOptions
type LoginSource ¶
type LoginSource struct { ID int64 `xorm:"pk autoincr"` Type LoginType Name string `xorm:"UNIQUE"` IsActived bool `xorm:"INDEX NOT NULL DEFAULT false"` IsSyncEnabled bool `xorm:"INDEX NOT NULL DEFAULT false"` Cfg convert.Conversion `xorm:"TEXT"` CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"` UpdatedUnix timeutil.TimeStamp `xorm:"INDEX updated"` }
LoginSource represents an external way for authorizing users.
func ActiveLoginSources ¶ added in v1.11.0
func ActiveLoginSources(loginType LoginType) ([]*LoginSource, error)
ActiveLoginSources returns all active sources of the specified type
func GetActiveOAuth2LoginSourceByName ¶ added in v1.1.0
func GetActiveOAuth2LoginSourceByName(name string) (*LoginSource, error)
GetActiveOAuth2LoginSourceByName returns a OAuth2 LoginSource based on the given name
func GetActiveOAuth2ProviderLoginSources ¶ added in v1.1.0
func GetActiveOAuth2ProviderLoginSources() ([]*LoginSource, error)
GetActiveOAuth2ProviderLoginSources returns all actived LoginOAuth2 sources
func GetLoginSourceByID ¶
func GetLoginSourceByID(id int64) (*LoginSource, error)
GetLoginSourceByID returns login source by given ID.
func LoginSources ¶
func LoginSources() ([]*LoginSource, error)
LoginSources returns a slice of all login sources found in DB.
func LoginSourcesByType ¶ added in v1.11.0
func LoginSourcesByType(loginType LoginType) ([]*LoginSource, error)
LoginSourcesByType returns all sources of the specified type
func (*LoginSource) BeforeSet ¶
func (source *LoginSource) BeforeSet(colName string, val xorm.Cell)
BeforeSet is invoked from XORM before setting the value of a field of this object.
func (*LoginSource) HasTLS ¶
func (source *LoginSource) HasTLS() bool
HasTLS returns true of this source supports TLS.
func (*LoginSource) IsDLDAP ¶
func (source *LoginSource) IsDLDAP() bool
IsDLDAP returns true of this source is of the DLDAP type.
func (*LoginSource) IsLDAP ¶
func (source *LoginSource) IsLDAP() bool
IsLDAP returns true of this source is of the LDAP type.
func (*LoginSource) IsOAuth2 ¶ added in v1.1.0
func (source *LoginSource) IsOAuth2() bool
IsOAuth2 returns true of this source is of the OAuth2 type.
func (*LoginSource) IsPAM ¶
func (source *LoginSource) IsPAM() bool
IsPAM returns true of this source is of the PAM type.
func (*LoginSource) IsSMTP ¶
func (source *LoginSource) IsSMTP() bool
IsSMTP returns true of this source is of the SMTP type.
func (*LoginSource) IsSSPI ¶ added in v1.11.0
func (source *LoginSource) IsSSPI() bool
IsSSPI returns true of this source is of the SSPI type.
func (*LoginSource) LDAP ¶
func (source *LoginSource) LDAP() *LDAPConfig
LDAP returns LDAPConfig for this source, if of LDAP type.
func (*LoginSource) OAuth2 ¶ added in v1.1.0
func (source *LoginSource) OAuth2() *OAuth2Config
OAuth2 returns OAuth2Config for this source, if of OAuth2 type.
func (*LoginSource) PAM ¶
func (source *LoginSource) PAM() *PAMConfig
PAM returns PAMConfig for this source, if of PAM type.
func (*LoginSource) SMTP ¶
func (source *LoginSource) SMTP() *SMTPConfig
SMTP returns SMTPConfig for this source, if of SMTP type.
func (*LoginSource) SSPI ¶ added in v1.11.0
func (source *LoginSource) SSPI() *SSPIConfig
SSPI returns SSPIConfig for this source, if of SSPI type.
func (*LoginSource) SkipVerify ¶
func (source *LoginSource) SkipVerify() bool
SkipVerify returns true if this source is configured to skip SSL verification.
func (*LoginSource) TypeName ¶
func (source *LoginSource) TypeName() string
TypeName return name of this login source type.
func (*LoginSource) UseTLS ¶
func (source *LoginSource) UseTLS() bool
UseTLS returns true of this source is configured to use TLS.
type MergeStyle ¶ added in v1.4.0
type MergeStyle string
MergeStyle represents the approach to merge commits into base branch.
const ( // MergeStyleMerge create merge commit MergeStyleMerge MergeStyle = "merge" // MergeStyleRebase rebase before merging MergeStyleRebase MergeStyle = "rebase" // MergeStyleRebaseMerge rebase before merging with merge commit (--no-ff) MergeStyleRebaseMerge MergeStyle = "rebase-merge" // MergeStyleSquash squash commits into single commit before merging MergeStyleSquash MergeStyle = "squash" )
type Milestone ¶
type Milestone struct { ID int64 `xorm:"pk autoincr"` RepoID int64 `xorm:"INDEX"` Repo *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 GetMilestoneByID ¶ added in v1.7.0
GetMilestoneByID returns the milestone via id .
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, 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 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 (MilestonesStats) Total ¶ added in v1.11.4
func (m MilestonesStats) Total() int64
Total returns the total counts of milestones
type Mirror ¶
type Mirror struct { ID int64 `xorm:"pk autoincr"` RepoID int64 `xorm:"INDEX"` Repo *Repository `xorm:"-"` Interval time.Duration EnablePrune bool `xorm:"NOT NULL DEFAULT true"` UpdatedUnix timeutil.TimeStamp `xorm:"INDEX"` NextUpdateUnix timeutil.TimeStamp `xorm:"INDEX"` Address string `xorm:"-"` }
Mirror represents mirror information of a repository.
func GetMirrorByRepoID ¶
GetMirrorByRepoID returns mirror information of a repository.
func (*Mirror) AfterLoad ¶ added in v1.3.0
AfterLoad is invoked from XORM after setting the values of all fields of this object.
func (*Mirror) BeforeInsert ¶
func (m *Mirror) BeforeInsert()
BeforeInsert will be invoked by XORM before inserting a record
func (*Mirror) ScheduleNextUpdate ¶
func (m *Mirror) ScheduleNextUpdate()
ScheduleNextUpdate calculates and sets next update time.
type MirrorRepositoryList ¶
type MirrorRepositoryList []*Repository
MirrorRepositoryList contains the mirror repositories
func (MirrorRepositoryList) LoadAttributes ¶
func (repos MirrorRepositoryList) LoadAttributes() error
LoadAttributes loads the attributes for the given MirrorRepositoryList
type NewCommitStatusOptions ¶ added in v1.2.0
type NewCommitStatusOptions struct { Repo *Repository Creator *User SHA string CommitStatus *CommitStatus }
NewCommitStatusOptions holds options for creating a CommitStatus
type NewIssueOptions ¶
type NewIssueOptions struct { Repo *Repository Issue *Issue LabelIDs []int64 Attachments []string // In UUID format. IsPull bool }
NewIssueOptions represents the options of a new issue.
type Notice ¶
type Notice struct { ID int64 `xorm:"pk autoincr"` Type NoticeType Description string `xorm:"TEXT"` CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"` }
Notice represents a system notice for admin.
type NoticeType ¶
type NoticeType int
NoticeType describes the notice type
const ( //NoticeRepository type NoticeRepository NoticeType = iota + 1 // NoticeTask type NoticeTask )
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 *Repository `xorm:"-"` Comment *Comment `xorm:"-"` User *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 (*Notification) APIFormat ¶ added in v1.12.0
func (n *Notification) APIFormat() *api.NotificationThread
APIFormat converts a Notification to api.NotificationThread
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() (*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, statuses []NotificationStatus, page, perPage int) (NotificationList, error)
NotificationsForUser returns notifications for a given user and status
func (NotificationList) APIFormat ¶ added in v1.12.0
func (nl NotificationList) APIFormat() []*api.NotificationThread
APIFormat converts a NotificationList to api.NotificationThread list
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 )
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 OAuth2Application ¶ added in v1.8.0
type OAuth2Application struct { ID int64 `xorm:"pk autoincr"` UID int64 `xorm:"INDEX"` User *User `xorm:"-"` Name string ClientID string `xorm:"unique"` ClientSecret string RedirectURIs []string `xorm:"redirect_uris JSON TEXT"` CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"` UpdatedUnix timeutil.TimeStamp `xorm:"INDEX updated"` }
OAuth2Application represents an OAuth2 client (RFC 6749)
func CreateOAuth2Application ¶ added in v1.8.0
func CreateOAuth2Application(opts CreateOAuth2ApplicationOptions) (*OAuth2Application, error)
CreateOAuth2Application inserts a new oauth2 application
func GetOAuth2ApplicationByClientID ¶ added in v1.8.0
func GetOAuth2ApplicationByClientID(clientID string) (app *OAuth2Application, err error)
GetOAuth2ApplicationByClientID returns the oauth2 application with the given client_id. Returns an error if not found.
func GetOAuth2ApplicationByID ¶ added in v1.8.0
func GetOAuth2ApplicationByID(id int64) (app *OAuth2Application, err error)
GetOAuth2ApplicationByID returns the oauth2 application with the given id. Returns an error if not found.
func GetOAuth2ApplicationsByUserID ¶ added in v1.8.0
func GetOAuth2ApplicationsByUserID(userID int64) (apps []*OAuth2Application, err error)
GetOAuth2ApplicationsByUserID returns all oauth2 applications owned by the user
func ListOAuth2Applications ¶ added in v1.12.0
func ListOAuth2Applications(uid int64, listOptions ListOptions) ([]*OAuth2Application, error)
ListOAuth2Applications returns a list of oauth2 applications belongs to given user.
func UpdateOAuth2Application ¶ added in v1.8.0
func UpdateOAuth2Application(opts UpdateOAuth2ApplicationOptions) (*OAuth2Application, error)
UpdateOAuth2Application updates an oauth2 application
func (*OAuth2Application) ContainsRedirectURI ¶ added in v1.8.0
func (app *OAuth2Application) ContainsRedirectURI(redirectURI string) bool
ContainsRedirectURI checks if redirectURI is allowed for app
func (*OAuth2Application) CreateGrant ¶ added in v1.8.0
func (app *OAuth2Application) CreateGrant(userID int64) (*OAuth2Grant, error)
CreateGrant generates a grant for an user
func (*OAuth2Application) GenerateClientSecret ¶ added in v1.8.0
func (app *OAuth2Application) GenerateClientSecret() (string, error)
GenerateClientSecret will generate the client secret and returns the plaintext and saves the hash at the database
func (*OAuth2Application) GetGrantByUserID ¶ added in v1.8.0
func (app *OAuth2Application) GetGrantByUserID(userID int64) (*OAuth2Grant, error)
GetGrantByUserID returns a OAuth2Grant by its user and application ID
func (*OAuth2Application) LoadUser ¶ added in v1.8.0
func (app *OAuth2Application) LoadUser() (err error)
LoadUser will load User by UID
func (*OAuth2Application) PrimaryRedirectURI ¶ added in v1.8.0
func (app *OAuth2Application) PrimaryRedirectURI() string
PrimaryRedirectURI returns the first redirect uri or an empty string if empty
func (*OAuth2Application) TableName ¶ added in v1.8.0
func (app *OAuth2Application) TableName() string
TableName sets the table name to `oauth2_application`
func (*OAuth2Application) ValidateClientSecret ¶ added in v1.8.0
func (app *OAuth2Application) ValidateClientSecret(secret []byte) bool
ValidateClientSecret validates the given secret by the hash saved in database
type OAuth2AuthorizationCode ¶ added in v1.8.0
type OAuth2AuthorizationCode struct { ID int64 `xorm:"pk autoincr"` Grant *OAuth2Grant `xorm:"-"` GrantID int64 Code string `xorm:"INDEX unique"` CodeChallenge string CodeChallengeMethod string RedirectURI string ValidUntil timeutil.TimeStamp `xorm:"index"` }
OAuth2AuthorizationCode is a code to obtain an access token in combination with the client secret once. It has a limited lifetime.
func GetOAuth2AuthorizationByCode ¶ added in v1.8.0
func GetOAuth2AuthorizationByCode(code string) (*OAuth2AuthorizationCode, error)
GetOAuth2AuthorizationByCode returns an authorization by its code
func (*OAuth2AuthorizationCode) GenerateRedirectURI ¶ added in v1.8.0
func (code *OAuth2AuthorizationCode) GenerateRedirectURI(state string) (redirect *url.URL, err error)
GenerateRedirectURI generates a redirect URI for a successful authorization request. State will be used if not empty.
func (*OAuth2AuthorizationCode) Invalidate ¶ added in v1.8.0
func (code *OAuth2AuthorizationCode) Invalidate() error
Invalidate deletes the auth code from the database to invalidate this code
func (*OAuth2AuthorizationCode) TableName ¶ added in v1.8.0
func (code *OAuth2AuthorizationCode) TableName() string
TableName sets the table name to `oauth2_authorization_code`
func (*OAuth2AuthorizationCode) ValidateCodeChallenge ¶ added in v1.8.0
func (code *OAuth2AuthorizationCode) ValidateCodeChallenge(verifier string) bool
ValidateCodeChallenge validates the given verifier against the saved code challenge. This is part of the PKCE implementation.
type OAuth2Config ¶ added in v1.1.0
type OAuth2Config struct { Provider string ClientID string ClientSecret string OpenIDConnectAutoDiscoveryURL string CustomURLMapping *oauth2.CustomURLMapping }
OAuth2Config holds configuration for the OAuth2 login source.
func (*OAuth2Config) FromDB ¶ added in v1.1.0
func (cfg *OAuth2Config) FromDB(bs []byte) error
FromDB fills up an OAuth2Config from serialized format.
func (*OAuth2Config) ToDB ¶ added in v1.1.0
func (cfg *OAuth2Config) ToDB() ([]byte, error)
ToDB exports an SMTPConfig to a serialized format.
type OAuth2Grant ¶ added in v1.8.0
type OAuth2Grant struct { ID int64 `xorm:"pk autoincr"` UserID int64 `xorm:"INDEX unique(user_application)"` Application *OAuth2Application `xorm:"-"` ApplicationID int64 `xorm:"INDEX unique(user_application)"` Counter int64 `xorm:"NOT NULL DEFAULT 1"` CreatedUnix timeutil.TimeStamp `xorm:"created"` UpdatedUnix timeutil.TimeStamp `xorm:"updated"` }
OAuth2Grant represents the permission of an user for a specifc application to access resources
func GetOAuth2GrantByID ¶ added in v1.8.0
func GetOAuth2GrantByID(id int64) (*OAuth2Grant, error)
GetOAuth2GrantByID returns the grant with the given ID
func GetOAuth2GrantsByUserID ¶ added in v1.9.0
func GetOAuth2GrantsByUserID(uid int64) ([]*OAuth2Grant, error)
GetOAuth2GrantsByUserID lists all grants of a certain user
func (*OAuth2Grant) GenerateNewAuthorizationCode ¶ added in v1.8.0
func (grant *OAuth2Grant) GenerateNewAuthorizationCode(redirectURI, codeChallenge, codeChallengeMethod string) (*OAuth2AuthorizationCode, error)
GenerateNewAuthorizationCode generates a new authorization code for a grant and saves it to the databse
func (*OAuth2Grant) IncreaseCounter ¶ added in v1.8.0
func (grant *OAuth2Grant) IncreaseCounter() error
IncreaseCounter increases the counter and updates the grant
func (*OAuth2Grant) TableName ¶ added in v1.8.0
func (grant *OAuth2Grant) TableName() string
TableName sets the table name to `oauth2_grant`
type OAuth2Provider ¶ added in v1.1.0
type OAuth2Provider struct { Name string DisplayName string Image string CustomURLMapping *oauth2.CustomURLMapping }
OAuth2Provider describes the display values of a single OAuth2 provider
type OAuth2Token ¶ added in v1.8.0
type OAuth2Token struct { GrantID int64 `json:"gnt"` Type OAuth2TokenType `json:"tt"` Counter int64 `json:"cnt,omitempty"` jwt.StandardClaims }
OAuth2Token represents a JWT token used to authenticate a client
func ParseOAuth2Token ¶ added in v1.8.0
func ParseOAuth2Token(jwtToken string) (*OAuth2Token, error)
ParseOAuth2Token parses a singed jwt string
func (*OAuth2Token) SignToken ¶ added in v1.8.0
func (token *OAuth2Token) SignToken() (string, error)
SignToken signs the token with the JWT secret
type OAuth2TokenType ¶ added in v1.8.0
type OAuth2TokenType int
OAuth2TokenType represents the type of token for an oauth application
const ( // TypeAccessToken is a token with short lifetime to access the api TypeAccessToken OAuth2TokenType = 0 // TypeRefreshToken is token with long lifetime to refresh access tokens obtained by the client TypeRefreshToken = iota )
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 PAMConfig ¶
type PAMConfig struct {
ServiceName string // pam service (e.g. system-auth)
}
PAMConfig holds configuration for the PAM login source.
type Permission ¶ added in v1.7.0
type Permission struct { AccessMode AccessMode Units []*RepoUnit UnitsMode map[UnitType]AccessMode }
Permission contains all the permissions related variables to a repository for a user
func GetUserRepoPermission ¶ added in v1.7.0
func GetUserRepoPermission(repo *Repository, user *User) (Permission, error)
GetUserRepoPermission returns the user permissions to the repository
func (*Permission) CanAccess ¶ added in v1.7.0
func (p *Permission) CanAccess(mode AccessMode, unitType UnitType) 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 AccessMode, unitTypes ...UnitType) 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 UnitType) bool
CanRead returns true if user could read to this unit
func (*Permission) CanReadAny ¶ added in v1.7.0
func (p *Permission) CanReadAny(unitTypes ...UnitType) 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 UnitType) 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 UnitType) 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 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 GetProjectBoards ¶ added in v1.13.0
func GetProjectBoards(projectID int64) ([]*ProjectBoard, error)
GetProjectBoards fetches all boards related to a project
func GetUncategorizedBoard ¶ added in v1.13.0
func GetUncategorizedBoard(projectID int64) (*ProjectBoard, error)
GetUncategorizedBoard represents a board for issues not assigned to one
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 (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"` }
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"` 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"` 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 GetProtectedBranchByID ¶ added in v1.3.0
func GetProtectedBranchByID(id int64) (*ProtectedBranch, error)
GetProtectedBranchByID getting protected branch by ID
func GetProtectedBranchByRepoID ¶ added in v1.1.0
func GetProtectedBranchByRepoID(repoID int64) ([]*ProtectedBranch, error)
GetProtectedBranchByRepoID getting protected branch by repo ID
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) 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) IsUserMergeWhitelisted ¶ added in v1.11.4
func (protectBranch *ProtectedBranch) IsUserMergeWhitelisted(userID int64, permissionInRepo Permission) bool
IsUserMergeWhitelisted checks if some user is whitelisted to merge to this branch
func (*ProtectedBranch) IsUserOfficialReviewer ¶ added in v1.11.0
func (protectBranch *ProtectedBranch) IsUserOfficialReviewer(user *User) (bool, error)
IsUserOfficialReviewer check if user is official reviewer for the branch (counts towards required approvals)
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 An official ReviewRequest should also block Merge like Reject
type PublicKey ¶
type PublicKey struct { ID int64 `xorm:"pk autoincr"` OwnerID int64 `xorm:"INDEX NOT NULL"` Name string `xorm:"NOT NULL"` Fingerprint string `xorm:"INDEX NOT NULL"` Content string `xorm:"TEXT NOT NULL"` Mode AccessMode `xorm:"NOT NULL DEFAULT 2"` Type KeyType `xorm:"NOT NULL DEFAULT 1"` LoginSourceID int64 `xorm:"NOT NULL DEFAULT 0"` CreatedUnix timeutil.TimeStamp `xorm:"created"` UpdatedUnix timeutil.TimeStamp `xorm:"updated"` HasRecentActivity bool `xorm:"-"` HasUsed bool `xorm:"-"` }
PublicKey represents a user or deploy SSH public key.
func AddPrincipalKey ¶ added in v1.13.0
AddPrincipalKey adds new principal to database and authorized_principals file.
func AddPublicKey ¶
AddPublicKey adds new public key to database and authorized_keys file.
func GetPublicKeyByID ¶
GetPublicKeyByID returns public key by given ID.
func ListPrincipalKeys ¶ added in v1.13.0
func ListPrincipalKeys(uid int64, listOptions ListOptions) ([]*PublicKey, error)
ListPrincipalKeys returns a list of principals belongs to given user.
func ListPublicKeys ¶
func ListPublicKeys(uid int64, listOptions ListOptions) ([]*PublicKey, error)
ListPublicKeys returns a list of public keys belongs to given user.
func ListPublicLdapSSHKeys ¶ added in v1.5.0
ListPublicLdapSSHKeys returns a list of synchronized public ldap ssh keys belongs to given user and login source.
func SearchPublicKey ¶ added in v1.7.0
SearchPublicKey returns a list of public keys matching the provided arguments.
func SearchPublicKeyByContent ¶
SearchPublicKeyByContent searches content as prefix (leak e-mail part) and returns public key found.
func SearchPublicKeyByContentExact ¶ added in v1.13.0
SearchPublicKeyByContentExact searches content and returns public key found.
func (*PublicKey) AfterLoad ¶ added in v1.3.0
func (key *PublicKey) AfterLoad()
AfterLoad is invoked from XORM after setting the values of all fields of this object.
func (*PublicKey) AuthorizedString ¶
AuthorizedString returns formatted public key string for authorized_keys file.
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 *Repository `xorm:"-"` BaseRepoID int64 `xorm:"INDEX"` BaseRepo *Repository `xorm:"-"` HeadBranch string 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 `xorm:"-"` MergedUnix timeutil.TimeStamp `xorm:"updated INDEX"` // contains filtered or unexported fields }
PullRequest represents relation between pull request and repositories.
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 int64, 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) (*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) 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) 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) 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) SignMerge ¶ added in v1.11.0
func (pr *PullRequest) SignMerge(u *User, tmpBasePath, baseCommit, headCommit string) (bool, string, *git.Signature, error)
SignMerge determines if we should sign a PR merge commit to the base repository
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 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, 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 )
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 PullRequestsConfig ¶ added in v1.4.0
type PullRequestsConfig struct { IgnoreWhitespaceConflicts bool AllowMerge bool AllowRebase bool AllowRebaseMerge bool AllowSquash bool }
PullRequestsConfig describes pull requests config
func (*PullRequestsConfig) FromDB ¶ added in v1.4.0
func (cfg *PullRequestsConfig) FromDB(bs []byte) error
FromDB fills up a PullRequestsConfig from serialized format.
func (*PullRequestsConfig) IsMergeStyleAllowed ¶ added in v1.4.0
func (cfg *PullRequestsConfig) IsMergeStyleAllowed(mergeStyle MergeStyle) bool
IsMergeStyleAllowed returns if merge style is allowed
func (*PullRequestsConfig) ToDB ¶ added in v1.4.0
func (cfg *PullRequestsConfig) ToDB() ([]byte, error)
ToDB exports a PullRequestsConfig to a serialized format.
type PullRequestsOptions ¶ added in v1.0.0
type PullRequestsOptions struct { 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 User *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, 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, error)
FindCommentReactions returns a ReactionList of all reactions from an comment
func FindIssueReactions ¶ added in v1.11.0
func FindIssueReactions(issue *Issue, listOptions ListOptions) (ReactionList, 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 *Repository) ([]*User, error)
LoadUsers loads reactions' all users
type ReactionOptions ¶ added in v1.4.0
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 *Repository `xorm:"-"` PublisherID int64 `xorm:"INDEX"` Publisher *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 []*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 DBContext, 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 RepoIndexerStatus ¶ added in v1.3.0
type RepoIndexerStatus struct { ID int64 `xorm:"pk autoincr"` RepoID int64 `xorm:"INDEX(s)"` CommitSha string `xorm:"VARCHAR(40)"` IndexerType RepoIndexerType `xorm:"INDEX(s) NOT NULL DEFAULT 0"` }
RepoIndexerStatus status of a repo's entry in the repo indexer For now, implicitly refers to default branch
type RepoIndexerType ¶ added in v1.12.0
type RepoIndexerType int
RepoIndexerType specifies the repository indexer type
const ( // RepoIndexerTypeCode code indexer RepoIndexerTypeCode RepoIndexerType = iota // 0 // RepoIndexerTypeStats repository stats indexer RepoIndexerTypeStats // 1 )
type RepoRedirect ¶ added in v1.1.0
type RepoRedirect struct { ID int64 `xorm:"pk autoincr"` OwnerID int64 `xorm:"UNIQUE(s)"` LowerName string `xorm:"UNIQUE(s) INDEX NOT NULL"` RedirectRepoID int64 // repoID to redirect to }
RepoRedirect represents that a repo name should be redirected to another
type RepoUnit ¶ added in v1.1.0
type RepoUnit struct { ID int64 RepoID int64 `xorm:"INDEX(s)"` Type UnitType `xorm:"INDEX(s)"` Config convert.Conversion `xorm:"TEXT"` CreatedUnix timeutil.TimeStamp `xorm:"INDEX CREATED"` }
RepoUnit describes all units of a repository
func (*RepoUnit) BeforeSet ¶ added in v1.1.0
BeforeSet is invoked from XORM before setting the value of a field of this object.
func (*RepoUnit) CodeConfig ¶ added in v1.1.0
func (r *RepoUnit) CodeConfig() *UnitConfig
CodeConfig returns config for UnitTypeCode
func (*RepoUnit) ExternalTrackerConfig ¶ added in v1.1.0
func (r *RepoUnit) ExternalTrackerConfig() *ExternalTrackerConfig
ExternalTrackerConfig returns config for UnitTypeExternalTracker
func (*RepoUnit) ExternalWikiConfig ¶ added in v1.1.0
func (r *RepoUnit) ExternalWikiConfig() *ExternalWikiConfig
ExternalWikiConfig returns config for UnitTypeExternalWiki
func (*RepoUnit) IssuesConfig ¶ added in v1.1.0
func (r *RepoUnit) IssuesConfig() *IssuesConfig
IssuesConfig returns config for UnitTypeIssues
func (*RepoUnit) PullRequestsConfig ¶ added in v1.1.0
func (r *RepoUnit) PullRequestsConfig() *PullRequestsConfig
PullRequestsConfig returns config for UnitTypePullRequests
func (*RepoUnit) ReleasesConfig ¶ added in v1.1.0
func (r *RepoUnit) ReleasesConfig() *UnitConfig
ReleasesConfig returns config for UnitTypeReleases
type RepoWatchMode ¶ added in v1.11.0
type RepoWatchMode int8
RepoWatchMode specifies what kind of watch the user has on a repository
const ( // RepoWatchModeNone don't watch RepoWatchModeNone RepoWatchMode = iota // 0 // RepoWatchModeNormal watch repository (from other sources) RepoWatchModeNormal // 1 // RepoWatchModeDont explicit don't auto-watch RepoWatchModeDont // 2 // RepoWatchModeAuto watch repository (from AutoWatchOnChanges) RepoWatchModeAuto // 3 )
type Repository ¶
type Repository struct { ID int64 `xorm:"pk autoincr"` OwnerID int64 `xorm:"UNIQUE(s) index"` OwnerName string Owner *User `xorm:"-"` LowerName string `xorm:"UNIQUE(s) INDEX NOT NULL"` Name string `xorm:"INDEX NOT NULL"` Description string `xorm:"TEXT"` Website string `xorm:"VARCHAR(2048)"` OriginalServiceType api.GitServiceType `xorm:"index"` OriginalURL string `xorm:"VARCHAR(2048)"` DefaultBranch string NumWatches int NumStars int NumForks int NumIssues int NumClosedIssues int NumOpenIssues int `xorm:"-"` NumPulls int NumClosedPulls int NumOpenPulls int `xorm:"-"` NumMilestones int `xorm:"NOT NULL DEFAULT 0"` NumClosedMilestones int `xorm:"NOT NULL DEFAULT 0"` NumOpenMilestones int `xorm:"-"` NumProjects int `xorm:"NOT NULL DEFAULT 0"` NumClosedProjects int `xorm:"NOT NULL DEFAULT 0"` NumOpenProjects int `xorm:"-"` IsPrivate bool `xorm:"INDEX"` IsEmpty bool `xorm:"INDEX"` IsArchived bool `xorm:"INDEX"` IsMirror bool `xorm:"INDEX"` *Mirror `xorm:"-"` Status RepositoryStatus `xorm:"NOT NULL DEFAULT 0"` RenderingMetas map[string]string `xorm:"-"` DocumentRenderingMetas map[string]string `xorm:"-"` Units []*RepoUnit `xorm:"-"` PrimaryLanguage *LanguageStat `xorm:"-"` IsFork bool `xorm:"INDEX NOT NULL DEFAULT false"` ForkID int64 `xorm:"INDEX"` BaseRepo *Repository `xorm:"-"` IsTemplate bool `xorm:"INDEX NOT NULL DEFAULT false"` TemplateID int64 `xorm:"INDEX"` TemplateRepo *Repository `xorm:"-"` Size int64 `xorm:"NOT NULL DEFAULT 0"` CodeIndexerStatus *RepoIndexerStatus `xorm:"-"` StatsIndexerStatus *RepoIndexerStatus `xorm:"-"` IsFsckEnabled bool `xorm:"NOT NULL DEFAULT true"` CloseIssuesViaCommitInAnyBranch bool `xorm:"NOT NULL DEFAULT false"` Topics []string `xorm:"TEXT JSON"` TrustModel TrustModelType // Avatar: ID(10-20)-md5(32) - must fit into 64 symbols Avatar string `xorm:"VARCHAR(64)"` CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"` UpdatedUnix timeutil.TimeStamp `xorm:"INDEX updated"` }
Repository represents a git repository.
func GetRepositoriesByForkID ¶
func GetRepositoriesByForkID(forkID int64) ([]*Repository, error)
GetRepositoriesByForkID returns all repositories with given fork ID.
func GetRepositoryByID ¶
func GetRepositoryByID(id int64) (*Repository, error)
GetRepositoryByID returns the repository by given id if exists.
func GetRepositoryByIDCtx ¶ added in v1.12.0
func GetRepositoryByIDCtx(ctx DBContext, id int64) (*Repository, error)
GetRepositoryByIDCtx returns the repository by given id if exists.
func GetRepositoryByName ¶
func GetRepositoryByName(ownerID int64, name string) (*Repository, error)
GetRepositoryByName returns the repository by given name under user if exists.
func GetRepositoryByOwnerAndName ¶ added in v1.4.0
func GetRepositoryByOwnerAndName(ownerName, repoName string) (*Repository, error)
GetRepositoryByOwnerAndName returns the repository by given ownername and reponame.
func GetRepositoryFromMatch ¶ added in v1.9.0
func GetRepositoryFromMatch(ownerName string, repoName string) (*Repository, error)
GetRepositoryFromMatch returns a *Repository from a username and repo strings
func GetStarredRepos ¶ added in v1.0.0
func GetStarredRepos(userID int64, private bool, listOptions ListOptions) ([]*Repository, error)
GetStarredRepos returns the repos starred by a particular user
func GetUserMirrorRepositories ¶
func GetUserMirrorRepositories(userID int64) ([]*Repository, error)
GetUserMirrorRepositories returns a list of mirror repositories of given user.
func GetUserRepositories ¶
func GetUserRepositories(opts *SearchRepoOptions) ([]*Repository, int64, error)
GetUserRepositories returns a list of repositories of given user.
func GetWatchedRepos ¶ added in v1.1.0
func GetWatchedRepos(userID int64, private bool, listOptions ListOptions) ([]*Repository, error)
GetWatchedRepos returns the repos watched by a particular user
func HasForkedRepo ¶
func HasForkedRepo(ownerID, repoID int64) (*Repository, bool)
HasForkedRepo checks if given user has already forked a repository with given ID.
func (*Repository) APIFormat ¶
func (repo *Repository) APIFormat(mode AccessMode) *api.Repository
APIFormat converts a Repository to api.Repository
func (*Repository) APIURL ¶ added in v1.1.0
func (repo *Repository) APIURL() string
APIURL returns the repository API URL
func (*Repository) AddCollaborator ¶
func (repo *Repository) AddCollaborator(u *User) error
AddCollaborator adds new collaboration to a repository with default access mode.
func (*Repository) AddDeletedBranch ¶ added in v1.3.0
func (repo *Repository) AddDeletedBranch(branchName, commit string, deletedByID int64) error
AddDeletedBranch adds a deleted branch to the database
func (*Repository) AfterLoad ¶ added in v1.3.0
func (repo *Repository) AfterLoad()
AfterLoad is invoked from XORM after setting the values of all fields of this object.
func (*Repository) AllowOnlyContributorsToTrackTime ¶ added in v1.3.0
func (repo *Repository) AllowOnlyContributorsToTrackTime() bool
AllowOnlyContributorsToTrackTime returns value of IssuesConfig or the default value
func (*Repository) AllowsPulls ¶
func (repo *Repository) AllowsPulls() bool
AllowsPulls returns true if repository meets the requirements of accepting pulls and has them enabled.
func (*Repository) AvatarLink ¶ added in v1.13.0
func (repo *Repository) AvatarLink() string
AvatarLink returns a link to the repository's avatar.
func (*Repository) CanCreateBranch ¶ added in v1.3.0
func (repo *Repository) CanCreateBranch() bool
CanCreateBranch returns true if repository meets the requirements for creating new branches.
func (*Repository) CanEnableEditor ¶
func (repo *Repository) CanEnableEditor() bool
CanEnableEditor returns true if repository meets the requirements of web editor.
func (*Repository) CanEnablePulls ¶
func (repo *Repository) CanEnablePulls() bool
CanEnablePulls returns true if repository meets the requirements of accepting pulls.
func (*Repository) CanEnableTimetracker ¶ added in v1.5.0
func (repo *Repository) CanEnableTimetracker() bool
CanEnableTimetracker returns true when the server admin enabled time tracking This overrules IsTimetrackerEnabled
func (*Repository) CanUserDelete ¶ added in v1.11.0
func (repo *Repository) CanUserDelete(user *User) (bool, error)
CanUserDelete returns true if user could delete the repository
func (*Repository) CanUserFork ¶ added in v1.2.1
func (repo *Repository) CanUserFork(user *User) (bool, error)
CanUserFork returns true if specified user can fork repository.
func (*Repository) ChangeCollaborationAccessMode ¶
func (repo *Repository) ChangeCollaborationAccessMode(uid int64, mode AccessMode) error
ChangeCollaborationAccessMode sets new access mode for the collaboration.
func (*Repository) CheckUnitUser ¶ added in v1.2.0
func (repo *Repository) CheckUnitUser(user *User, unitType UnitType) bool
CheckUnitUser check whether user could visit the unit of this repository
func (*Repository) CloneLink ¶
func (repo *Repository) CloneLink() (cl *CloneLink)
CloneLink returns clone URLs of repository.
func (*Repository) ColorFormat ¶ added in v1.9.0
func (repo *Repository) ColorFormat(s fmt.State)
ColorFormat returns a colored string to represent this repo
func (*Repository) CommitLink ¶ added in v1.13.0
func (repo *Repository) CommitLink(commitID string) (result string)
CommitLink make link to by commit full ID note: won't check whether it's an right id
func (*Repository) ComposeCompareURL ¶
func (repo *Repository) ComposeCompareURL(oldCommitID, newCommitID string) string
ComposeCompareURL returns the repository comparison URL
func (*Repository) ComposeDocumentMetas ¶ added in v1.12.0
func (repo *Repository) ComposeDocumentMetas() map[string]string
ComposeDocumentMetas composes a map of metas for properly rendering documents
func (*Repository) ComposeMetas ¶
func (repo *Repository) ComposeMetas() map[string]string
ComposeMetas composes a map of metas for properly rendering issue links and external issue trackers.
func (*Repository) CountLFSMetaObjects ¶ added in v1.11.0
func (repo *Repository) CountLFSMetaObjects() (int64, error)
CountLFSMetaObjects returns a count of all LFSMetaObjects associated with a repository
func (*Repository) CustomAvatarRelativePath ¶ added in v1.13.0
func (repo *Repository) CustomAvatarRelativePath() string
CustomAvatarRelativePath returns repository custom avatar file path.
func (*Repository) DeleteAvatar ¶ added in v1.9.0
func (repo *Repository) DeleteAvatar() error
DeleteAvatar deletes the repos's custom avatar.
func (*Repository) DeleteCollaboration ¶
func (repo *Repository) DeleteCollaboration(uid int64) (err error)
DeleteCollaboration removes collaboration relation between the user and repository.
func (*Repository) DeleteProtectedBranch ¶ added in v1.1.0
func (repo *Repository) DeleteProtectedBranch(id int64) (err error)
DeleteProtectedBranch removes ProtectedBranch relation between the user and repository.
func (*Repository) DeleteWiki ¶
func (repo *Repository) DeleteWiki() error
DeleteWiki removes the actual and local copy of repository wiki.
func (*Repository) DescriptionHTML ¶ added in v1.0.0
func (repo *Repository) DescriptionHTML() template.HTML
DescriptionHTML does special handles to description and return HTML string.
func (*Repository) FullName ¶
func (repo *Repository) FullName() string
FullName returns the repository full name
func (*Repository) GetAssignees ¶
func (repo *Repository) GetAssignees() (_ []*User, err error)
GetAssignees returns all users that have write access and can be assigned to issues of the repository,
func (*Repository) GetBaseRepo ¶
func (repo *Repository) GetBaseRepo() (err error)
GetBaseRepo populates repo.BaseRepo for a fork repository and returns an error on failure (NOTE: no error is returned for non-fork repositories, and BaseRepo will be left untouched)
func (*Repository) GetBranchProtection ¶ added in v1.11.0
func (repo *Repository) GetBranchProtection(branchName string) (*ProtectedBranch, error)
GetBranchProtection get the branch protection of a branch
func (*Repository) GetCollaborators ¶
func (repo *Repository) GetCollaborators(listOptions ListOptions) ([]*Collaborator, error)
GetCollaborators returns the collaborators for a repository
func (*Repository) GetCommitsCountCacheKey ¶ added in v1.3.0
func (repo *Repository) GetCommitsCountCacheKey(contextName string, isRef bool) string
GetCommitsCountCacheKey returns cache key used for commits count caching.
func (*Repository) GetDeletedBranchByID ¶ added in v1.3.0
func (repo *Repository) GetDeletedBranchByID(id int64) (*DeletedBranch, error)
GetDeletedBranchByID get a deleted branch by its ID
func (*Repository) GetDeletedBranches ¶ added in v1.3.0
func (repo *Repository) GetDeletedBranches() ([]*DeletedBranch, error)
GetDeletedBranches returns all the deleted branches
func (*Repository) GetForks ¶
func (repo *Repository) GetForks(listOptions ListOptions) ([]*Repository, error)
GetForks returns all the forks of the repository
func (*Repository) GetIndexerStatus ¶ added in v1.11.0
func (repo *Repository) GetIndexerStatus(indexerType RepoIndexerType) (*RepoIndexerStatus, error)
GetIndexerStatus loads repo codes indxer status
func (*Repository) GetLFSMetaObjectByOid ¶ added in v1.3.0
func (repo *Repository) GetLFSMetaObjectByOid(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 (*Repository) GetLFSMetaObjects ¶ added in v1.11.0
func (repo *Repository) GetLFSMetaObjects(page, pageSize int) ([]*LFSMetaObject, error)
GetLFSMetaObjects returns all LFSMetaObjects associated with a repository
func (*Repository) GetLanguageStats ¶ added in v1.12.0
func (repo *Repository) GetLanguageStats() (LanguageStatList, error)
GetLanguageStats returns the language statistics for a repository
func (*Repository) GetMilestoneByID ¶
func (repo *Repository) GetMilestoneByID(milestoneID int64) (*Milestone, error)
GetMilestoneByID returns the milestone belongs to repository by given ID.
func (*Repository) GetMirror ¶
func (repo *Repository) GetMirror() (err error)
GetMirror sets the repository mirror, returns an error upon failure
func (*Repository) GetOriginalURLHostname ¶ added in v1.10.0
func (repo *Repository) GetOriginalURLHostname() string
GetOriginalURLHostname returns the hostname of a URL or the URL
func (*Repository) GetOwner ¶
func (repo *Repository) GetOwner() error
GetOwner returns the repository owner
func (*Repository) GetProtectedBranches ¶ added in v1.1.0
func (repo *Repository) GetProtectedBranches() ([]*ProtectedBranch, error)
GetProtectedBranches get all protected branches
func (*Repository) GetReaders ¶ added in v1.9.4
func (repo *Repository) GetReaders() (_ []*User, err error)
GetReaders returns all users that have explicit read access or higher to the repository.
func (*Repository) GetRepoTeams ¶ added in v1.10.0
func (repo *Repository) GetRepoTeams() ([]*Team, error)
GetRepoTeams gets the list of teams that has access to the repository
func (*Repository) GetReviewerTeams ¶ added in v1.13.0
func (repo *Repository) GetReviewerTeams() ([]*Team, error)
GetReviewerTeams get all teams can be requested to review
func (*Repository) GetReviewers ¶ added in v1.12.0
func (repo *Repository) GetReviewers(doerID, posterID int64) ([]*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 write access or higher to the repository, and all repo watchers. TODO: may be we should hava a busy choice for users to block review request to them.
func (*Repository) GetStargazers ¶
func (repo *Repository) GetStargazers(opts ListOptions) ([]*User, error)
GetStargazers returns the users that starred the repo.
func (*Repository) GetTemplateRepo ¶ added in v1.11.0
func (repo *Repository) GetTemplateRepo() (err error)
GetTemplateRepo populates repo.TemplateRepo for a generated repository and returns an error on failure (NOTE: no error is returned for non-generated repositories, and TemplateRepo will be left untouched)
func (*Repository) GetTopLanguageStats ¶ added in v1.12.0
func (repo *Repository) GetTopLanguageStats(limit int) (LanguageStatList, error)
GetTopLanguageStats returns the top language statistics for a repository
func (*Repository) GetTreePathLock ¶ added in v1.11.0
func (repo *Repository) GetTreePathLock(treePath string) (*LFSLock, error)
GetTreePathLock returns LSF lock for the treePath
func (*Repository) GetTrustModel ¶ added in v1.13.0
func (repo *Repository) GetTrustModel() TrustModelType
GetTrustModel will get the TrustModel for the repo or the default trust model
func (*Repository) GetUnit ¶ added in v1.1.0
func (repo *Repository) GetUnit(tp UnitType) (*RepoUnit, error)
GetUnit returns a RepoUnit object
func (*Repository) GetUserFork ¶ added in v1.1.0
func (repo *Repository) GetUserFork(userID int64) (*Repository, error)
GetUserFork return user forked repository from this repository, if not forked return nil
func (*Repository) GetWatchers ¶
func (repo *Repository) GetWatchers(opts ListOptions) ([]*User, error)
GetWatchers returns range of users watching given repository.
func (*Repository) GetWriters ¶ added in v1.3.0
func (repo *Repository) GetWriters() (_ []*User, err error)
GetWriters returns all users that have write access to the repository.
func (*Repository) GitConfigPath ¶
func (repo *Repository) GitConfigPath() string
GitConfigPath returns the repository git config path
func (*Repository) HTMLURL ¶
func (repo *Repository) HTMLURL() string
HTMLURL returns the repository HTML URL
func (*Repository) HasWiki ¶
func (repo *Repository) HasWiki() bool
HasWiki returns true if repository has wiki.
func (*Repository) IsBeingCreated ¶ added in v1.10.0
func (repo *Repository) IsBeingCreated() bool
IsBeingCreated indicates that repository is being migrated or forked
func (*Repository) IsBeingMigrated ¶ added in v1.10.0
func (repo *Repository) IsBeingMigrated() bool
IsBeingMigrated indicates that repository is being migtated
func (*Repository) IsCollaborator ¶ added in v1.1.0
func (repo *Repository) IsCollaborator(userID int64) (bool, error)
IsCollaborator check if a user is a collaborator of a repository
func (*Repository) IsDependenciesEnabled ¶ added in v1.6.0
func (repo *Repository) IsDependenciesEnabled() bool
IsDependenciesEnabled returns if dependecies are enabled and returns the default setting if not set.
func (*Repository) IsGenerated ¶ added in v1.11.0
func (repo *Repository) IsGenerated() bool
IsGenerated returns whether _this_ repository was generated from a template
func (*Repository) IsOwnedBy ¶
func (repo *Repository) IsOwnedBy(userID int64) bool
IsOwnedBy returns true when user owns this repository
func (*Repository) IsOwnerMemberCollaborator ¶ added in v1.11.2
func (repo *Repository) IsOwnerMemberCollaborator(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 (*Repository) IsProtectedBranch ¶ added in v1.2.0
func (repo *Repository) IsProtectedBranch(branchName string, doer *User) (bool, error)
IsProtectedBranch checks if branch is protected
func (*Repository) IsProtectedBranchForPush ¶ added in v1.5.0
func (repo *Repository) IsProtectedBranchForPush(branchName string, doer *User) (bool, error)
IsProtectedBranchForPush checks if branch is protected for push
func (*Repository) IsReader ¶ added in v1.9.4
func (repo *Repository) IsReader(userID int64) (bool, error)
IsReader returns true if user has explicit read access or higher to the repository.
func (*Repository) IsTimetrackerEnabled ¶ added in v1.3.0
func (repo *Repository) IsTimetrackerEnabled() bool
IsTimetrackerEnabled returns whether or not the timetracker is enabled. It returns the default value from config if an error occurs.
func (*Repository) IssueStats ¶
IssueStats returns number of open and closed repository issues by given filter mode.
func (*Repository) MustGetUnit ¶ added in v1.1.0
func (repo *Repository) MustGetUnit(tp UnitType) *RepoUnit
MustGetUnit always returns a RepoUnit object
func (*Repository) MustOwner ¶
func (repo *Repository) MustOwner() *User
MustOwner always returns a valid *User object to avoid conceptually impossible error handling. It creates a fake object that contains error details when error occurs.
func (*Repository) RecalculateAccesses ¶
func (repo *Repository) RecalculateAccesses() error
RecalculateAccesses recalculates all accesses for repository.
func (*Repository) RelAvatarLink ¶ added in v1.9.0
func (repo *Repository) RelAvatarLink() string
RelAvatarLink returns a relative link to the repository's avatar.
func (*Repository) RelLink ¶
func (repo *Repository) RelLink() string
RelLink returns the repository relative link
func (*Repository) RemoveDeletedBranch ¶ added in v1.3.0
func (repo *Repository) RemoveDeletedBranch(id int64) (err error)
RemoveDeletedBranch removes a deleted branch from the database
func (*Repository) RemoveLFSMetaObjectByOid ¶ added in v1.3.0
func (repo *Repository) RemoveLFSMetaObjectByOid(oid string) (int64, error)
RemoveLFSMetaObjectByOid removes a LFSMetaObject entry from database by its OID. It may return ErrLFSObjectNotExist or a database error.
func (*Repository) RepoPath ¶
func (repo *Repository) RepoPath() string
RepoPath returns the repository path
func (*Repository) SanitizedOriginalURL ¶ added in v1.11.0
func (repo *Repository) SanitizedOriginalURL() string
SanitizedOriginalURL returns a sanitized OriginalURL
func (*Repository) SetArchiveRepoState ¶ added in v1.8.0
func (repo *Repository) SetArchiveRepoState(isArchived bool) (err error)
SetArchiveRepoState sets if a repo is archived
func (*Repository) SignCRUDAction ¶ added in v1.11.0
func (repo *Repository) SignCRUDAction(u *User, tmpBasePath, parentCommit string) (bool, string, *git.Signature, error)
SignCRUDAction determines if we should sign a CRUD commit to this repository
func (*Repository) SignWikiCommit ¶ added in v1.11.0
SignWikiCommit determines if we should sign the commits to this repository wiki
func (*Repository) UnitEnabled ¶ added in v1.2.0
func (repo *Repository) UnitEnabled(tp UnitType) bool
UnitEnabled if this repository has the given unit enabled
func (*Repository) UpdateDefaultBranch ¶ added in v1.1.0
func (repo *Repository) UpdateDefaultBranch() error
UpdateDefaultBranch updates the default branch
func (*Repository) UpdateIndexerStatus ¶ added in v1.11.0
func (repo *Repository) UpdateIndexerStatus(indexerType RepoIndexerType, sha string) error
UpdateIndexerStatus updates indexer status
func (*Repository) UpdateLanguageStats ¶ added in v1.12.0
func (repo *Repository) UpdateLanguageStats(commitID string, stats map[string]int64) error
UpdateLanguageStats updates the language statistics for repository
func (*Repository) UpdateSize ¶ added in v1.2.0
func (repo *Repository) UpdateSize(ctx DBContext) error
UpdateSize updates the repository size, calculating it using util.GetDirectorySize
func (*Repository) UploadAvatar ¶ added in v1.9.0
func (repo *Repository) UploadAvatar(data []byte) error
UploadAvatar saves custom avatar for repository. FIXME: split uploads to different subdirs in case we have massive number of repos.
func (*Repository) WikiCloneLink ¶
func (repo *Repository) WikiCloneLink() *CloneLink
WikiCloneLink returns clone URLs of repository wiki.
func (*Repository) WikiPath ¶
func (repo *Repository) WikiPath() string
WikiPath returns wiki data path for given repository.
type RepositoryList ¶
type RepositoryList []*Repository
RepositoryList contains a list of repositories
func RepositoryListOfMap ¶ added in v1.2.0
func RepositoryListOfMap(repoMap map[int64]*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 RepositoryStatus ¶ added in v1.10.0
type RepositoryStatus int
RepositoryStatus defines the status of repository
const ( RepositoryReady RepositoryStatus = iota // a normal repository RepositoryBeingMigrated // repository is migrating )
all kinds of RepositoryStatus
type Review ¶ added in v1.6.0
type Review struct { ID int64 `xorm:"pk autoincr"` Type ReviewType Reviewer *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"` 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
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 requst 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 SMTPConfig ¶
type SMTPConfig struct { Auth string Host string Port int AllowedDomains string `xorm:"TEXT"` TLS bool SkipVerify bool }
SMTPConfig holds configuration for the SMTP login source.
func (*SMTPConfig) FromDB ¶
func (cfg *SMTPConfig) FromDB(bs []byte) error
FromDB fills up an SMTPConfig from serialized format.
func (*SMTPConfig) ToDB ¶
func (cfg *SMTPConfig) ToDB() ([]byte, error)
ToDB exports an SMTPConfig to a serialized format.
type SSPIConfig ¶ added in v1.11.0
type SSPIConfig struct { AutoCreateUsers bool AutoActivateUsers bool StripDomainNames bool SeparatorReplacement string DefaultLanguage string }
SSPIConfig holds configuration for SSPI single sign-on.
func (*SSPIConfig) FromDB ¶ added in v1.11.0
func (cfg *SSPIConfig) FromDB(bs []byte) error
FromDB fills up an SSPIConfig from serialized format.
func (*SSPIConfig) ToDB ¶ added in v1.11.0
func (cfg *SSPIConfig) ToDB() ([]byte, error)
ToDB exports an SSPIConfig to a serialized format.
type SearchEmailOptions ¶ added in v1.11.2
type SearchEmailOptions struct { ListOptions Keyword string SortType SearchEmailOrderBy IsPrimary util.OptionalBool IsActivated util.OptionalBool }
SearchEmailOptions are options to search e-mail addresses for the admin panel
type SearchEmailOrderBy ¶ added in v1.11.2
type SearchEmailOrderBy string
SearchEmailOrderBy is used to sort the results from SearchEmails()
const ( SearchEmailOrderByEmail SearchEmailOrderBy = "emails.email ASC, is_primary DESC, sortid ASC" SearchEmailOrderByEmailReverse SearchEmailOrderBy = "emails.email DESC, is_primary ASC, sortid DESC" SearchEmailOrderByName SearchEmailOrderBy = "`user`.lower_name ASC, is_primary DESC, sortid ASC" SearchEmailOrderByNameReverse SearchEmailOrderBy = "`user`.lower_name DESC, is_primary ASC, sortid DESC" )
Strings for sorting result
func (SearchEmailOrderBy) String ¶ added in v1.11.2
func (s SearchEmailOrderBy) String() string
type SearchEmailResult ¶ added in v1.11.2
type SearchEmailResult struct { UID int64 Email string IsActivated bool IsPrimary bool // From User Name string FullName string }
SearchEmailResult is an e-mail address found in the user or email_address table
func SearchEmails ¶ added in v1.11.2
func SearchEmails(opts *SearchEmailOptions) ([]*SearchEmailResult, int64, error)
SearchEmails takes options i.e. keyword and part of email name to search, it returns results in given range and number of total results.
type SearchMembersOptions ¶ added in v1.12.0
type SearchMembersOptions struct {
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 SearchOrganizationsOptions ¶ added in v1.12.0
type SearchOrganizationsOptions struct { ListOptions All bool }
SearchOrganizationsOptions options to filter organizations
type SearchRepoOptions ¶
type SearchRepoOptions struct { ListOptions Actor *User Keyword string OwnerID int64 PriorityOwnerID int64 OrderBy SearchOrderBy Private bool // Include private repositories in results StarredByID 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 -> incude just public IsPrivate util.OptionalBool // None -> include collaborative AND non-collaborative // True -> include just collaborative // False -> incude 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 SearchTeamOptions ¶ added in v1.10.0
type SearchTeamOptions struct { ListOptions UserID int64 Keyword string OrgID int64 IncludeDesc bool }
SearchTeamOptions holds the search options
type SearchUserOptions ¶
type SearchUserOptions struct { ListOptions Keyword string Type UserType UID int64 OrderBy SearchOrderBy Visible []structs.VisibleType Actor *User // The user doing the search IsActive util.OptionalBool SearchByEmail bool // Search by email as well as username/full name }
SearchUserOptions contains the options for searching
type SignCommit ¶ added in v1.2.0
type SignCommit struct { Verification *CommitVerification *UserCommit }
SignCommit represents a commit with validation of signature.
type SignCommitWithStatuses ¶ added in v1.2.0
type SignCommitWithStatuses struct { Status *CommitStatus *SignCommit }
SignCommitWithStatuses represents a commit with validation of signature and status state.
type Star ¶
type Star struct { ID int64 `xorm:"pk autoincr"` UID int64 `xorm:"UNIQUE(s)"` RepoID int64 `xorm:"UNIQUE(s)"` CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"` }
Star represents a starred repo by an user.
type Statistic ¶
type Statistic struct { Counter struct { User, Org, PublicKey, Repo, Watch, Star, Action, Access, Issue, Comment, Oauth, Follow, Mirror, Release, LoginSource, Webhook, Milestone, Label, HookTask, Team, UpdateTask, Attachment int64 } }
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 ListOptions) ([]*Stopwatch, error)
GetUserStopwatches return list of all stopwatches of a user
type Task ¶ added in v1.10.0
type Task struct { ID int64 DoerID int64 `xorm:"index"` // operator Doer *User `xorm:"-"` OwnerID int64 `xorm:"index"` // repo owner id, when creating, the repoID maybe zero Owner *User `xorm:"-"` RepoID int64 `xorm:"index"` Repo *Repository `xorm:"-"` Type structs.TaskType Status structs.TaskStatus `xorm:"index"` StartTime timeutil.TimeStamp EndTime timeutil.TimeStamp PayloadContent string `xorm:"TEXT"` Errors 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 Authorize AccessMode Repos []*Repository `xorm:"-"` Members []*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 GetTeamByID ¶
GetTeamByID returns team by given ID.
func GetTeamsWithAccessToRepo ¶ added in v1.3.0
func GetTeamsWithAccessToRepo(orgID, repoID int64, mode 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(userID int64, listOptions ListOptions) ([]*Team, error)
GetUserTeams returns all teams that user belongs across all organizations.
func SearchTeam ¶ added in v1.10.0
func SearchTeam(opts *SearchTeamOptions) ([]*Team, int64, error)
SearchTeam search for 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 *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 *SearchTeamOptions) 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) HasRepository ¶
HasRepository returns true if given repository belong to team.
func (*Team) HasWriteAccess ¶ added in v1.3.0
HasWriteAccess returns true if team has at least write level access mode.
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) UnitEnabled ¶ added in v1.2.0
UnitEnabled 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 UnitType `xorm:"UNIQUE(s)"` }
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 Topic ¶ added in v1.5.0
type Topic struct { ID int64 `xorm:"pk autoincr"` Name string `xorm:"UNIQUE VARCHAR(25)"` RepoCount int CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"` UpdatedUnix timeutil.TimeStamp `xorm:"INDEX updated"` }
Topic represents a topic of repositories
func AddTopic ¶ added in v1.10.0
AddTopic adds a topic name to a repository (if it does not already have it)
func DeleteTopic ¶ added in v1.10.0
DeleteTopic removes a topic name from a repository (if it has it)
func FindTopics ¶ added in v1.5.0
func FindTopics(opts *FindTopicOptions) (topics []*Topic, err error)
FindTopics retrieves the topics via FindTopicOptions
func GetRepoTopicByName ¶ added in v1.10.0
GetRepoTopicByName retrives topic from name for a repo if it exist
func GetTopicByName ¶ added in v1.5.0
GetTopicByName retrieves topic by name
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 `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 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 TrustModelType ¶ added in v1.13.0
type TrustModelType int
TrustModelType defines the types of trust model for this repository
const ( DefaultTrustModel TrustModelType = iota // default trust model CommitterTrustModel CollaboratorTrustModel CollaboratorCommitterTrustModel )
kinds of TrustModel
func ToTrustModel ¶ added in v1.13.0
func ToTrustModel(model string) TrustModelType
ToTrustModel converts a string to a TrustModelType
func (TrustModelType) String ¶ added in v1.13.0
func (t TrustModelType) String() string
String converts a TrustModelType to a string
type TwoFactor ¶ added in v1.1.0
type TwoFactor struct { ID int64 `xorm:"pk autoincr"` UID int64 `xorm:"UNIQUE"` Secret string ScratchSalt string ScratchHash string LastUsedPasscode string `xorm:"VARCHAR(10)"` CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"` UpdatedUnix timeutil.TimeStamp `xorm:"INDEX updated"` }
TwoFactor represents a two-factor authentication token.
func GetTwoFactorByUID ¶ added in v1.1.0
GetTwoFactorByUID returns the two-factor authentication token associated with the user, if any.
func (*TwoFactor) GenerateScratchToken ¶ added in v1.1.0
GenerateScratchToken recreates the scratch token the user is using.
func (*TwoFactor) ValidateTOTP ¶ added in v1.1.0
ValidateTOTP validates the provided passcode.
func (*TwoFactor) VerifyScratchToken ¶ added in v1.1.0
VerifyScratchToken verifies if the specified scratch token is valid.
type U2FRegistration ¶ added in v1.5.0
type U2FRegistration struct { ID int64 `xorm:"pk autoincr"` Name string UserID int64 `xorm:"INDEX"` Raw []byte Counter uint32 `xorm:"BIGINT"` CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"` UpdatedUnix timeutil.TimeStamp `xorm:"INDEX updated"` }
U2FRegistration represents the registration data and counter of a security key
func CreateRegistration ¶ added in v1.5.0
func CreateRegistration(user *User, name string, reg *u2f.Registration) (*U2FRegistration, error)
CreateRegistration will create a new U2FRegistration from the given Registration
func GetU2FRegistrationByID ¶ added in v1.5.0
func GetU2FRegistrationByID(id int64) (*U2FRegistration, error)
GetU2FRegistrationByID returns U2F registration by id
func (*U2FRegistration) Parse ¶ added in v1.5.0
func (reg *U2FRegistration) Parse() (*u2f.Registration, error)
Parse will convert the db entry U2FRegistration to an u2f.Registration struct
func (U2FRegistration) TableName ¶ added in v1.5.0
func (reg U2FRegistration) TableName() string
TableName returns a better table name for U2FRegistration
func (*U2FRegistration) UpdateCounter ¶ added in v1.5.0
func (reg *U2FRegistration) UpdateCounter() error
UpdateCounter will update the database value of counter
type U2FRegistrationList ¶ added in v1.5.0
type U2FRegistrationList []*U2FRegistration
U2FRegistrationList is a list of *U2FRegistration
func GetU2FRegistrationsByUID ¶ added in v1.5.0
func GetU2FRegistrationsByUID(uid int64) (U2FRegistrationList, error)
GetU2FRegistrationsByUID returns all U2F registrations of the given user
func (U2FRegistrationList) ToRegistrations ¶ added in v1.5.0
func (list U2FRegistrationList) ToRegistrations() []u2f.Registration
ToRegistrations will convert all U2FRegistrations to u2f.Registrations
type Unit ¶ added in v1.1.0
Unit is a section of one repository
func (*Unit) CanDisable ¶ added in v1.2.0
CanDisable returns if this unit could be disabled.
func (Unit) IsLessThan ¶ added in v1.3.0
IsLessThan compares order of two units
type UnitConfig ¶ added in v1.1.0
type UnitConfig struct { }
UnitConfig describes common unit config
func (*UnitConfig) FromDB ¶ added in v1.1.0
func (cfg *UnitConfig) FromDB(bs []byte) error
FromDB fills up a UnitConfig from serialized format.
func (*UnitConfig) ToDB ¶ added in v1.1.0
func (cfg *UnitConfig) ToDB() ([]byte, error)
ToDB exports a UnitConfig to a serialized format.
type UnitType ¶ added in v1.1.0
type UnitType int
UnitType is Unit's Type
const ( UnitTypeCode UnitType = iota + 1 // 1 code UnitTypeIssues // 2 issues UnitTypePullRequests // 3 PRs UnitTypeReleases // 4 Releases UnitTypeWiki // 5 Wiki UnitTypeExternalWiki // 6 ExternalWiki UnitTypeExternalTracker // 7 ExternalTracker UnitTypeProjects // 8 Kanban board )
Enumerate all the unit types
func FindUnitTypes ¶ added in v1.6.0
FindUnitTypes give the unit key name and return unit
func (*UnitType) CanBeDefault ¶ added in v1.12.0
CanBeDefault checks if the unit type can be a default repo unit
func (*UnitType) CanDisable ¶ added in v1.12.0
CanDisable checks if this unit type can be disabled.
func (UnitType) ColorFormat ¶ added in v1.9.0
ColorFormat provides a ColorFormatted version of this UnitType
func (UnitType) UnitGlobalDisabled ¶ added in v1.12.0
UnitGlobalDisabled checks if unit type is global disabled
type UpdateOAuth2ApplicationOptions ¶ added in v1.8.0
type UpdateOAuth2ApplicationOptions struct { ID int64 Name string UserID int64 RedirectURIs []string }
UpdateOAuth2ApplicationOptions holds options to update an oauth2 application
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 User ¶
type User struct { ID int64 `xorm:"pk autoincr"` LowerName string `xorm:"UNIQUE NOT NULL"` Name string `xorm:"UNIQUE NOT NULL"` FullName string // Email is the primary email address (to be used for communication) Email string `xorm:"NOT NULL"` KeepEmailPrivate bool EmailNotificationsPreference string `xorm:"VARCHAR(20) NOT NULL DEFAULT 'enabled'"` Passwd string `xorm:"NOT NULL"` PasswdHashAlgo string `xorm:"NOT NULL DEFAULT 'argon2'"` // MustChangePassword is an attribute that determines if a user // is to change his/her password after registration. MustChangePassword bool `xorm:"NOT NULL DEFAULT false"` LoginType LoginType LoginSource int64 `xorm:"NOT NULL DEFAULT 0"` LoginName string Type UserType OwnedOrgs []*User `xorm:"-"` Orgs []*User `xorm:"-"` Repos []*Repository `xorm:"-"` Location string Website string Rands string `xorm:"VARCHAR(10)"` Salt string `xorm:"VARCHAR(10)"` Language string `xorm:"VARCHAR(5)"` Description string CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"` UpdatedUnix timeutil.TimeStamp `xorm:"INDEX updated"` LastLoginUnix timeutil.TimeStamp `xorm:"INDEX"` // Remember visibility choice for convenience, true for private LastRepoVisibility bool // Maximum repository creation limit, -1 means use global default MaxRepoCreation int `xorm:"NOT NULL DEFAULT -1"` // Permissions IsActive bool `xorm:"INDEX"` // Activate primary email IsAdmin bool IsRestricted bool `xorm:"NOT NULL DEFAULT false"` AllowGitHook bool AllowImportLocal bool // Allow migrate repository by local path AllowCreateOrganization bool `xorm:"DEFAULT true"` ProhibitLogin bool `xorm:"NOT NULL DEFAULT false"` // Avatar Avatar string `xorm:"VARCHAR(2048) NOT NULL"` AvatarEmail string `xorm:"NOT NULL"` UseCustomAvatar bool // Counters NumFollowers int NumFollowing int `xorm:"NOT NULL DEFAULT 0"` NumStars int NumRepos int // For organization NumTeams int NumMembers int Teams []*Team `xorm:"-"` Members UserList `xorm:"-"` MembersIsPublic map[int64]bool `xorm:"-"` Visibility structs.VisibleType `xorm:"NOT NULL DEFAULT 0"` RepoAdminChangeTeamAccess bool `xorm:"NOT NULL DEFAULT false"` // Preferences DiffViewStyle string `xorm:"NOT NULL DEFAULT ''"` Theme string `xorm:"NOT NULL DEFAULT ''"` KeepActivityPrivate bool `xorm:"NOT NULL DEFAULT false"` }
User represents the object of individual and member of organization.
func ExternalUserLogin ¶
func ExternalUserLogin(user *User, login, password string, source *LoginSource) (*User, error)
ExternalUserLogin attempts a login using external source types.
func GetAssigneesByIssue ¶ added in v1.5.0
GetAssigneesByIssue returns everyone assigned to that issue
func GetMaileableUsersByIDs ¶ added in v1.11.0
GetMaileableUsersByIDs gets users from ids, but only if they can receive mails
func GetOrgByName ¶
GetOrgByName returns organization by given name.
func GetOrgsByUserID ¶
GetOrgsByUserID returns a list of organizations that the given user ID has joined.
func GetOrgsCanCreateRepoByUserID ¶ added in v1.11.0
GetOrgsCanCreateRepoByUserID returns a list of organizations where given user ID are allowed to create repos.
func GetOwnedOrgsByUserID ¶
GetOwnedOrgsByUserID returns a list of organizations are owned by given user ID.
func GetOwnedOrgsByUserIDDesc ¶
GetOwnedOrgsByUserIDDesc returns a list of organizations are owned by given user ID, ordered descending by the given condition.
func GetTeamMembers ¶
GetTeamMembers returns all members in given team of organization.
func GetUserByEmail ¶
GetUserByEmail returns the user object by given e-mail if exists.
func GetUserByEmailContext ¶ added in v1.12.0
GetUserByEmailContext returns the user object by given e-mail if exists with db context
func GetUserByID ¶
GetUserByID returns the user object by given ID if exists.
func GetUserByName ¶
GetUserByName returns user by given name.
func GetUserByOpenID ¶ added in v1.2.0
GetUserByOpenID returns the user object by given OpenID if exists.
func LoginViaLDAP ¶
func LoginViaLDAP(user *User, login, password string, source *LoginSource) (*User, error)
LoginViaLDAP queries if login/password is valid against the LDAP directory pool, and create a local user if success when enabled.
func LoginViaPAM ¶
LoginViaPAM queries if login/password is valid against the PAM, and create a local user if success when enabled.
func LoginViaSMTP ¶
func LoginViaSMTP(user *User, login, password string, sourceID int64, cfg *SMTPConfig) (*User, error)
LoginViaSMTP queries if login/password is valid against the SMTP, and create a local user if success when enabled.
func NewGhostUser ¶
func NewGhostUser() *User
NewGhostUser creates and returns a fake user for someone has deleted his/her account.
func NewReplaceUser ¶ added in v1.12.0
NewReplaceUser creates and returns a fake user for external user
func SearchUsers ¶ added in v1.3.0
func SearchUsers(opts *SearchUserOptions) (users []*User, _ int64, _ error)
SearchUsers takes options i.e. keyword and part of user name to search, it returns results in given range and number of total results.
func UserSignIn ¶
UserSignIn validates user name and password.
func ValidateCommitWithEmail ¶
ValidateCommitWithEmail check if author's e-mail of commit is corresponding to a user.
func VerifyUserActiveCode ¶
VerifyUserActiveCode verifies active code when active account
func (*User) AccessibleReposEnv ¶ added in v1.1.0
func (org *User) AccessibleReposEnv(userID int64) (AccessibleReposEnvironment, error)
AccessibleReposEnv an AccessibleReposEnvironment for the repositories in `org` that are accessible to the specified user.
func (*User) AfterLoad ¶ added in v1.3.0
func (u *User) AfterLoad()
AfterLoad is invoked from XORM after filling all the fields of this object.
func (*User) AvatarLink ¶
AvatarLink returns user avatar absolute link.
func (*User) BeforeUpdate ¶
func (u *User) BeforeUpdate()
BeforeUpdate is invoked from XORM before updating this object.
func (*User) CanCreateOrgRepo ¶ added in v1.11.0
CanCreateOrgRepo returns true if given user can create repo in organization
func (*User) CanCreateOrganization ¶ added in v1.1.0
CanCreateOrganization returns true if user can create organisation.
func (*User) CanCreateRepo ¶
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 (*User) CanEditGitHook ¶
CanEditGitHook returns true if user can edit Git hooks.
func (*User) CanImportLocal ¶
CanImportLocal returns true if user can migrate repository by local path.
func (*User) ColorFormat ¶ added in v1.9.0
ColorFormat writes a colored string to identify this struct
func (*User) CustomAvatarRelativePath ¶ added in v1.13.0
CustomAvatarRelativePath returns user custom avatar relative path.
func (*User) DashboardLink ¶
DashboardLink returns the user dashboard page link.
func (*User) DeleteAvatar ¶
DeleteAvatar deletes the user's custom avatar.
func (*User) DisplayName ¶
DisplayName returns full name if it's not empty, returns username otherwise.
func (*User) EmailNotifications ¶ added in v1.10.0
EmailNotifications returns the User's email notification preference
func (*User) GenerateActivateCode ¶
GenerateActivateCode generates an activate code based on user information.
func (*User) GenerateEmailActivateCode ¶
GenerateEmailActivateCode generates an activate code based on user information and given e-mail.
func (*User) GenerateRandomAvatar ¶
GenerateRandomAvatar generates a random avatar for user.
func (*User) GetAccessRepoIDs ¶ added in v1.1.0
GetAccessRepoIDs returns all repositories IDs where user's or user is a team member organizations Caller shall check that units is not globally disabled
func (*User) GetAccessibleRepositories ¶
func (user *User) GetAccessibleRepositories(limit int) (repos []*Repository, _ error)
GetAccessibleRepositories finds repositories which the user has access but does not own. If limit is smaller than 1 means returns all found results.
func (*User) GetDisplayName ¶ added in v1.9.0
GetDisplayName returns full name if it's not empty and DEFAULT_SHOW_FULL_NAME is set, returns username otherwise.
func (*User) GetEmail ¶ added in v1.9.0
GetEmail returns an noreply email, if the user has set to keep his email address private, otherwise the primary email address.
func (*User) GetFollowers ¶
func (u *User) GetFollowers(listOptions ListOptions) ([]*User, error)
GetFollowers returns range of user's followers.
func (*User) GetFollowing ¶
func (u *User) GetFollowing(listOptions ListOptions) ([]*User, error)
GetFollowing returns range of user's following.
func (*User) GetMembers ¶
GetMembers returns all members of organization.
func (*User) GetMirrorRepositories ¶
func (u *User) GetMirrorRepositories() ([]*Repository, error)
GetMirrorRepositories returns mirror repositories that user owns, including private repositories.
func (*User) GetOrgRepositoryIDs ¶ added in v1.1.0
GetOrgRepositoryIDs returns repositories IDs where user's team owned and has unittypes Caller shall check that units is not globally disabled
func (*User) GetOrganizationCount ¶
GetOrganizationCount returns count of membership of organization of user.
func (*User) GetOrganizations ¶
func (u *User) GetOrganizations(opts *SearchOrganizationsOptions) error
GetOrganizations returns paginated organizations that user belongs to. TODO: does not respect All and show orgs you privately participate
func (*User) GetOwnedOrganizations ¶
GetOwnedOrganizations returns all organizations that user owns.
func (*User) GetOwnerTeam ¶
GetOwnerTeam returns owner team of organization.
func (*User) GetRepositories ¶
func (u *User) GetRepositories(listOpts ListOptions, names ...string) (err error)
GetRepositories returns repositories that user owns, including private repositories.
func (*User) GetRepositoryAccesses ¶
func (user *User) GetRepositoryAccesses() (map[*Repository]AccessMode, error)
GetRepositoryAccesses finds all repositories with their access mode where a user has access but does not own.
func (*User) GetRepositoryIDs ¶ added in v1.1.0
GetRepositoryIDs returns repositories IDs where user owned and has unittypes Caller shall check that units is not globally disabled
func (*User) GetStarredRepoCount ¶ added in v1.1.0
GetStarredRepoCount returns the numbers of repo the user starred.
func (*User) GetStarredRepos ¶ added in v1.1.0
func (u *User) GetStarredRepos(private bool, page, pageSize int, orderBy string) (repos RepositoryList, err error)
GetStarredRepos returns the repos the user starred.
func (*User) GetTeams ¶
func (org *User) GetTeams(opts *SearchTeamOptions) error
GetTeams returns paginated teams that belong to organization.
func (*User) GetUserTeamIDs ¶
GetUserTeamIDs returns of all team IDs of the organization that user is member of.
func (*User) GetUserTeams ¶
GetUserTeams returns all teams that belong to user, and that the user has joined.
func (*User) HasForkedRepo ¶
HasForkedRepo checks if user has already forked a repository with given ID.
func (*User) HasMemberWithUserID ¶ added in v1.12.4
HasMemberWithUserID returns true if user with userID is part of the u organisation.
func (*User) HashPassword ¶ added in v1.4.0
HashPassword hashes a password using the algorithm defined in the config value of PASSWORD_HASH_ALGO.
func (*User) IsFollowing ¶
IsFollowing returns true if user is following followID.
func (*User) IsMailable ¶ added in v1.1.0
IsMailable checks if a user is eligible to receive emails.
func (*User) IsOrgMember ¶
IsOrgMember returns true if given user is member of organization.
func (*User) IsOrganization ¶
IsOrganization returns true if user is actually a organization.
func (*User) IsPasswordSet ¶ added in v1.1.0
IsPasswordSet checks if the password is set or left empty
func (*User) IsPublicMember ¶
IsPublicMember returns true if user public his/her membership in given organization.
func (*User) IsUserOrgOwner ¶
IsUserOrgOwner returns true if user is in the owner team of given organization.
func (*User) MaxCreationLimit ¶ added in v1.2.0
MaxCreationLimit returns the number of repositories a user is allowed to create
func (*User) RealSizedAvatarLink ¶ added in v1.10.0
RealSizedAvatarLink returns a link to the user's avatar. When applicable, the link is for an avatar of the indicated size (in pixels).
This function make take time to return when federated avatars are in use, due to a DNS lookup need
func (*User) RelAvatarLink ¶
RelAvatarLink returns a relative link to the user's avatar. The link may either be a sub-URL to this site, or a full URL to an external avatar service.
func (*User) RemoveMember ¶
RemoveMember removes member from organization.
func (*User) RemoveOrgRepo ¶
RemoveOrgRepo removes all team-repository relations of organization.
func (*User) SetEmailNotifications ¶ added in v1.10.0
SetEmailNotifications sets the user's email notification preference
func (*User) SetLastLogin ¶ added in v1.0.0
func (u *User) SetLastLogin()
SetLastLogin set time to last login
func (*User) SizedRelAvatarLink ¶ added in v1.3.2
SizedRelAvatarLink returns a link to the user's avatar via the local explore page. Function returns immediately. When applicable, the link is for an avatar of the indicated size (in pixels).
func (*User) TeamsWithAccessToRepo ¶ added in v1.3.0
func (org *User) TeamsWithAccessToRepo(repoID int64, mode AccessMode) ([]*Team, error)
TeamsWithAccessToRepo returns all teams that have given access level to the repository.
func (*User) UpdateDiffViewStyle ¶ added in v1.0.0
UpdateDiffViewStyle updates the users diff view style
func (*User) UpdateTheme ¶ added in v1.8.0
UpdateTheme updates a users' theme irrespective of the site wide theme
func (*User) UploadAvatar ¶
UploadAvatar saves custom avatar for user. FIXME: split uploads to different subdirs in case we have massive users.
func (*User) ValidatePassword ¶
ValidatePassword checks if given password matches the one belongs to the user.
type UserCommit ¶
UserCommit represents a commit with validation of user.
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 *User) ([]*UserHeatmapData, error)
GetUserHeatmapDataByUser 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 UserRepoIDs []int64 FilterMode int IsPull bool IsClosed bool IssueIDs []int64 LabelIDs []int64 }
UserIssueStatsOptions contains parameters accepted by GetUserIssueStats.
type UserList ¶ added in v1.10.0
type UserList []*User
UserList is a list of user. This type provide valuable methods to retrieve information for a group of users efficiently.
func FindOrgMembers ¶ added in v1.11.0
func FindOrgMembers(opts *FindOrgMembersOpts) (UserList, map[int64]bool, error)
FindOrgMembers loads organization members according conditions
func GetUsersByIDs ¶ added in v1.0.0
GetUsersByIDs returns all resolved users from a list of Ids.
func (UserList) GetTwoFaStatus ¶ added in v1.10.0
GetTwoFaStatus return state of 2FA enrollement
type UserOpenID ¶ added in v1.2.0
type UserOpenID struct { ID int64 `xorm:"pk autoincr"` UID int64 `xorm:"INDEX NOT NULL"` URI string `xorm:"UNIQUE NOT NULL"` Show bool `xorm:"DEFAULT false"` }
UserOpenID is the list of all OpenID identities of a user.
func GetUserOpenIDs ¶ added in v1.2.0
func GetUserOpenIDs(uid int64) ([]*UserOpenID, error)
GetUserOpenIDs returns all openid addresses that belongs to given user.
type Watch ¶
type Watch struct { ID int64 `xorm:"pk autoincr"` UserID int64 `xorm:"UNIQUE(watch)"` RepoID int64 `xorm:"UNIQUE(watch)"` Mode RepoWatchMode `xorm:"SMALLINT NOT NULL DEFAULT 1"` CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"` UpdatedUnix timeutil.TimeStamp `xorm:"INDEX updated"` }
Watch is connection request for receiving repository notification.
func GetWatchers ¶
GetWatchers returns all watchers of given repository.
type Webhook ¶
type Webhook struct { ID int64 `xorm:"pk autoincr"` RepoID int64 `xorm:"INDEX"` // An ID of 0 indicates either a default or system webhook OrgID int64 `xorm:"INDEX"` IsSystemWebhook bool URL string `xorm:"url TEXT"` Signature string `xorm:"TEXT"` HTTPMethod string `xorm:"http_method"` ContentType HookContentType Secret string `xorm:"TEXT"` Events string `xorm:"TEXT"` *HookEvent `xorm:"-"` IsSSL bool `xorm:"is_ssl"` IsActive bool `xorm:"INDEX"` HookTaskType HookTaskType Meta string `xorm:"TEXT"` // store hook-specific attributes LastStatus HookStatus // Last delivery status CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"` UpdatedUnix timeutil.TimeStamp `xorm:"INDEX updated"` }
Webhook represents a web hook object.
func GetActiveWebhooksByOrgID ¶
GetActiveWebhooksByOrgID returns all active webhooks for an organization.
func GetActiveWebhooksByRepoID ¶
GetActiveWebhooksByRepoID returns all active webhooks of repository.
func GetDefaultWebhook ¶ added in v1.9.0
GetDefaultWebhook returns admin-default webhook by given ID.
func GetDefaultWebhooks ¶ added in v1.9.0
GetDefaultWebhooks returns all admin-default webhooks.
func GetSystemWebhook ¶ added in v1.12.0
GetSystemWebhook returns admin system webhook by given ID.
func GetSystemWebhooks ¶ added in v1.12.0
GetSystemWebhooks returns all admin system webhooks.
func GetWebhookByID ¶ added in v1.3.0
GetWebhookByID returns webhook of repository by given ID.
func GetWebhookByOrgID ¶
GetWebhookByOrgID returns webhook of organization by given ID.
func GetWebhookByRepoID ¶
GetWebhookByRepoID returns webhook of repository by given ID.
func GetWebhooksByOrgID ¶
func GetWebhooksByOrgID(orgID int64, listOptions ListOptions) ([]*Webhook, error)
GetWebhooksByOrgID returns paginated webhooks for an organization.
func GetWebhooksByRepoID ¶
func GetWebhooksByRepoID(repoID int64, listOptions ListOptions) ([]*Webhook, error)
GetWebhooksByRepoID returns all webhooks of a repository.
func (*Webhook) AfterLoad ¶ added in v1.3.0
func (w *Webhook) AfterLoad()
AfterLoad updates the webhook object upon setting a column
func (*Webhook) EventCheckers ¶ added in v1.11.0
func (w *Webhook) EventCheckers() []struct { Has func() bool Type HookEventType }
EventCheckers returns event checkers
func (*Webhook) EventsArray ¶
EventsArray returns an array of hook events
func (*Webhook) HasCreateEvent ¶
HasCreateEvent returns true if hook enabled create event.
func (*Webhook) HasDeleteEvent ¶ added in v1.5.0
HasDeleteEvent returns true if hook enabled delete event.
func (*Webhook) HasForkEvent ¶ added in v1.5.0
HasForkEvent returns true if hook enabled fork event.
func (*Webhook) HasIssueCommentEvent ¶ added in v1.5.0
HasIssueCommentEvent returns true if hook enabled issue_comment event.
func (*Webhook) HasIssuesAssignEvent ¶ added in v1.12.0
HasIssuesAssignEvent returns true if hook enabled issues assign event.
func (*Webhook) HasIssuesEvent ¶ added in v1.5.0
HasIssuesEvent returns true if hook enabled issues event.
func (*Webhook) HasIssuesLabelEvent ¶ added in v1.12.0
HasIssuesLabelEvent returns true if hook enabled issues label event.
func (*Webhook) HasIssuesMilestoneEvent ¶ added in v1.12.0
HasIssuesMilestoneEvent returns true if hook enabled issues milestone event.
func (*Webhook) HasPullRequestApprovedEvent ¶ added in v1.12.0
HasPullRequestApprovedEvent returns true if hook enabled pull request review event.
func (*Webhook) HasPullRequestAssignEvent ¶ added in v1.12.0
HasPullRequestAssignEvent returns true if hook enabled pull request assign event.
func (*Webhook) HasPullRequestCommentEvent ¶ added in v1.12.0
HasPullRequestCommentEvent returns true if hook enabled pull_request_comment event.
func (*Webhook) HasPullRequestEvent ¶
HasPullRequestEvent returns true if hook enabled pull request event.
func (*Webhook) HasPullRequestLabelEvent ¶ added in v1.12.0
HasPullRequestLabelEvent returns true if hook enabled pull request label event.
func (*Webhook) HasPullRequestMilestoneEvent ¶ added in v1.12.0
HasPullRequestMilestoneEvent returns true if hook enabled pull request milestone event.
func (*Webhook) HasPullRequestRejectedEvent ¶ added in v1.12.0
HasPullRequestRejectedEvent returns true if hook enabled pull request review event.
func (*Webhook) HasPullRequestReviewCommentEvent ¶ added in v1.12.0
HasPullRequestReviewCommentEvent returns true if hook enabled pull request review event.
func (*Webhook) HasPullRequestSyncEvent ¶ added in v1.12.0
HasPullRequestSyncEvent returns true if hook enabled pull request sync event.
func (*Webhook) HasPushEvent ¶
HasPushEvent returns true if hook enabled push event.
func (*Webhook) HasReleaseEvent ¶ added in v1.5.0
HasReleaseEvent returns if hook enabled release event.
func (*Webhook) HasRepositoryEvent ¶ added in v1.3.0
HasRepositoryEvent returns if hook enabled repository event.
func (*Webhook) UpdateEvent ¶
UpdateEvent handles conversion from HookEvent to Events.
type WhitelistOptions ¶ added in v1.7.0
type WhitelistOptions struct { UserIDs []int64 TeamIDs []int64 MergeUserIDs []int64 MergeTeamIDs []int64 ApprovalsUserIDs []int64 ApprovalsTeamIDs []int64 }
WhitelistOptions represent all sorts of whitelists used for protected branches
type XORMLogBridge ¶ added in v1.9.0
type XORMLogBridge struct {
// contains filtered or unexported fields
}
XORMLogBridge a logger bridge from Logger to xorm
func (*XORMLogBridge) Debug ¶ added in v1.9.0
func (l *XORMLogBridge) Debug(v ...interface{})
Debug show debug log
func (*XORMLogBridge) Debugf ¶ added in v1.9.0
func (l *XORMLogBridge) Debugf(format string, v ...interface{})
Debugf show debug log
func (*XORMLogBridge) Error ¶ added in v1.9.0
func (l *XORMLogBridge) Error(v ...interface{})
Error show error log
func (*XORMLogBridge) Errorf ¶ added in v1.9.0
func (l *XORMLogBridge) Errorf(format string, v ...interface{})
Errorf show error log
func (*XORMLogBridge) Info ¶ added in v1.9.0
func (l *XORMLogBridge) Info(v ...interface{})
Info show information level log
func (*XORMLogBridge) Infof ¶ added in v1.9.0
func (l *XORMLogBridge) Infof(format string, v ...interface{})
Infof show information level log
func (*XORMLogBridge) IsShowSQL ¶ added in v1.9.0
func (l *XORMLogBridge) IsShowSQL() bool
IsShowSQL if record SQL
func (*XORMLogBridge) Level ¶ added in v1.9.0
func (l *XORMLogBridge) Level() xormlog.LogLevel
Level get logger level
func (*XORMLogBridge) SetLevel ¶ added in v1.9.0
func (l *XORMLogBridge) SetLevel(lvl xormlog.LogLevel)
SetLevel set the logger level
func (*XORMLogBridge) ShowSQL ¶ added in v1.9.0
func (l *XORMLogBridge) ShowSQL(show ...bool)
ShowSQL set if record SQL
func (*XORMLogBridge) Warn ¶ added in v1.9.0
func (l *XORMLogBridge) Warn(v ...interface{})
Warn show warning log
func (*XORMLogBridge) Warnf ¶ added in v1.9.0
func (l *XORMLogBridge) Warnf(format string, v ...interface{})
Warnf show warnning log
Source Files ¶
- access.go
- action.go
- action_list.go
- admin.go
- attachment.go
- avatar.go
- branches.go
- commit_status.go
- consistency.go
- context.go
- convert.go
- error.go
- error_oauth2.go
- external_login_user.go
- fixture_generation.go
- gpg_key.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
- list_options.go
- log.go
- login_source.go
- migrate.go
- models.go
- notification.go
- oauth2.go
- oauth2_application.go
- org.go
- org_team.go
- project.go
- project_board.go
- project_issue.go
- pull.go
- pull_list.go
- pull_sign.go
- release.go
- repo.go
- repo_activity.go
- repo_avatar.go
- repo_branch.go
- repo_collaboration.go
- repo_generate.go
- repo_indexer.go
- repo_issue.go
- repo_language_stats.go
- repo_list.go
- repo_mirror.go
- repo_permission.go
- repo_redirect.go
- repo_sign.go
- repo_unit.go
- repo_watch.go
- review.go
- sql_postgres_with_schema.go
- ssh_key.go
- star.go
- task.go
- test_fixtures.go
- token.go
- topic.go
- twofactor.go
- u2f.go
- unit.go
- unit_tests.go
- update.go
- upload.go
- user.go
- user_avatar.go
- user_follow.go
- user_heatmap.go
- user_mail.go
- user_openid.go
- userlist.go
- webhook.go
- wiki.go