# Packages
No description provided by the author
No description provided by the author
No description provided by the author
# Functions
AddDeployKey add new deploy key to database and authorized_keys file.
No description provided by the author
No description provided by the author
AddOrgUser adds new user to given organization.
AddPublicKey adds new public key to database and authorized_keys file.
AddTeamMember adds new membership of given team to given organization, the user will have membership to given organization automatically when needed.
AddTeamRepo adds new repository relation to team.
AddTestPullRequestTask adds new test tasks by given head/base repository and head/base branch, and generate new patch for testing as needed.
AttachmentLocalPath returns where attachment is stored in local file system based on given UUID.
ChangeMilestoneAssign changes assignment of milestone for issue.
ChangeMilestoneIssueStats updates the open/closed issues counter and progress for the milestone associated with the given issue.
ChangeMilestoneStatus changes the milestone open/closed status.
ChangeOrgUserStatus changes public or private membership status.
ChangeRepositoryName changes all corresponding setting from old repository name to new one.
CheckPublicKeyString checks if the given public key string is recognized by SSH.
No description provided by the author
Finish migrating repository and/or wiki with things that don't need to be done for mirrors.
No description provided by the author
No description provided by the author
CommitToPushCommit transforms a git.Commit to PushCommit type.
No description provided by the author
CountNotices returns number of notices.
CountOrganizations returns number of organizations.
CountRepoClosedMilestones returns number of closed milestones in given repository.
CountRepoMilestones returns number of milestones in given repository.
CountRepositories returns number of repositories.
CountUserRepositories returns number of repositories user owns.
CreateComment creates comment of issue or commit.
CreateIssueComment creates a plain issue comment.
CreateNotice creates new system notice.
CreateOrganization creates record of a new organization.
CreateRefComment creates a commit reference comment to issue.
CreateRepository creates a repository for given user or organization.
CreateRepositoryNotice creates new system notice with type NOTICE_REPOSITORY.
CreateWebhook creates a new web hook.
DeleteAttachment deletes the given attachment and optionally the associated file.
DeleteAttachments deletes the given attachments and optionally the associated files.
DeleteAttachmentsByComment deletes all attachments associated with the given comment.
DeleteAttachmentsByIssue deletes all attachments associated with the given issue.
DeleteCollaboration removes collaboration relation between the user and repository.
DeleteCommentByID deletes the comment by given ID.
DeleteDeployKey deletes deploy key from its repository authorized_keys file if needed.
No description provided by the author
No description provided by the author
DeleteIssueLabel deletes issue-label relation.
DeleteLabel delete a label of given repository.
DeleteMilestoneOfRepoByID deletes a milestone from a repository.
No description provided by the author
DeleteMissingRepositories deletes all repository records that lost Git files.
DeleteNotice deletes a system notice by given ID.
DeleteNotices deletes all notices with ID from start to end (inclusive).
DeleteNoticesByIDs deletes notices by given IDs.
No description provided by the author
DeleteOrganization completely and permanently deletes everything of organization.
DeletePublicKey deletes SSH key information both in database and authorized_keys file.
DeleteReleaseOfRepoByID deletes a release and corresponding Git tag by given ID.
DeleteRepository deletes a repository for a user or organization.
DeleteRepositoryArchives deletes all repositories' archives.
DeleteTeam deletes given team.
DeleteTwoFactor removes two-factor authentication token and recovery codes of given user.
No description provided by the author
No description provided by the author
No description provided by the author
DeleteWebhookOfOrgByID deletes webhook of organization by given ID.
DeleteWebhookOfRepoByID deletes webhook of repository by given ID.
DeliverHooks checks and delivers undelivered hooks.
No description provided by the author
No description provided by the author
No description provided by the author
DumpDatabase dumps all data from database to file system in JSON Lines format.
FilterRepositoryWithIssues selects repositories that are using internal issue tracker and has disabled external tracker from given set.
ForkRepository creates a fork of target repository under another user domain.
GetAttachmentByUUID returns attachment by given UUID.
GetAttachmentsByCommentID returns all attachments of a comment.
GetAttachmentsByIssueID returns all attachments of an issue.
GetAttachmentsByReleaseID returns all attachments of a release.
No description provided by the author
GetCommentByID returns the comment by given ID.
GetCommentsByIssueID returns all comments of an issue.
GetCommentsByIssueIDSince returns a list of comments of an issue since a given time point.
GetCommentsByRepoIDSince returns a list of comments for all issues in a repo since a given time point.
GetDeployKeyByID returns deploy key by given ID.
GetDeployKeyByRepo returns deploy key by given public key ID and repository ID.
TODO: add content.
No description provided by the author
GetDraftReleasesByRepoID returns all draft releases of repository.
GetEmailAddresses returns all email addresses belongs to given user.
GetHookTaskOfWebhookByUUID returns hook task of given webhook by UUID.
GetIssueByID returns an issue by given ID.
GetIssueByIndex returns issue by index in a repository.
GetIssueByRef returns an Issue specified by a GFM reference, e.g.
GetIssueLabels returns all issue-label relations of given issue by ID.
GetIssueStats returns issue statistic information by given conditions.
GetIssueUserPairsByMode returns issue-user pairs by given repository and user.
GetIssueUserPairsByRepoIds returns issue-user pairs by given repository IDs.
GetIssueUsers returns issue-user pairs by given repository and user.
GetLabelByID returns a label by given ID.
GetLabelOfRepoByID returns a label by ID in given repository.
GetLabelOfRepoByName returns a label by name in given repository.
GetLabelsByIssueID returns all labels that belong to given issue by ID.
GetLabelsByRepoID returns all labels that belong to given repository by ID.
GetLabelsInRepoByIDs returns a list of labels by IDs in given repository, it silently ignores label IDs that are not belong to the repository.
GetLabelTemplateFile loads the label template file by given name, then parses and returns a list of name-color pairs.
GetWebhookByRepoID returns the milestone in a repository.
GetMilestones returns a list of milestones of given repository and status.
GetMilestonesByRepoID returns all milestones of a repository.
GetMirrorByRepoID returns mirror information of a repository.
GetRepositoriesMirror returns only mirror repositories with user.
GetOrgByName returns organization by given name.
GetOrgsByUserID returns a list of organizations that the given user ID has joined.
GetOrgUsersByOrgID returns all organization-user relations by organization ID.
GetOwnedOrgsByUserID returns a list of organizations are owned by given user ID.
GetOwnedOrganizationsByUserIDDesc returns a list of organizations are owned by given user ID, ordered descending by the given condition.
GetParticipantsByIssueID returns all users who are participated in comments of an issue.
GetProtectBranchesByRepoID returns a list of *ProtectBranch in given repository.
GetProtectBranchOfRepoByName returns *ProtectBranch by branch name in given repository.
GetPublicKeyByID returns public key by given ID.
GetPublishedReleasesByRepoID returns a list of published releases of repository.
GetPullRequestByID returns a pull request by given ID.
GetPullRequestByIssueID returns pull request by given issue ID.
GetRawIssueByIndex returns raw issue without loading attributes by index in a repository.
GetRecentUpdatedRepositories returns the list of repositories that are recently updated.
GetRecoveryCodesByUserID returns all recovery codes of given user.
GetRelease returns release by given ID.
GetReleaseByID returns release with given ID.
GetReleasesByRepoID returns a list of all releases (including drafts) of given repository.
GetRepoIssueStats returns number of open and closed repository issues by given filter mode.
GetRepositoriesByForkID returns all repositories with given fork ID.
GetRepositoryByID returns the repository by given id if exists.
GetRepositoryByName returns the repository by given name under user if exists.
GetRepositoryByRef returns a Repository specified by a GFM reference.
No description provided by the author
No description provided by the author
No description provided by the author
GetTeamByID returns team by given ID.
GetTeamMembers returns all members in given team of organization.
GetTeamOfOrgByName returns team by given team name and organization.
GetTeamsByOrgID returns all teams belong to given organization.
GetTeamsHaveAccessToRepo returns all teams in an organization that have given access level to the repository.
GetUnmergedPullRequest returns a pull request that is open and has not been merged by given head/base and repo/branch.
GetUnmergedPullRequestsByBaseInfo returns all pull requests that are open and has not been merged by given base information (repo and branch).
GetUnmergedPullRequestsByHeadInfo returns all pull requests that are open and has not been merged by given head information (repo and branch).
No description provided by the author
No description provided by the author
GetUserAndCollaborativeRepositories returns list of repositories the user owns and collaborates.
GetUserIssueStats returns issue statistic information for dashboard by given conditions.
GetUserRepositories returns a list of mirror repositories of given user.
GetUserRepositories returns a list of repositories of given user.
GetUserTeams returns all teams that user belongs to in given organization.
GetWatchers returns all watchers of given repository.
GetWebhookByID returns webhook by given ID.
GetWebhookByOrgID returns webhook of organization by given ID.
GetWebhookOfRepoByID returns webhook of repository by given ID.
GetWebhooksByOrgID returns all webhooks for an organization.
GetWebhooksByRepoID returns all webhooks of a repository.
GitFsck calls 'git fsck' to check repository health.
No description provided by the author
HandleMirrorCredentials replaces user credentials from HTTP/HTTPS URL with placeholder <credentials>.
HasDeployKey returns true if public key is a deploy key of given repository.
HasForkedRepo checks if given user has already forked a repository.
HasIssueLabel returns true if issue has been labeled.
HasTeamRepo returns true if given team has access to the repository of the organization.
HookTasks returns a list of hook tasks by given conditions.
ImportDatabase imports data from backup archive in JSON Lines format.
Init initializes the database with given logger.
No description provided by the author
No description provided by the author
No description provided by the author
IsBranchOfRepoRequirePullRequest returns true if branch requires pull request in given repository.
IsCollaborator returns true if the user is a collaborator of the repository.
IsEmailUsed returns true if the email has been used.
No description provided by the author
IsErrAccessTokenNotExist returns true if the underlying error has the type ErrAccessTokenNotExist.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
IsErrEmailAddressNotExist returns true if the underlying error has the type ErrEmailNotExist.
IsErrEmailAlreadyUsed returns true if the underlying error has the type ErrEmailAlreadyUsed.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
IsErrLoginSourceMismatch returns true if the underlying error has the type ErrLoginSourceMismatch.
No description provided by the author
No description provided by the author
IsErrNameNotAllowed returns true if the underlying error has the type ErrNameNotAllowed.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
IsErrUserAlreadyExist returns true if the underlying error has the type ErrUserAlreadyExist.
IsErrUserHasOrgs returns true if the underlying error has the type ErrUserHasOrgs.
IsErrUserNotExist returns true if the underlying error has the type ErrUserNotExist.
IsErrUserOwnRepos returns true if the underlying error has the type ErrUserOwnRepos.
No description provided by the author
No description provided by the author
No description provided by the author
IsOrganizationMember returns true if given user is member of organization.
IsOrganizationOwner returns true if given user is in the owner team.
IsPublicMembership returns true if given user public his/her membership.
IsReleaseExist returns true if release with given tag name already exists.
IsRepositoryExist returns true if the repository with given name under user has already existed.
IsStaring checks if user has starred given repository.
Issues returns a list of issues by given conditions.
IssuesCount returns the number of issues by given conditions.
IsTeamMember returns true if given user is a member of team.
No description provided by the author
IsUsableTeamName return an error if given name is a reserved name or pattern.
IsUserInProtectBranchWhitelist returns true if given user is in the whitelist of a branch in a repository.
IsValidHookContentType returns true if given name is a valid hook content type.
IsValidHookTaskType returns true if given name is a valid hook task type.
IsWatching checks if user has watched given repository.
ListDeployKeys returns all deploy keys by given repository ID.
ListPublicKeys returns a list of public keys belongs to given user.
No description provided by the author
No description provided by the author
MarkdownLinkFormatter formats link address and title into Markdown style.
MigrateRepository migrates a existing repository from other project hosting.
MilestoneStats returns number of open and closed milestones of given repository.
MirrorUpdate checks and updates mirror repositories.
NewActionsStore returns a persistent interface for actions with given database connection.
NewAttachment creates a new attachment object.
No description provided by the author
NewEmailAddressesStore returns a persistent interface for email addresses with given database connection.
No description provided by the author
NewGhostUser creates and returns a fake user for people who has deleted their accounts.
NewIssue creates new issue with labels and attachments for repository.
NewIssueLabel creates a new issue-label relation.
NewIssueLabels creates a list of issue-label relations.
NewIssueUsers adds new issue-user relations for new issue of repository.
NewLabels creates new label(s) for a repository.
No description provided by the author
No description provided by the author
No description provided by the author
NewMilestone creates new milestone of repository.
NewOrgsStore returns a persistent interface for orgs with given database connection.
NewPermsStore returns a persistent interface for permissions with given database connection.
NewPublicKeysStore returns a persistent interface for public keys with given database connection.
NewPullRequest creates new pull request with labels for repository.
NewPushCommits returns a new PushCommits.
NewRelease creates a new release with attachments for repository.
No description provided by the author
NewReposStore returns a persistent interface for repositories with given database connection.
NewTeam creates a record of new team.
No description provided by the author
NewUpload creates a new upload object.
NewUsersStore returns a persistent interface for users with given database connection.
Notices returns number of notices in given page.
NotifyWatchers creates batch of actions for every watcher.
Organizations returns number of organizations in given page.
PairsContains returns true when pairs list contains given issue.
ParseAccessMode returns corresponding access mode to given permission string.
No description provided by the author
PrepareWebhooks adds all active webhooks to task queue.
PushUpdate must be called for any push actions in order to generates necessary push action history feeds.
RegenerateRecoveryCodes regenerates new set of recovery codes for given user.
ReinitMissingRepositories reinitializes all repository records that lost Git files.
RemoveAllWithNotice removes all directories in given path and creates a system notice when error occurs.
RemoveOrgRepo removes all team-repository relations of given organization.
RemoveOrgUser removes user from given organization.
RemoveTeamMember removes member from given team of given organization.
RemoveTeamRepo deletes repository relation to team.
RepoPath returns repository path by given user and repository name.
No description provided by the author
RepositoriesWithUsers returns number of repos in given page.
RewriteAuthorizedKeys removes any authorized key and rewrite all keys from database again.
SearchPublicKeyByContent searches a public key using the content as prefix (i.e.
SearchRepositoryByName takes keyword and part of repository name to search, it returns results in given range and number of total results.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
see: https://api.slack.com/docs/formatting.
SortReleases sorts releases by number of commits and created time.
SSHKeyGenParsePublicKey extracts key type and length using ssh-keygen.
SSHNativeParsePublicKey extracts the key type and length using the golang SSH library.
Star or unstar repository.
SyncMirrors checks and syncs mirrors.
SyncRepositoryHooks rewrites all repositories' pre-receive, update and post-receive hooks to make sure the binary and custom conf path are up-to-date.
TestPullRequests checks and tests untested patches of pull requests.
TestWebhook adds the test webhook matches the ID to task queue.
ToHookContentType returns HookContentType by given name.
ToHookTaskType returns HookTaskType by given name.
ToWikiPageName formats a URL back to corresponding wiki page name, and removes leading characters './' to prevent changing files that are not belong to wiki repository.
ToWikiPageURL formats a string to corresponding wiki URL name.
TransferOwnership transfers all corresponding setting from old user to new one.
UpdateComment updates information of comment.
UpdateDeployKey updates deploy key information.
UpdateHookTask updates information of hook task.
UpdateIssue updates all fields of given issue.
UpdateIssueCols only updates values of specific columns for given issue.
UpdateIssueUserByAssignee updates issue-user relation for assignee.
UpdateIssueUserByRead updates issue-user relation for reading.
UpdateIssueUsersByStatus updates issue-user relations by issue status.
UpdateLabel updates label information.
UpdateLocalCopy fetches latest changes of given branch from repoPath to localPath.
UpdateMilestone updates information of given milestone.
No description provided by the author
UpdateOrgProtectBranch saves branch protection options of organizational repository.
UpdateProtectBranch saves branch protection options.
UpdatePublicKey updates given public key.
UpdateRelease updates information of a release.
No description provided by the author
UpdateTeam updates information of team.
UpdateWebhook updates information of webhook.
UploadLocalPath returns where uploads is stored in local file system based on given UUID.
UseRecoveryCode validates recovery code of given user and marks it is used if valid.
Watch or unwatch repository.
WikiPath returns wiki data path by given user and repository name.
# Constants
3.
0.
4.
1.
2.
12.
14.
10.
5.
16.
6.
7.
1.
17.
18.
19.
11.
21.
22.
20.
9.
2.
13.
15.
3.
8.
4.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Plain comment, can be associated with a commit (CommitID > 0) and a line (LineNum > 0).
Reference from a comment.
Reference from a commit (not part of a pull request).
References.
Reference from a pull request.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
REPO_AVATAR_URL_PREFIX is used to identify a URL is to access repository avatar.
No description provided by the author
NOTE: Historic reason to make it starts at 0.
No description provided by the author
# Variables
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Maximum items per page in forks, watchers and stars of a repo.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Tables is the list of struct-to-table mappings.
No description provided by the author
No description provided by the author
# Structs
Access represents the highest access level of a user has to a repository.
No description provided by the author
AccessToken is a personal access token.
Action is a user operation to a repository.
Attachment represent a attachment of issue/comment/release.
No description provided by the author
Collaboration represent the relation between an individual and a repository.
Collaborator represents a user with collaboration details.
Comment represents a comment in commit and issue page.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
DeployKey represents deploy key information and its relation with repository.
Refer: https://open-doc.dingtalk.com/docs/doc.htm?treeId=257&articleId=105735&docType=1.
Refer: https://open-doc.dingtalk.com/docs/doc.htm?treeId=257&articleId=105735&docType=1.
Refer: https://open-doc.dingtalk.com/docs/doc.htm?treeId=257&articleId=105735&docType=1.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
EmailAddresses is the list of all email addresses of a user.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Follow represents relations of users and their followers.
HookEvent represents events that will delivery hook.
No description provided by the author
HookRequest represents hook task request information.
HookResponse represents hook task response information.
HookTask represents a hook task.
Issue represents an issue or pull request of repository.
IssueLabel represents an issue-lable relation.
No description provided by the author
IssueStats represents issue statistic information.
No description provided by the author
IssueUser represents an issue-user relation.
Label represents a label of repository for issues.
LFSObject is the relation between an LFS object and a repository.
No description provided by the author
No description provided by the author
LoginSource represents an external way for authorizing users.
No description provided by the author
Milestone represents a milestone of repository.
Mirror represents mirror information of a repository.
No description provided by the author
No description provided by the author
Notice represents a system notice for admin.
OrgUser represents relations of organizations and their members.
ProtectBranch contains options of a protected branch.
No description provided by the author
PublicKey represents a user or deploy SSH public key.
PullRequest represents relation between pull request and repositories.
PushCommit contains information of a pushed commit.
PushCommits is a list of pushed commits.
No description provided by the author
No description provided by the author
Release represents a release of repository.
No description provided by the author
Repository contains information of a repository.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Team represents a organization team.
TeamRepo represents an team-repository relation.
TeamUser represents an team-user relation.
TwoFactor is a 2FA token of a user.
TwoFactorRecoveryCode represents a two-factor authentication recovery code.
No description provided by the author
No description provided by the author
Upload represent a uploaded file to a repo to be deleted when moved.
No description provided by the author
User represents the object of an individual or an organization.
No description provided by the author
The version table.
Watch is connection request for receiving repository notification.
Webhook represents a web hook object.
# Interfaces
AccessTokensStore is the persistent interface for access tokens.
ActionsStore is the persistent interface for actions.
EmailAddressesStore is the persistent interface for email addresses.
Engine represents a XORM engine or session.
LFSStore is the persistent interface for LFS objects.
LoginSourcesStore is the persistent interface for login sources.
OrgsStore is the persistent interface for organizations.
PermsStore is the persistent interface for permissions.
PublicKeysStore is the persistent interface for public keys.
ReposStore is the persistent interface for repositories.
TwoFactorsStore is the persistent interface for 2FA.
UsersStore is the persistent interface for users.
# Type aliases
AccessMode is the access mode of a user has to a repository.
ActionType is the type of an action.
No description provided by the author
CommentType defines whether a comment is just a simple comment, an action (like close) or a reference.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
MergeStyle represents the approach to merge commits into base branch.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
UserType indicates the type of the user account.