Documentation ¶
Index ¶
- func AccessTokenByNameExists(token *AccessToken) (bool, error)
- func AddAllRepositories(t *organization.Team) (err error)
- func AddCollaborator(repo *repo_model.Repository, u *user_model.User) error
- func AddReleaseAttachments(ctx context.Context, releaseID int64, attachmentUUIDs []string) (err error)
- func AddRepository(t *organization.Team, repo *repo_model.Repository) (err error)
- func AddTeamMember(team *organization.Team, userID int64) error
- func CancelRepositoryTransfer(repo *repo_model.Repository) error
- func CheckRepoStats(ctx context.Context) error
- func CheckRepoUnitUser(ctx context.Context, repo *repo_model.Repository, user *user_model.User, ...) bool
- func CountAccessTokens(opts ListAccessTokensOptions) (int64, error)
- func CountActionCreatedUnixString() (int64, error)
- func CountNotifications(opts *FindNotificationOptions) (int64, error)
- func CountNullArchivedRepository() (int64, error)
- func CountReleasesByRepoID(repoID int64, opts FindReleasesOptions) (int64, error)
- func CountUnread(ctx context.Context, userID int64) int64
- func CountWrongUserType() (int64, error)
- func CreateOrUpdateIssueNotifications(issueID, commentID, notificationAuthorID, receiverID int64) error
- func CreatePendingRepositoryTransfer(doer, newOwner *user_model.User, repoID int64, teams []*organization.Team) error
- func CreateRepoTransferNotification(doer, newOwner *user_model.User, repo *repo_model.Repository) error
- func CreateRepository(ctx context.Context, doer, u *user_model.User, repo *repo_model.Repository, ...) (err error)
- func CreateTask(task *Task) error
- func DeleteAccessTokenByID(id, userID int64) error
- func DeleteCollaboration(repo *repo_model.Repository, uid int64) (err error)
- func DeleteDeployKey(ctx context.Context, doer *user_model.User, id int64) error
- func DeleteIssueActions(ctx context.Context, repoID, issueID int64) error
- func DeleteOldActions(olderThan time.Duration) (err error)
- func DeleteReleaseByID(id int64) error
- func DeleteRepository(doer *user_model.User, uid, repoID int64) error
- func DeleteTeam(t *organization.Team) error
- func DeleteUploadByUUID(uuid string) error
- func DeleteUploads(uploads ...*Upload) (err error)
- func DeleteUser(ctx context.Context, u *user_model.User) (err error)
- func DoctorUserStarNum() (err error)
- func FinishMigrateTask(task *Task) error
- func FixActionCreatedUnixString() (int64, error)
- func FixNullArchivedRepository() (int64, error)
- func FixWrongUserType() (int64, error)
- func GetNotificationCount(ctx context.Context, user *user_model.User, status NotificationStatus) (count int64, err error)
- func GetReleaseAttachments(ctx context.Context, rels ...*Release) (err error)
- func GetReleaseCountByRepoID(repoID int64, opts FindReleasesOptions) (int64, error)
- func GetRepositoryFromMatch(ownerName, repoName string) (*repo_model.Repository, error)
- func GetYamlFixturesAccess() (string, error)
- func HasFinishedMigratingTask(repoID int64) (bool, error)
- func HasRepository(t *organization.Team, repoID int64) bool
- func InsertIssueComments(comments []*issues_model.Comment) error
- func InsertIssues(issues ...*issues_model.Issue) error
- func InsertMilestones(ms ...*issues_model.Milestone) (err error)
- func InsertPullRequests(prs ...*issues_model.PullRequest) error
- func InsertReleases(rels ...*Release) error
- func IsErrAccessTokenEmpty(err error) bool
- func IsErrAccessTokenNotExist(err error) bool
- func IsErrBranchAlreadyExists(err error) bool
- func IsErrBranchDoesNotExist(err error) bool
- func IsErrBranchNameConflict(err error) bool
- func IsErrBranchesEqual(err error) bool
- func IsErrCommitIDDoesNotMatch(err error) bool
- func IsErrDisallowedToMerge(err error) bool
- func IsErrFilePathInvalid(err error) bool
- func IsErrFilePathProtected(err error) bool
- func IsErrFilenameInvalid(err error) bool
- func IsErrForkAlreadyExist(err error) bool
- func IsErrInvalidCloneAddr(err error) bool
- func IsErrInvalidMergeStyle(err error) bool
- func IsErrInvalidTagName(err error) bool
- func IsErrMergeConflicts(err error) bool
- func IsErrMergeUnrelatedHistories(err error) bool
- func IsErrNoPendingTransfer(err error) bool
- func IsErrProtectedTagName(err error) bool
- func IsErrPullRequestHasMerged(err error) bool
- func IsErrRebaseConflicts(err error) bool
- func IsErrReleaseAlreadyExist(err error) bool
- func IsErrReleaseNotExist(err error) bool
- func IsErrRepoFileAlreadyExists(err error) bool
- func IsErrRepoFileDoesNotExist(err error) bool
- func IsErrRepoTransferInProgress(err error) bool
- func IsErrSHADoesNotMatch(err error) bool
- func IsErrSHANotFound(err error) bool
- func IsErrSHAOrCommitIDNotProvided(err error) bool
- func IsErrStopwatchNotExist(err error) bool
- func IsErrTagAlreadyExists(err error) bool
- func IsErrTaskDoesNotExist(err error) bool
- func IsErrTrackedTimeNotExist(err error) bool
- func IsErrUpdateTaskNotExist(err error) bool
- func IsErrUploadNotExist(err error) bool
- func IsErrUserCannotCommit(err error) bool
- func IsErrUserHasOrgs(err error) bool
- func IsErrUserOwnPackages(err error) bool
- func IsErrUserOwnRepos(err error) bool
- func IsErrWikiAlreadyExist(err error) bool
- func IsErrWikiInvalidFileName(err error) bool
- func IsErrWikiReservedName(err error) bool
- func IsReleaseExist(ctx context.Context, repoID int64, tagName string) (bool, error)
- func NewAccessToken(t *AccessToken) error
- func NewRepoContext()
- func NewTeam(t *organization.Team) (err error)
- func NotifyWatchers(actions ...*Action) error
- func NotifyWatchersActions(acts []*Action) error
- func PushUpdateDeleteTag(repo *repo_model.Repository, tagName string) error
- func PushUpdateDeleteTagsContext(ctx context.Context, repo *repo_model.Repository, tags []string) error
- func RemoveAllRepositories(t *organization.Team) (err error)
- func RemoveOrgUser(orgID, userID int64) error
- func RemoveRepository(t *organization.Team, repoID int64) error
- func RemoveTeamMember(team *organization.Team, userID int64) error
- func SaveOrUpdateTag(repo *repo_model.Repository, newRel *Release) error
- func SetIssueReadBy(ctx context.Context, issueID, userID int64) error
- func SetRepoReadBy(ctx context.Context, userID, repoID int64) error
- func SortReleases(rels []*Release)
- func StatsCorrectSQL(ctx context.Context, sql string, id int64) error
- func TestRepositoryReadyForTransfer(status repo_model.RepositoryStatus) error
- func TransferOwnership(doer *user_model.User, newOwnerName string, repo *repo_model.Repository) (err error)
- func UpdateAccessToken(t *AccessToken) error
- func UpdateMigrationsByType(tp structs.GitServiceType, externalUserID string, userID int64) error
- func UpdateNotificationStatuses(user *user_model.User, currentStatus, desiredStatus NotificationStatus) error
- func UpdateRelease(ctx context.Context, rel *Release) error
- func UpdateReleasesMigrationsByType(gitServiceType structs.GitServiceType, originalAuthorID string, posterID int64) error
- func UpdateRepoStats(ctx context.Context, id int64) error
- func UpdateTeam(t *organization.Team, authChanged, includeAllChanged bool) (err error)
- func UploadLocalPath(uuid string) string
- type AccessToken
- type Action
- func (a *Action) GetActFullName() string
- func (a *Action) GetActUserName() string
- func (a *Action) GetBranch() string
- func (a *Action) GetCommentLink() string
- func (a *Action) GetContent() string
- func (a *Action) GetCreate() time.Time
- func (a *Action) GetDisplayName() string
- func (a *Action) GetDisplayNameTitle() string
- func (a *Action) GetIssueContent() string
- func (a *Action) GetIssueInfos() []string
- func (a *Action) GetIssueTitle() string
- func (a *Action) GetOpType() ActionType
- func (a *Action) GetRefLink() string
- func (a *Action) GetRepoLink() string
- func (a *Action) GetRepoName() string
- func (a *Action) GetRepoPath() string
- func (a *Action) GetRepoUserName() string
- func (a *Action) GetTag() string
- func (a *Action) LoadActUser()
- func (a *Action) ShortActUserName() string
- func (a *Action) ShortRepoName() string
- func (a *Action) ShortRepoPath() string
- func (a *Action) ShortRepoUserName() string
- func (a *Action) TableIndices() []*schemas.Index
- 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 CreateRepoOptions
- type ErrAccessTokenEmpty
- type ErrAccessTokenNotExist
- type ErrBranchAlreadyExists
- type ErrBranchDoesNotExist
- type ErrBranchNameConflict
- type ErrBranchesEqual
- type ErrCommitIDDoesNotMatch
- type ErrDisallowedToMerge
- type ErrFilePathInvalid
- type ErrFilePathProtected
- type ErrFilenameInvalid
- type ErrForkAlreadyExist
- type ErrInvalidCloneAddr
- type ErrInvalidMergeStyle
- type ErrInvalidTagName
- type ErrMergeConflicts
- type ErrMergeUnrelatedHistories
- type ErrNoPendingRepoTransfer
- type ErrProtectedTagName
- type ErrPullRequestHasMerged
- type ErrRebaseConflicts
- type ErrReleaseAlreadyExist
- type ErrReleaseNotExist
- type ErrRepoFileAlreadyExists
- type ErrRepoFileDoesNotExist
- type ErrRepoTransferInProgress
- type ErrSHADoesNotMatch
- type ErrSHANotFound
- type ErrSHAOrCommitIDNotProvided
- type ErrStopwatchNotExist
- type ErrTagAlreadyExists
- type ErrTaskDoesNotExist
- type ErrTrackedTimeNotExist
- type ErrUpdateTaskNotExist
- type ErrUploadNotExist
- type ErrUserCannotCommit
- type ErrUserHasOrgs
- type ErrUserOwnPackages
- type ErrUserOwnRepos
- type ErrWikiAlreadyExist
- type ErrWikiInvalidFileName
- type ErrWikiReservedName
- type FindNotificationOptions
- type FindReleasesOptions
- type FindTaskOptions
- type GetFeedsOptions
- type IssueByLabelCount
- type IssueByRepositoryCount
- type ListAccessTokensOptions
- type MinimalOrg
- type Notification
- type NotificationList
- func (nl NotificationList) LoadAttributes() error
- func (nl NotificationList) LoadComments() ([]int, error)
- func (nl NotificationList) LoadIssues() ([]int, error)
- func (nl NotificationList) LoadRepos() (repo_model.RepositoryList, []int, error)
- func (nl NotificationList) Without(failures []int) NotificationList
- type NotificationSource
- type NotificationStatus
- type Release
- func GetLatestReleaseByRepoID(repoID int64) (*Release, error)
- func GetRelease(repoID int64, tagName string) (*Release, error)
- func GetReleaseByID(ctx context.Context, id int64) (*Release, error)
- func GetReleasesByRepoID(repoID int64, opts FindReleasesOptions) ([]*Release, error)
- func GetReleasesByRepoIDAndNames(ctx context.Context, repoID int64, tagNames []string) (rels []*Release, err error)
- func (r *Release) APIURL() string
- func (r *Release) GetExternalID() int64
- func (r *Release) GetExternalName() string
- func (r *Release) GetUserID() int64
- func (r *Release) HTMLURL() string
- func (r *Release) LoadAttributes() error
- func (r *Release) RemapExternalUser(externalName string, externalID, userID int64) error
- func (r *Release) TarURL() string
- func (r *Release) ZipURL() string
- type RepoTransfer
- type Statistic
- type Task
- type TranslatableMessage
- type Upload
- type UserHeatmapData
- type UserIDCount
Constants ¶
This section is empty.
Variables ¶
This section is empty.
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 AddAllRepositories ¶ added in v1.17.0
func AddAllRepositories(t *organization.Team) (err error)
AddAllRepositories adds all repositories to the team
func AddCollaborator ¶ added in v1.16.0
func AddCollaborator(repo *repo_model.Repository, u *user_model.User) error
AddCollaborator adds new collaboration to a repository with default access mode.
func AddReleaseAttachments ¶ added in v1.10.0
func AddReleaseAttachments(ctx context.Context, releaseID int64, attachmentUUIDs []string) (err error)
AddReleaseAttachments adds a release attachments
func AddRepository ¶ added in v1.17.0
func AddRepository(t *organization.Team, repo *repo_model.Repository) (err error)
AddRepository adds new repository to team of organization.
func AddTeamMember ¶
func AddTeamMember(team *organization.Team, userID int64) error
AddTeamMember adds new membership of given team to given organization, the user will have membership to given organization automatically when needed.
func CancelRepositoryTransfer ¶ added in v1.14.0
func CancelRepositoryTransfer(repo *repo_model.Repository) error
CancelRepositoryTransfer marks the repository as ready and remove pending transfer entry, thus cancel the transfer process.
func CheckRepoStats ¶
CheckRepoStats checks the repository stats
func CheckRepoUnitUser ¶ added in v1.16.0
func CheckRepoUnitUser(ctx context.Context, repo *repo_model.Repository, user *user_model.User, unitType unit.Type) bool
CheckRepoUnitUser check whether user could visit the unit of this repository
func CountAccessTokens ¶ added in v1.16.0
func CountAccessTokens(opts ListAccessTokensOptions) (int64, error)
CountAccessTokens count access tokens belongs to given user by options
func CountActionCreatedUnixString ¶ added in v1.16.8
CountActionCreatedUnixString count actions where created_unix is an empty string
func CountNotifications ¶ added in v1.16.0
func CountNotifications(opts *FindNotificationOptions) (int64, error)
CountNotifications count all notifications that fit to the given options and ignore pagination.
func CountNullArchivedRepository ¶ added in v1.12.0
CountNullArchivedRepository counts the number of repositories with is_archived is null
func CountReleasesByRepoID ¶ added in v1.15.0
func CountReleasesByRepoID(repoID int64, opts FindReleasesOptions) (int64, error)
CountReleasesByRepoID returns a number of releases matching FindReleaseOptions and RepoID.
func CountUnread ¶ added in v1.12.0
CountUnread count unread notifications for a user
func CountWrongUserType ¶ added in v1.14.0
CountWrongUserType count OrgUser who have wrong type
func CreateOrUpdateIssueNotifications ¶ added in v1.1.0
func CreateOrUpdateIssueNotifications(issueID, commentID, notificationAuthorID, receiverID int64) error
CreateOrUpdateIssueNotifications creates an issue notification for each watcher, or updates it if already exists receiverID > 0 just send to receiver, else send to all watcher
func CreatePendingRepositoryTransfer ¶ added in v1.14.0
func CreatePendingRepositoryTransfer(doer, newOwner *user_model.User, repoID int64, teams []*organization.Team) error
CreatePendingRepositoryTransfer transfer a repo from one owner to a new one. it marks the repository transfer as "pending"
func CreateRepoTransferNotification ¶ added in v1.14.0
func CreateRepoTransferNotification(doer, newOwner *user_model.User, repo *repo_model.Repository) error
CreateRepoTransferNotification creates notification for the user a repository was transferred to
func CreateRepository ¶
func CreateRepository(ctx context.Context, doer, u *user_model.User, repo *repo_model.Repository, overwriteOrAdopt bool) (err error)
CreateRepository creates a repository for the user/organization.
func CreateTask ¶ added in v1.12.0
CreateTask creates a task on database
func DeleteAccessTokenByID ¶
DeleteAccessTokenByID deletes access token by given ID.
func DeleteCollaboration ¶ added in v1.16.0
func DeleteCollaboration(repo *repo_model.Repository, uid int64) (err error)
DeleteCollaboration removes collaboration relation between the user and repository.
func DeleteDeployKey ¶
DeleteDeployKey delete deploy keys
func DeleteIssueActions ¶ added in v1.17.0
DeleteIssueActions delete all actions related with issueID
func DeleteOldActions ¶ added in v1.15.0
DeleteOldActions deletes all old actions from database.
func DeleteReleaseByID ¶
DeleteReleaseByID deletes a release from database by given ID.
func DeleteRepository ¶
func DeleteRepository(doer *user_model.User, uid, repoID int64) error
DeleteRepository deletes a repository for a user or organization. make sure if you call this func to close open sessions (sqlite will otherwise get a deadlock)
func DeleteTeam ¶
func DeleteTeam(t *organization.Team) error
DeleteTeam deletes given team. It's caller's responsibility to assign organization ID.
func DeleteUploadByUUID ¶
DeleteUploadByUUID deletes a upload by UUID
func DeleteUploads ¶
DeleteUploads deletes multiple uploads
func DeleteUser ¶
func DeleteUser(ctx context.Context, u *user_model.User) (err error)
DeleteUser deletes models associated to an user.
func DoctorUserStarNum ¶ added in v1.12.2
func DoctorUserStarNum() (err error)
DoctorUserStarNum recalculate Stars number for all user
func FinishMigrateTask ¶ added in v1.10.0
FinishMigrateTask updates database when migrate task finished
func FixActionCreatedUnixString ¶ added in v1.16.8
FixActionCreatedUnixString set created_unix to zero if it is an empty string
func FixNullArchivedRepository ¶ added in v1.12.0
FixNullArchivedRepository sets is_archived to false where it is null
func FixWrongUserType ¶ added in v1.14.0
FixWrongUserType fix OrgUser who have wrong type
func GetNotificationCount ¶ added in v1.1.0
func GetNotificationCount(ctx context.Context, user *user_model.User, status NotificationStatus) (count int64, err error)
GetNotificationCount returns the notification count for user
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 GetRepositoryFromMatch ¶ added in v1.9.0
func GetRepositoryFromMatch(ownerName, repoName string) (*repo_model.Repository, error)
GetRepositoryFromMatch returns a *repo_model.Repository from a username and repo strings
func GetYamlFixturesAccess ¶ added in v1.12.0
GetYamlFixturesAccess returns a string containing the contents for the access table, as recalculated using repo.RecalculateAccesses()
func HasFinishedMigratingTask ¶ added in v1.17.0
HasFinishedMigratingTask returns if a finished migration task exists for the repo.
func HasRepository ¶ added in v1.17.0
func HasRepository(t *organization.Team, repoID int64) bool
HasRepository returns true if given repository belong to team.
func InsertIssueComments ¶ added in v1.9.0
func InsertIssueComments(comments []*issues_model.Comment) error
InsertIssueComments inserts many comments of issues.
func InsertIssues ¶ added in v1.9.0
func InsertIssues(issues ...*issues_model.Issue) error
InsertIssues insert issues to database
func InsertMilestones ¶ added in v1.9.0
func InsertMilestones(ms ...*issues_model.Milestone) (err error)
InsertMilestones creates milestones of repository.
func InsertPullRequests ¶ added in v1.9.0
func InsertPullRequests(prs ...*issues_model.PullRequest) error
InsertPullRequests inserted pull requests
func InsertReleases ¶ added in v1.9.0
InsertReleases migrates release
func IsErrAccessTokenEmpty ¶
IsErrAccessTokenEmpty checks if an error is a ErrAccessTokenEmpty.
func IsErrAccessTokenNotExist ¶
IsErrAccessTokenNotExist checks if an error is a ErrAccessTokenNotExist.
func IsErrBranchAlreadyExists ¶ added in v1.3.0
IsErrBranchAlreadyExists checks if an error is an ErrBranchAlreadyExists.
func IsErrBranchDoesNotExist ¶ added in v1.13.0
IsErrBranchDoesNotExist checks if an error is an ErrBranchDoesNotExist.
func IsErrBranchNameConflict ¶ added in v1.3.0
IsErrBranchNameConflict checks if an error is an ErrBranchNameConflict.
func IsErrBranchesEqual ¶ added in v1.11.0
IsErrBranchesEqual checks if an error is an ErrBranchesEqual.
func IsErrCommitIDDoesNotMatch ¶ added in v1.9.0
IsErrCommitIDDoesNotMatch checks if an error is a ErrCommitIDDoesNotMatch.
func IsErrDisallowedToMerge ¶ added in v1.17.0
IsErrDisallowedToMerge checks if an error is an ErrDisallowedToMerge.
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 IsErrForkAlreadyExist ¶ added in v1.9.0
IsErrForkAlreadyExist checks if an error is an ErrForkAlreadyExist.
func IsErrInvalidCloneAddr ¶
IsErrInvalidCloneAddr checks if an error is a ErrInvalidCloneAddr.
func IsErrInvalidMergeStyle ¶ added in v1.4.0
IsErrInvalidMergeStyle checks if an error is a ErrInvalidMergeStyle.
func IsErrInvalidTagName ¶
IsErrInvalidTagName checks if an error is a ErrInvalidTagName.
func 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 IsErrNoPendingTransfer ¶ added in v1.14.0
IsErrNoPendingTransfer is an error type when a repository has no pending transfers
func IsErrProtectedTagName ¶ added in v1.15.0
IsErrProtectedTagName checks if an error is a ErrProtectedTagName.
func IsErrPullRequestHasMerged ¶ added in v1.11.0
IsErrPullRequestHasMerged checks if an error is a ErrPullRequestHasMerged.
func IsErrRebaseConflicts ¶ added in v1.11.0
IsErrRebaseConflicts checks if an error is a ErrRebaseConflicts.
func IsErrReleaseAlreadyExist ¶
IsErrReleaseAlreadyExist checks if an error is a ErrReleaseAlreadyExist.
func IsErrReleaseNotExist ¶
IsErrReleaseNotExist checks if an error is a ErrReleaseNotExist.
func IsErrRepoFileAlreadyExists ¶ added in v1.9.0
IsErrRepoFileAlreadyExists checks if an error is a ErrRepoFileAlreadyExists.
func IsErrRepoFileDoesNotExist ¶ added in v1.9.0
IsErrRepoFileDoesNotExist checks if an error is a ErrRepoDoesNotExist.
func IsErrRepoTransferInProgress ¶ added in v1.14.0
IsErrRepoTransferInProgress checks if an error is a ErrRepoTransferInProgress.
func IsErrSHADoesNotMatch ¶ added in v1.9.0
IsErrSHADoesNotMatch checks if an error is a ErrSHADoesNotMatch.
func IsErrSHANotFound ¶ added in v1.9.0
IsErrSHANotFound checks if an error is a ErrSHANotFound.
func IsErrSHAOrCommitIDNotProvided ¶ added in v1.9.0
IsErrSHAOrCommitIDNotProvided checks if an error is a ErrSHAOrCommitIDNotProvided.
func IsErrStopwatchNotExist ¶ added in v1.3.0
IsErrStopwatchNotExist checks if an error is a ErrStopwatchNotExist.
func IsErrTagAlreadyExists ¶ added in v1.3.0
IsErrTagAlreadyExists checks if an error is an ErrTagAlreadyExists.
func IsErrTaskDoesNotExist ¶ added in v1.10.0
IsErrTaskDoesNotExist checks if an error is a ErrTaskIsNotExist.
func IsErrTrackedTimeNotExist ¶ added in v1.3.0
IsErrTrackedTimeNotExist checks if an error is a ErrTrackedTimeNotExist.
func IsErrUpdateTaskNotExist ¶
IsErrUpdateTaskNotExist checks if an error is a ErrUpdateTaskNotExist.
func IsErrUploadNotExist ¶
IsErrUploadNotExist checks if an error is a ErrUploadNotExist.
func IsErrUserCannotCommit ¶ added in v1.9.0
IsErrUserCannotCommit checks if an error is an ErrUserCannotCommit.
func IsErrUserHasOrgs ¶
IsErrUserHasOrgs checks if an error is a ErrUserHasOrgs.
func IsErrUserOwnPackages ¶ added in v1.17.0
IsErrUserOwnPackages checks if an error is an ErrUserOwnPackages.
func IsErrUserOwnRepos ¶
IsErrUserOwnRepos checks if an error is a ErrUserOwnRepos.
func IsErrWikiAlreadyExist ¶
IsErrWikiAlreadyExist checks if an error is an ErrWikiAlreadyExist.
func IsErrWikiInvalidFileName ¶ added in v1.4.0
IsErrWikiInvalidFileName checks if an error is an ErrWikiInvalidFileName.
func IsErrWikiReservedName ¶ added in v1.4.0
IsErrWikiReservedName checks if an error is an ErrWikiReservedName.
func IsReleaseExist ¶
IsReleaseExist returns true if release with given tag name already exists.
func NewAccessToken ¶
func NewAccessToken(t *AccessToken) error
NewAccessToken creates new access token.
func NewTeam ¶
func NewTeam(t *organization.Team) (err error)
NewTeam creates a record of new team. It's caller's responsibility to assign organization ID.
func NotifyWatchers ¶
NotifyWatchers creates batch of actions for every watcher.
func NotifyWatchersActions ¶ added in v1.11.0
NotifyWatchersActions creates batch of actions for every watcher.
func PushUpdateDeleteTag ¶ added in v1.10.0
func PushUpdateDeleteTag(repo *repo_model.Repository, tagName string) error
PushUpdateDeleteTag must be called for any push actions to delete tag
func PushUpdateDeleteTagsContext ¶ added in v1.12.0
func PushUpdateDeleteTagsContext(ctx context.Context, repo *repo_model.Repository, tags []string) error
PushUpdateDeleteTagsContext updates a number of delete tags with context
func RemoveAllRepositories ¶ added in v1.17.0
func RemoveAllRepositories(t *organization.Team) (err error)
RemoveAllRepositories removes all repositories from team and recalculates access
func RemoveOrgUser ¶
RemoveOrgUser removes user from given organization.
func RemoveRepository ¶ added in v1.17.0
func RemoveRepository(t *organization.Team, repoID int64) error
RemoveRepository removes repository from team of organization. If the team shall include all repositories the request is ignored.
func RemoveTeamMember ¶
func RemoveTeamMember(team *organization.Team, userID int64) error
RemoveTeamMember removes member from given team of given organization.
func SaveOrUpdateTag ¶ added in v1.12.0
func SaveOrUpdateTag(repo *repo_model.Repository, newRel *Release) error
SaveOrUpdateTag must be called for any push actions to add tag
func SetIssueReadBy ¶ added in v1.17.0
SetIssueReadBy sets issue to be read by given user.
func SetRepoReadBy ¶ added in v1.16.0
SetRepoReadBy sets repo to be visited by given user.
func SortReleases ¶
func SortReleases(rels []*Release)
SortReleases sorts releases by number of commits and created time.
func StatsCorrectSQL ¶ added in v1.16.0
func TestRepositoryReadyForTransfer ¶ added in v1.14.0
func TestRepositoryReadyForTransfer(status repo_model.RepositoryStatus) error
TestRepositoryReadyForTransfer make sure repo is ready to transfer
func TransferOwnership ¶
func TransferOwnership(doer *user_model.User, newOwnerName string, repo *repo_model.Repository) (err error)
TransferOwnership transfers all corresponding repository items from old user to new one.
func UpdateAccessToken ¶
func UpdateAccessToken(t *AccessToken) error
UpdateAccessToken updates information of access token.
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 UpdateNotificationStatuses ¶ added in v1.4.0
func UpdateNotificationStatuses(user *user_model.User, currentStatus, desiredStatus NotificationStatus) error
UpdateNotificationStatuses updates the statuses of all of a user's notifications that are of the currentStatus type to the desiredStatus
func 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 UpdateTeam ¶
func UpdateTeam(t *organization.Team, authChanged, includeAllChanged bool) (err error)
UpdateTeam updates information of team.
func UploadLocalPath ¶
UploadLocalPath returns where uploads is stored in local file system based on given UUID.
Types ¶
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 Action ¶
type Action struct { ID int64 `xorm:"pk autoincr"` UserID int64 // Receiver user id. OpType ActionType ActUserID int64 // Action user id. ActUser *user_model.User `xorm:"-"` RepoID int64 Repo *repo_model.Repository `xorm:"-"` CommentID int64 `xorm:"INDEX"` Comment *issues_model.Comment `xorm:"-"` IsDeleted bool `xorm:"NOT NULL DEFAULT false"` RefName string IsPrivate bool `xorm:"NOT NULL DEFAULT false"` Content string `xorm:"TEXT"` CreatedUnix timeutil.TimeStamp `xorm:"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 (*Action) GetActFullName ¶ added in v1.6.0
GetActFullName gets the action's user full name.
func (*Action) GetActUserName ¶
GetActUserName gets the action's user name.
func (*Action) GetCommentLink ¶ added in v1.2.0
GetCommentLink returns link to action comment.
func (*Action) GetContent ¶
GetContent returns the action's content.
func (*Action) GetDisplayName ¶ added in v1.9.0
GetDisplayName gets the action's display name based on DEFAULT_SHOW_FULL_NAME, or falls back to the username if it is blank.
func (*Action) GetDisplayNameTitle ¶ added in v1.9.0
GetDisplayNameTitle gets the action's display name used for the title (tooltip) based on DEFAULT_SHOW_FULL_NAME
func (*Action) GetIssueContent ¶
GetIssueContent returns the content of first issue associated with this action.
func (*Action) GetIssueInfos ¶
GetIssueInfos returns a list of issues associated with the action.
func (*Action) GetIssueTitle ¶
GetIssueTitle returns the title of first issue associated with the action.
func (*Action) GetOpType ¶
func (a *Action) GetOpType() ActionType
GetOpType gets the ActionType of this action.
func (*Action) GetRefLink ¶ added in v1.16.0
GetRefLink returns the action's ref link.
func (*Action) GetRepoLink ¶
GetRepoLink returns relative link to action repository.
func (*Action) GetRepoName ¶
GetRepoName returns the name of the action repository.
func (*Action) GetRepoPath ¶
GetRepoPath returns the virtual path to the action repository.
func (*Action) GetRepoUserName ¶
GetRepoUserName returns the name of the action repository owner.
func (*Action) LoadActUser ¶ added in v1.14.0
func (a *Action) LoadActUser()
LoadActUser loads a.ActUser
func (*Action) ShortActUserName ¶
ShortActUserName gets the action's user name trimmed to max 20 chars.
func (*Action) ShortRepoName ¶
ShortRepoName returns the name of the action repository trimmed to max 33 chars.
func (*Action) ShortRepoPath ¶
ShortRepoPath returns the virtual path to the action repository trimmed to max 20 + 1 + 33 chars.
func (*Action) ShortRepoUserName ¶
ShortRepoUserName returns the name of the action repository owner trimmed to max 20 chars.
func (*Action) TableIndices ¶ added in v1.17.0
TableIndices implements xorm's TableIndices interface
type ActionList ¶ added in v1.4.0
type ActionList []*Action
ActionList defines a list of actions
func GetFeeds ¶
func GetFeeds(ctx context.Context, opts GetFeedsOptions) (ActionList, error)
GetFeeds returns actions according to the provided options
type ActionType ¶
type ActionType int
ActionType represents the type of an action.
const ( ActionCreateRepo ActionType = iota + 1 // 1 ActionRenameRepo // 2 ActionStarRepo // 3 ActionWatchRepo // 4 ActionCommitRepo // 5 ActionCreateIssue // 6 ActionCreatePullRequest // 7 ActionTransferRepo // 8 ActionPushTag // 9 ActionCommentIssue // 10 ActionMergePullRequest // 11 ActionCloseIssue // 12 ActionReopenIssue // 13 ActionClosePullRequest // 14 ActionReopenPullRequest // 15 ActionDeleteTag // 16 ActionDeleteBranch // 17 ActionMirrorSyncPush // 18 ActionMirrorSyncCreate // 19 ActionMirrorSyncDelete // 20 ActionApprovePullRequest // 21 ActionRejectPullRequest // 22 ActionCommentPull // 23 ActionPublishRelease // 24 ActionPullReviewDismissed // 25 ActionPullRequestReadyForReview // 26 )
Possible action types.
type ActivityAuthorData ¶ added in v1.9.0
type ActivityAuthorData struct { Name string `json:"name"` Login string `json:"login"` AvatarLink string `json:"avatar_link"` HomeLink string `json:"home_link"` Commits int64 `json:"commits"` }
ActivityAuthorData represents statistical git commit count data
func GetActivityStatsTopAuthors ¶ added in v1.9.0
func GetActivityStatsTopAuthors(ctx context.Context, repo *repo_model.Repository, timeFrom time.Time, count int) ([]*ActivityAuthorData, error)
GetActivityStatsTopAuthors returns top author stats for git commits for all branches
type ActivityStats ¶ added in v1.3.0
type ActivityStats struct { OpenedPRs issues_model.PullRequestList OpenedPRAuthorCount int64 MergedPRs issues_model.PullRequestList MergedPRAuthorCount int64 OpenedIssues issues_model.IssueList OpenedIssueAuthorCount int64 ClosedIssues issues_model.IssueList ClosedIssueAuthorCount int64 UnresolvedIssues issues_model.IssueList PublishedReleases []*Release PublishedReleaseAuthorCount int64 Code *git.CodeActivityStats }
ActivityStats represets issue and pull request information.
func GetActivityStats ¶ added in v1.3.0
func GetActivityStats(ctx context.Context, repo *repo_model.Repository, timeFrom time.Time, releases, issues, prs, code bool) (*ActivityStats, error)
GetActivityStats return stats for repository at given time range
func (*ActivityStats) ActiveIssueCount ¶ added in v1.3.0
func (stats *ActivityStats) ActiveIssueCount() int
ActiveIssueCount returns total active issue count
func (*ActivityStats) ActivePRCount ¶ added in v1.3.0
func (stats *ActivityStats) ActivePRCount() int
ActivePRCount returns total active pull request count
func (*ActivityStats) ClosedIssueCount ¶ added in v1.3.0
func (stats *ActivityStats) ClosedIssueCount() int
ClosedIssueCount returns closed issue count
func (*ActivityStats) ClosedIssuePerc ¶ added in v1.3.0
func (stats *ActivityStats) ClosedIssuePerc() int
ClosedIssuePerc returns closed issue count percent from total active
func (*ActivityStats) FillIssues ¶ added in v1.3.0
func (stats *ActivityStats) FillIssues(repoID int64, fromTime time.Time) error
FillIssues returns issue information for activity page
func (*ActivityStats) FillPullRequests ¶ added in v1.3.0
func (stats *ActivityStats) FillPullRequests(repoID int64, fromTime time.Time) error
FillPullRequests returns pull request information for activity page
func (*ActivityStats) FillReleases ¶ added in v1.3.0
func (stats *ActivityStats) FillReleases(repoID int64, fromTime time.Time) error
FillReleases returns release information for activity page
func (*ActivityStats) FillUnresolvedIssues ¶ added in v1.3.0
func (stats *ActivityStats) FillUnresolvedIssues(repoID int64, fromTime time.Time, issues, prs bool) error
FillUnresolvedIssues returns unresolved issue and pull request information for activity page
func (*ActivityStats) MergedPRCount ¶ added in v1.3.0
func (stats *ActivityStats) MergedPRCount() int
MergedPRCount returns merged pull request count
func (*ActivityStats) MergedPRPerc ¶ added in v1.3.0
func (stats *ActivityStats) MergedPRPerc() int
MergedPRPerc returns merged pull request percent from total active
func (*ActivityStats) OpenedIssueCount ¶ added in v1.3.0
func (stats *ActivityStats) OpenedIssueCount() int
OpenedIssueCount returns open issue count
func (*ActivityStats) OpenedIssuePerc ¶ added in v1.3.0
func (stats *ActivityStats) OpenedIssuePerc() int
OpenedIssuePerc returns open issue count percent from total active
func (*ActivityStats) OpenedPRCount ¶ added in v1.3.0
func (stats *ActivityStats) OpenedPRCount() int
OpenedPRCount returns opened pull request count
func (*ActivityStats) OpenedPRPerc ¶ added in v1.3.0
func (stats *ActivityStats) OpenedPRPerc() int
OpenedPRPerc returns opened pull request percents from total active
func (*ActivityStats) PublishedReleaseCount ¶ added in v1.3.0
func (stats *ActivityStats) PublishedReleaseCount() int
PublishedReleaseCount returns published release count
func (*ActivityStats) UnresolvedIssueCount ¶ added in v1.3.0
func (stats *ActivityStats) UnresolvedIssueCount() int
UnresolvedIssueCount returns unresolved issue and pull request count
type CreateRepoOptions ¶
type CreateRepoOptions struct { Name string Description string OriginalURL string GitServiceType api.GitServiceType Gitignores string IssueLabels string License string Readme string DefaultBranch string IsPrivate bool IsMirror bool IsTemplate bool AutoInit bool Status repo_model.RepositoryStatus TrustModel repo_model.TrustModelType MirrorInterval string }
CreateRepoOptions contains the create repository options
type ErrAccessTokenEmpty ¶
type ErrAccessTokenEmpty struct{}
ErrAccessTokenEmpty represents a "AccessTokenEmpty" kind of error.
func (ErrAccessTokenEmpty) Error ¶
func (err ErrAccessTokenEmpty) Error() string
type ErrAccessTokenNotExist ¶
type ErrAccessTokenNotExist struct {
Token string
}
ErrAccessTokenNotExist represents a "AccessTokenNotExist" kind of error.
func (ErrAccessTokenNotExist) Error ¶
func (err ErrAccessTokenNotExist) Error() string
type ErrBranchAlreadyExists ¶ added in v1.3.0
type ErrBranchAlreadyExists struct {
BranchName string
}
ErrBranchAlreadyExists represents an error that branch with such name already exists.
func (ErrBranchAlreadyExists) Error ¶ added in v1.3.0
func (err ErrBranchAlreadyExists) Error() string
type ErrBranchDoesNotExist ¶ added in v1.13.0
type ErrBranchDoesNotExist struct {
BranchName string
}
ErrBranchDoesNotExist represents an error that branch with such name does not exist.
func (ErrBranchDoesNotExist) Error ¶ added in v1.13.0
func (err ErrBranchDoesNotExist) Error() string
type ErrBranchNameConflict ¶ added in v1.3.0
type ErrBranchNameConflict struct {
BranchName string
}
ErrBranchNameConflict represents an error that branch name conflicts with other branch.
func (ErrBranchNameConflict) Error ¶ added in v1.3.0
func (err ErrBranchNameConflict) Error() string
type ErrBranchesEqual ¶ added in v1.11.0
ErrBranchesEqual represents an error that branch name conflicts with other branch.
func (ErrBranchesEqual) Error ¶ added in v1.11.0
func (err ErrBranchesEqual) Error() string
type 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 ErrDisallowedToMerge ¶ added in v1.17.0
type ErrDisallowedToMerge struct {
Reason string
}
ErrDisallowedToMerge represents an error that a branch is protected and the current user is not allowed to modify it.
func (ErrDisallowedToMerge) Error ¶ added in v1.17.0
func (err ErrDisallowedToMerge) 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 ErrForkAlreadyExist ¶ added in v1.9.0
ErrForkAlreadyExist represents a "ForkAlreadyExist" kind of error.
func (ErrForkAlreadyExist) Error ¶ added in v1.9.0
func (err ErrForkAlreadyExist) Error() string
type ErrInvalidCloneAddr ¶
type ErrInvalidCloneAddr struct { Host string IsURLError bool IsInvalidPath bool IsProtocolInvalid bool IsPermissionDenied bool LocalPath bool }
ErrInvalidCloneAddr represents a "InvalidCloneAddr" kind of error.
func (*ErrInvalidCloneAddr) Error ¶
func (err *ErrInvalidCloneAddr) Error() string
type ErrInvalidMergeStyle ¶ added in v1.4.0
type ErrInvalidMergeStyle struct { ID int64 Style repo_model.MergeStyle }
ErrInvalidMergeStyle represents an error if merging with disabled merge strategy
func (ErrInvalidMergeStyle) Error ¶ added in v1.4.0
func (err ErrInvalidMergeStyle) Error() string
type ErrInvalidTagName ¶
type ErrInvalidTagName struct {
TagName string
}
ErrInvalidTagName represents a "InvalidTagName" kind of error.
func (ErrInvalidTagName) Error ¶
func (err ErrInvalidTagName) Error() string
type ErrMergeConflicts ¶ added in v1.11.0
type ErrMergeConflicts struct { Style repo_model.MergeStyle StdOut string StdErr string Err error }
ErrMergeConflicts represents an error if merging fails with a conflict
func (ErrMergeConflicts) Error ¶ added in v1.11.0
func (err ErrMergeConflicts) Error() string
type ErrMergeUnrelatedHistories ¶ added in v1.11.0
type ErrMergeUnrelatedHistories struct {}
ErrMergeUnrelatedHistories represents an error if merging fails due to unrelated histories
func (ErrMergeUnrelatedHistories) Error ¶ added in v1.11.0
func (err ErrMergeUnrelatedHistories) Error() string
type ErrNoPendingRepoTransfer ¶ added in v1.14.0
type ErrNoPendingRepoTransfer struct {
RepoID int64
}
ErrNoPendingRepoTransfer is an error type for repositories without a pending transfer request
func (ErrNoPendingRepoTransfer) Error ¶ added in v1.14.0
func (e ErrNoPendingRepoTransfer) Error() string
type ErrProtectedTagName ¶ added in v1.15.0
type ErrProtectedTagName struct {
TagName string
}
ErrProtectedTagName represents a "ProtectedTagName" kind of error.
func (ErrProtectedTagName) Error ¶ added in v1.15.0
func (err ErrProtectedTagName) Error() string
type 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 ErrRebaseConflicts ¶ added in v1.11.0
type ErrRebaseConflicts struct { Style repo_model.MergeStyle CommitSHA string StdOut string StdErr string Err error }
ErrRebaseConflicts represents an error if rebase fails with a conflict
func (ErrRebaseConflicts) Error ¶ added in v1.11.0
func (err ErrRebaseConflicts) Error() string
type ErrReleaseAlreadyExist ¶
type ErrReleaseAlreadyExist struct {
TagName string
}
ErrReleaseAlreadyExist represents a "ReleaseAlreadyExist" kind of error.
func (ErrReleaseAlreadyExist) Error ¶
func (err ErrReleaseAlreadyExist) Error() string
type ErrReleaseNotExist ¶
ErrReleaseNotExist represents a "ReleaseNotExist" kind of error.
func (ErrReleaseNotExist) Error ¶
func (err ErrReleaseNotExist) Error() string
type ErrRepoFileAlreadyExists ¶ added in v1.9.0
type ErrRepoFileAlreadyExists struct {
Path string
}
ErrRepoFileAlreadyExists represents a "RepoFileAlreadyExist" kind of error.
func (ErrRepoFileAlreadyExists) Error ¶ added in v1.9.0
func (err ErrRepoFileAlreadyExists) Error() string
type ErrRepoFileDoesNotExist ¶ added in v1.9.0
ErrRepoFileDoesNotExist represents a "RepoFileDoesNotExist" kind of error.
func (ErrRepoFileDoesNotExist) Error ¶ added in v1.9.0
func (err ErrRepoFileDoesNotExist) Error() string
type ErrRepoTransferInProgress ¶ added in v1.14.0
ErrRepoTransferInProgress represents the state of a repository that has an ongoing transfer
func (ErrRepoTransferInProgress) Error ¶ added in v1.14.0
func (err ErrRepoTransferInProgress) Error() string
type ErrSHADoesNotMatch ¶ added in v1.9.0
ErrSHADoesNotMatch represents a "SHADoesNotMatch" kind of error.
func (ErrSHADoesNotMatch) Error ¶ added in v1.9.0
func (err ErrSHADoesNotMatch) Error() string
type ErrSHANotFound ¶ added in v1.9.0
type ErrSHANotFound struct {
SHA string
}
ErrSHANotFound represents a "SHADoesNotMatch" kind of error.
func (ErrSHANotFound) Error ¶ added in v1.9.0
func (err ErrSHANotFound) Error() string
type ErrSHAOrCommitIDNotProvided ¶ added in v1.9.0
type ErrSHAOrCommitIDNotProvided struct{}
ErrSHAOrCommitIDNotProvided represents a "SHAOrCommitIDNotProvided" kind of error.
func (ErrSHAOrCommitIDNotProvided) Error ¶ added in v1.9.0
func (err ErrSHAOrCommitIDNotProvided) Error() string
type ErrStopwatchNotExist ¶ added in v1.3.0
type ErrStopwatchNotExist struct {
ID int64
}
ErrStopwatchNotExist represents a "Stopwatch Not Exist" kind of error.
func (ErrStopwatchNotExist) Error ¶ added in v1.3.0
func (err ErrStopwatchNotExist) Error() string
type ErrTagAlreadyExists ¶ added in v1.3.0
type ErrTagAlreadyExists struct {
TagName string
}
ErrTagAlreadyExists represents an error that tag with such name already exists.
func (ErrTagAlreadyExists) Error ¶ added in v1.3.0
func (err ErrTagAlreadyExists) Error() string
type ErrTaskDoesNotExist ¶ added in v1.10.0
ErrTaskDoesNotExist represents a "TaskDoesNotExist" kind of error.
func (ErrTaskDoesNotExist) Error ¶ added in v1.10.0
func (err ErrTaskDoesNotExist) Error() string
type 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 ErrUpdateTaskNotExist ¶
type ErrUpdateTaskNotExist struct {
UUID string
}
ErrUpdateTaskNotExist represents a "UpdateTaskNotExist" kind of error.
func (ErrUpdateTaskNotExist) Error ¶
func (err ErrUpdateTaskNotExist) Error() string
type ErrUploadNotExist ¶
ErrUploadNotExist represents a "UploadNotExist" kind of error.
func (ErrUploadNotExist) Error ¶
func (err ErrUploadNotExist) Error() string
type ErrUserCannotCommit ¶ added in v1.9.0
type ErrUserCannotCommit struct {
UserName string
}
ErrUserCannotCommit represents "UserCannotCommit" kind of error.
func (ErrUserCannotCommit) Error ¶ added in v1.9.0
func (err ErrUserCannotCommit) Error() string
type ErrUserHasOrgs ¶
type ErrUserHasOrgs struct {
UID int64
}
ErrUserHasOrgs represents a "UserHasOrgs" kind of error.
func (ErrUserHasOrgs) Error ¶
func (err ErrUserHasOrgs) Error() string
type ErrUserOwnPackages ¶ added in v1.17.0
type ErrUserOwnPackages struct {
UID int64
}
ErrUserOwnPackages notifies that the user (still) owns the packages.
func (ErrUserOwnPackages) Error ¶ added in v1.17.0
func (err ErrUserOwnPackages) Error() string
type ErrUserOwnRepos ¶
type ErrUserOwnRepos struct {
UID int64
}
ErrUserOwnRepos represents a "UserOwnRepos" kind of error.
func (ErrUserOwnRepos) Error ¶
func (err ErrUserOwnRepos) Error() string
type ErrWikiAlreadyExist ¶
type ErrWikiAlreadyExist struct {
Title string
}
ErrWikiAlreadyExist represents a "WikiAlreadyExist" kind of error.
func (ErrWikiAlreadyExist) Error ¶
func (err ErrWikiAlreadyExist) Error() string
type ErrWikiInvalidFileName ¶ added in v1.4.0
type ErrWikiInvalidFileName struct {
FileName string
}
ErrWikiInvalidFileName represents an invalid wiki file name.
func (ErrWikiInvalidFileName) Error ¶ added in v1.4.0
func (err ErrWikiInvalidFileName) Error() string
type ErrWikiReservedName ¶ added in v1.4.0
type ErrWikiReservedName struct {
Title string
}
ErrWikiReservedName represents a reserved name error.
func (ErrWikiReservedName) Error ¶ added in v1.4.0
func (err ErrWikiReservedName) Error() string
type FindNotificationOptions ¶ added in v1.12.0
type FindNotificationOptions struct { db.ListOptions UserID int64 RepoID int64 IssueID int64 Status []NotificationStatus Source []NotificationSource UpdatedAfterUnix int64 UpdatedBeforeUnix int64 }
FindNotificationOptions represent the filters for notifications. If an ID is 0 it will be ignored.
func (*FindNotificationOptions) ToCond ¶ added in v1.12.0
func (opts *FindNotificationOptions) ToCond() builder.Cond
ToCond will convert each condition into a xorm-Cond
type FindReleasesOptions ¶ added in v1.2.0
type FindReleasesOptions struct { db.ListOptions IncludeDrafts bool IncludeTags bool IsPreRelease util.OptionalBool IsDraft util.OptionalBool TagNames []string }
FindReleasesOptions describes the conditions to Find releases
type 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 GetFeedsOptions ¶ added in v1.2.0
type GetFeedsOptions struct { db.ListOptions RequestedUser *user_model.User // the user we want activity for RequestedTeam *organization.Team // the team we want activity for RequestedRepo *repo_model.Repository // the repo we want activity for Actor *user_model.User // the user viewing the activity IncludePrivate bool // include private actions OnlyPerformedBy bool // only actions performed by requested user IncludeDeleted bool // include deleted actions Date string // the day we want activity for: YYYY-MM-DD }
GetFeedsOptions options for retrieving feeds
type IssueByLabelCount ¶ added in v1.16.0
IssueByLabelCount contains the number of issue group by label
type IssueByRepositoryCount ¶ added in v1.16.0
IssueByRepositoryCount contains the number of issue group by repository
type ListAccessTokensOptions ¶ added in v1.13.0
type ListAccessTokensOptions struct { db.ListOptions Name string UserID int64 }
ListAccessTokensOptions contain filter options
type MinimalOrg ¶ added in v1.15.0
type MinimalOrg = organization.Organization
MinimalOrg represents a simple orgnization with only needed columns
func GetUserOrgsList ¶ added in v1.15.0
func GetUserOrgsList(user *user_model.User) ([]*MinimalOrg, error)
GetUserOrgsList returns one user's all orgs list
type 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 *issues_model.Issue `xorm:"-"` Repository *repo_model.Repository `xorm:"-"` Comment *issues_model.Comment `xorm:"-"` User *user_model.User `xorm:"-"` CreatedUnix timeutil.TimeStamp `xorm:"created INDEX NOT NULL"` UpdatedUnix timeutil.TimeStamp `xorm:"updated INDEX NOT NULL"` }
Notification represents a notification
func GetNotificationByID ¶ added in v1.12.0
func GetNotificationByID(notificationID int64) (*Notification, error)
GetNotificationByID return notification by ID
func SetNotificationStatus ¶ added in v1.1.0
func SetNotificationStatus(notificationID int64, user *user_model.User, status NotificationStatus) (*Notification, error)
SetNotificationStatus change the notification status
func (*Notification) APIURL ¶ added in v1.12.0
func (n *Notification) APIURL() string
APIURL formats a URL-string to the notification
func (*Notification) GetIssue ¶ added in v1.1.0
func (n *Notification) GetIssue() (*issues_model.Issue, error)
GetIssue returns the issue of the notification
func (*Notification) GetRepo ¶ added in v1.1.0
func (n *Notification) GetRepo() (*repo_model.Repository, error)
GetRepo returns the repo of the notification
func (*Notification) HTMLURL ¶ added in v1.11.0
func (n *Notification) HTMLURL() string
HTMLURL formats a URL-string to the notification
func (*Notification) LoadAttributes ¶ added in v1.12.0
func (n *Notification) LoadAttributes() (err error)
LoadAttributes load Repo Issue User and Comment if not loaded
type NotificationList ¶ added in v1.11.0
type NotificationList []*Notification
NotificationList contains a list of notifications
func GetNotifications ¶ added in v1.12.0
func GetNotifications(ctx context.Context, options *FindNotificationOptions) (nl NotificationList, err error)
GetNotifications returns all notifications that fit to the given options.
func NotificationsForUser ¶ added in v1.1.0
func NotificationsForUser(ctx context.Context, user *user_model.User, statuses []NotificationStatus, page, perPage int) (notifications NotificationList, err error)
NotificationsForUser returns notifications for a given user and status
func (NotificationList) LoadAttributes ¶ added in v1.12.0
func (nl NotificationList) LoadAttributes() 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() (repo_model.RepositoryList, []int, error)
LoadRepos loads repositories from database
func (NotificationList) Without ¶ added in v1.11.4
func (nl NotificationList) Without(failures []int) NotificationList
Without returns the notification list without the failures
type NotificationSource ¶ added in v1.1.0
type NotificationSource uint8
NotificationSource is the source of the notification (issue, PR, commit, etc)
const ( // NotificationSourceIssue is a notification of an issue NotificationSourceIssue NotificationSource = iota + 1 // NotificationSourcePullRequest is a notification of a pull request NotificationSourcePullRequest // NotificationSourceCommit is a notification of a commit NotificationSourceCommit // NotificationSourceRepository is a notification for a repository NotificationSourceRepository )
type NotificationStatus ¶ added in v1.1.0
type NotificationStatus uint8
NotificationStatus is the status of the notification (read or unread)
const ( // NotificationStatusUnread represents an unread notification NotificationStatusUnread NotificationStatus = iota + 1 // NotificationStatusRead represents a read notification NotificationStatusRead // NotificationStatusPinned represents a pinned notification NotificationStatusPinned )
type Release ¶
type Release struct { ID int64 `xorm:"pk autoincr"` RepoID int64 `xorm:"INDEX UNIQUE(n)"` Repo *repo_model.Repository `xorm:"-"` PublisherID int64 `xorm:"INDEX"` Publisher *user_model.User `xorm:"-"` TagName string `xorm:"INDEX UNIQUE(n)"` OriginalAuthor string OriginalAuthorID int64 `xorm:"index"` LowerTagName string Target string Title string Sha1 string `xorm:"VARCHAR(40)"` NumCommits int64 NumCommitsBehind int64 `xorm:"-"` Note string `xorm:"TEXT"` RenderedNote string `xorm:"-"` IsDraft bool `xorm:"NOT NULL DEFAULT false"` IsPrerelease bool `xorm:"NOT NULL DEFAULT false"` IsTag bool `xorm:"NOT NULL DEFAULT false"` Attachments []*repo_model.Attachment `xorm:"-"` CreatedUnix timeutil.TimeStamp `xorm:"INDEX"` }
Release represents a release of repository.
func GetLatestReleaseByRepoID ¶ added in v1.12.0
GetLatestReleaseByRepoID returns the latest release for a repository
func GetRelease ¶
GetRelease returns release by given ID.
func GetReleaseByID ¶
GetReleaseByID returns release with given ID.
func GetReleasesByRepoID ¶
func GetReleasesByRepoID(repoID int64, opts FindReleasesOptions) ([]*Release, error)
GetReleasesByRepoID returns a list of releases of repository.
func GetReleasesByRepoIDAndNames ¶ added in v1.1.0
func GetReleasesByRepoIDAndNames(ctx context.Context, repoID int64, tagNames []string) (rels []*Release, err error)
GetReleasesByRepoIDAndNames returns a list of releases of repository according repoID and tagNames.
func (*Release) APIURL ¶ added in v1.1.0
APIURL the api url for a release. release must have attributes loaded
func (*Release) GetExternalID ¶ added in v1.17.0
ExternalID ExternalUserRemappable interface
func (*Release) GetExternalName ¶ added in v1.17.0
ExternalName ExternalUserRemappable interface
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
func (*Release) RemapExternalUser ¶ added in v1.17.0
RemapExternalUser ExternalUserRemappable interface
type RepoTransfer ¶ added in v1.14.0
type RepoTransfer struct { ID int64 `xorm:"pk autoincr"` DoerID int64 Doer *user_model.User `xorm:"-"` RecipientID int64 Recipient *user_model.User `xorm:"-"` RepoID int64 TeamIDs []int64 Teams []*organization.Team `xorm:"-"` CreatedUnix timeutil.TimeStamp `xorm:"INDEX NOT NULL created"` UpdatedUnix timeutil.TimeStamp `xorm:"INDEX NOT NULL updated"` }
RepoTransfer is used to manage repository transfers
func GetPendingRepositoryTransfer ¶ added in v1.14.0
func GetPendingRepositoryTransfer(repo *repo_model.Repository) (*RepoTransfer, error)
GetPendingRepositoryTransfer fetches the most recent and ongoing transfer process for the repository
func (*RepoTransfer) CanUserAcceptTransfer ¶ added in v1.14.0
func (r *RepoTransfer) CanUserAcceptTransfer(u *user_model.User) bool
CanUserAcceptTransfer checks if the user has the rights to accept/decline a repo transfer. For user, it checks if it's himself For organizations, it checks if the user is able to create repos
func (*RepoTransfer) LoadAttributes ¶ added in v1.14.0
func (r *RepoTransfer) LoadAttributes() error
LoadAttributes fetches the transfer recipient from the database
type Statistic ¶
type Statistic struct { Counter struct { User, Org, PublicKey, Repo, Watch, Star, Action, Access, Issue, IssueClosed, IssueOpen, Comment, Oauth, Follow, Mirror, Release, AuthSource, Webhook, Milestone, Label, HookTask, Team, UpdateTask, Project, ProjectBoard, Attachment int64 IssueByLabel []IssueByLabelCount IssueByRepository []IssueByRepositoryCount } }
Statistic contains the database statistics
func GetStatistic ¶
func GetStatistic() (stats Statistic)
GetStatistic returns the database statistics
type Task ¶ added in v1.10.0
type Task struct { ID int64 DoerID int64 `xorm:"index"` // operator Doer *user_model.User `xorm:"-"` OwnerID int64 `xorm:"index"` // repo owner id, when creating, the repoID maybe zero Owner *user_model.User `xorm:"-"` RepoID int64 `xorm:"index"` Repo *repo_model.Repository `xorm:"-"` Type structs.TaskType Status structs.TaskStatus `xorm:"index"` StartTime timeutil.TimeStamp EndTime timeutil.TimeStamp PayloadContent string `xorm:"TEXT"` Message string `xorm:"TEXT"` // if task failed, saved the error reason Created timeutil.TimeStamp `xorm:"created"` }
Task represents a task
func FindTasks ¶ added in v1.10.0
func FindTasks(opts FindTaskOptions) ([]*Task, error)
FindTasks find all tasks
func GetMigratingTask ¶ added in v1.10.0
GetMigratingTask returns the migrating task by repo's id
func GetMigratingTaskByID ¶ added in v1.13.0
func GetMigratingTaskByID(id, doerID int64) (*Task, *migration.MigrateOptions, error)
GetMigratingTaskByID returns the migrating task by repo's id
func (*Task) MigrateConfig ¶ added in v1.10.0
func (task *Task) MigrateConfig() (*migration.MigrateOptions, error)
MigrateConfig returns task config when migrate repository
func (*Task) UpdateCols ¶ added in v1.10.0
UpdateCols updates some columns
type TranslatableMessage ¶ added in v1.15.0
type TranslatableMessage struct { Format string Args []interface{} `json:"omitempty"` }
TranslatableMessage represents JSON struct that can be translated with a Locale
type Upload ¶
Upload represent a uploaded file to a repo to be deleted when moved
func GetUploadByUUID ¶
GetUploadByUUID returns the Upload by UUID
func GetUploadsByUUIDs ¶
GetUploadsByUUIDs returns multiple uploads by UUIDS
type UserHeatmapData ¶ added in v1.7.0
type UserHeatmapData struct { Timestamp timeutil.TimeStamp `json:"timestamp"` Contributions int64 `json:"contributions"` }
UserHeatmapData represents the data needed to create a heatmap
func GetUserHeatmapDataByUser ¶ added in v1.7.0
func GetUserHeatmapDataByUser(user, doer *user_model.User) ([]*UserHeatmapData, error)
GetUserHeatmapDataByUser returns an array of UserHeatmapData
func GetUserHeatmapDataByUserTeam ¶ added in v1.14.0
func GetUserHeatmapDataByUserTeam(user *user_model.User, team *organization.Team, doer *user_model.User) ([]*UserHeatmapData, error)
GetUserHeatmapDataByUserTeam returns an array of UserHeatmapData
type UserIDCount ¶ added in v1.12.0
UserIDCount is a simple coalition of UserID and Count
func GetUIDsAndNotificationCounts ¶ added in v1.12.0
func GetUIDsAndNotificationCounts(since, until timeutil.TimeStamp) ([]UserIDCount, error)
GetUIDsAndNotificationCounts between the two provided times