Documentation ¶
Index ¶
- func AddAllRepositories(ctx context.Context, t *organization.Team) (err error)
- func AddRepository(ctx context.Context, t *organization.Team, repo *repo_model.Repository) (err error)
- func AddTeamMember(ctx context.Context, team *organization.Team, userID int64) error
- func CancelRepositoryTransfer(ctx context.Context, repo *repo_model.Repository) error
- func CheckRepoStats(ctx context.Context) error
- func CreatePendingRepositoryTransfer(ctx context.Context, doer, newOwner *user_model.User, repoID int64, ...) error
- func DeleteDeployKey(ctx context.Context, doer *user_model.User, id int64) error
- func DeleteTeam(ctx context.Context, t *organization.Team) error
- func DoctorUserStarNum() (err error)
- func GetYamlFixturesAccess() (string, error)
- func Init(ctx context.Context) error
- 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 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 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 IsErrTagAlreadyExists(err error) bool
- func IsErrUpdateTaskNotExist(err error) bool
- func IsErrUserCannotCommit(err error) bool
- func IsErrUserHasOrgs(err error) bool
- func IsErrUserOwnPackages(err error) bool
- func IsErrUserOwnRepos(err error) bool
- func NewTeam(ctx context.Context, t *organization.Team) (err error)
- func ReconsiderRepoIssuesAssignee(ctx context.Context, repo *repo_model.Repository, uid int64) error
- func ReconsiderWatches(ctx context.Context, repo *repo_model.Repository, uid int64) error
- func RemoveAllRepositories(ctx context.Context, t *organization.Team) (err error)
- func RemoveOrgUser(orgID, userID int64) error
- func RemoveTeamMember(ctx context.Context, team *organization.Team, userID int64) error
- func StatsCorrectSQL(ctx context.Context, sql string, id int64) error
- func TestRepositoryReadyForTransfer(status repo_model.RepositoryStatus) error
- func TransferOwnership(ctx context.Context, doer *user_model.User, newOwnerName string, ...) (err error)
- func UpdateRepoStats(ctx context.Context, id int64) error
- func UpdateTeam(ctx context.Context, t *organization.Team, authChanged, includeAllChanged bool) (err error)
- type ErrCommitIDDoesNotMatch
- type ErrDisallowedToMerge
- type ErrFilePathInvalid
- type ErrFilePathProtected
- type ErrFilenameInvalid
- type ErrInvalidCloneAddr
- type ErrInvalidMergeStyle
- type ErrInvalidTagName
- type ErrMergeConflicts
- type ErrMergeUnrelatedHistories
- type ErrNoPendingRepoTransfer
- type ErrProtectedTagName
- type ErrPullRequestHasMerged
- type ErrRebaseConflicts
- type ErrRepoFileAlreadyExists
- type ErrRepoFileDoesNotExist
- type ErrRepoTransferInProgress
- type ErrSHADoesNotMatch
- type ErrSHANotFound
- type ErrSHAOrCommitIDNotProvided
- type ErrTagAlreadyExists
- type ErrUpdateTaskNotExist
- type ErrUserCannotCommit
- type ErrUserHasOrgs
- type ErrUserOwnPackages
- type ErrUserOwnRepos
- type RepoTransfer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddAllRepositories ¶ added in v1.17.0
func AddAllRepositories(ctx context.Context, t *organization.Team) (err error)
AddAllRepositories adds all repositories to the team
func AddRepository ¶ added in v1.17.0
func AddRepository(ctx context.Context, t *organization.Team, repo *repo_model.Repository) (err error)
func AddTeamMember ¶
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(ctx context.Context, 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 CreatePendingRepositoryTransfer ¶ added in v1.14.0
func CreatePendingRepositoryTransfer(ctx context.Context, 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 DeleteDeployKey ¶
DeleteDeployKey delete deploy keys
func DeleteTeam ¶
func DeleteTeam(ctx context.Context, t *organization.Team) error
DeleteTeam deletes given team. It's caller's responsibility to assign organization ID.
func DoctorUserStarNum ¶ added in v1.12.2
func DoctorUserStarNum() (err error)
DoctorUserStarNum recalculate Stars number for all user
func GetYamlFixturesAccess ¶ added in v1.12.0
GetYamlFixturesAccess returns a string containing the contents for the access table, as recalculated using repo.RecalculateAccesses()
func 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 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 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 IsErrTagAlreadyExists ¶ added in v1.3.0
IsErrTagAlreadyExists checks if an error is an ErrTagAlreadyExists.
func IsErrUpdateTaskNotExist ¶
IsErrUpdateTaskNotExist checks if an error is a ErrUpdateTaskNotExist.
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 NewTeam ¶
func NewTeam(ctx context.Context, t *organization.Team) (err error)
NewTeam creates a record of new team. It's caller's responsibility to assign organization ID.
func ReconsiderRepoIssuesAssignee ¶ added in v1.21.0
func ReconsiderRepoIssuesAssignee(ctx context.Context, repo *repo_model.Repository, uid int64) error
func ReconsiderWatches ¶ added in v1.21.0
func ReconsiderWatches(ctx context.Context, repo *repo_model.Repository, uid int64) error
func RemoveAllRepositories ¶ added in v1.17.0
func RemoveAllRepositories(ctx context.Context, t *organization.Team) (err error)
RemoveAllRepositories removes all repositories from team and recalculates access
func RemoveOrgUser ¶
RemoveOrgUser removes user from given organization.
func RemoveTeamMember ¶
RemoveTeamMember removes member from given team of given organization.
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(ctx context.Context, 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 UpdateTeam ¶
func UpdateTeam(ctx context.Context, t *organization.Team, authChanged, includeAllChanged bool) (err error)
UpdateTeam updates information of team.
Types ¶
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
func (ErrDisallowedToMerge) Unwrap ¶ added in v1.17.4
func (err ErrDisallowedToMerge) Unwrap() error
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
func (ErrFilePathInvalid) Unwrap ¶ added in v1.17.4
func (err ErrFilePathInvalid) Unwrap() error
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
func (ErrFilePathProtected) Unwrap ¶ added in v1.17.4
func (err ErrFilePathProtected) Unwrap() error
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
func (ErrFilenameInvalid) Unwrap ¶ added in v1.17.4
func (err ErrFilenameInvalid) Unwrap() error
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
func (*ErrInvalidCloneAddr) Unwrap ¶ added in v1.17.4
func (err *ErrInvalidCloneAddr) Unwrap() error
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
func (ErrInvalidMergeStyle) Unwrap ¶ added in v1.17.4
func (err ErrInvalidMergeStyle) Unwrap() error
type ErrInvalidTagName ¶
type ErrInvalidTagName struct {
TagName string
}
ErrInvalidTagName represents a "InvalidTagName" kind of error.
func (ErrInvalidTagName) Error ¶
func (err ErrInvalidTagName) Error() string
func (ErrInvalidTagName) Unwrap ¶ added in v1.17.4
func (err ErrInvalidTagName) Unwrap() error
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 (err ErrNoPendingRepoTransfer) Error() string
func (ErrNoPendingRepoTransfer) Unwrap ¶ added in v1.17.4
func (err ErrNoPendingRepoTransfer) Unwrap() error
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
func (ErrProtectedTagName) Unwrap ¶ added in v1.17.4
func (err ErrProtectedTagName) Unwrap() error
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 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
func (ErrRepoFileAlreadyExists) Unwrap ¶ added in v1.17.4
func (err ErrRepoFileAlreadyExists) Unwrap() error
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
func (ErrRepoFileDoesNotExist) Unwrap ¶ added in v1.17.4
func (err ErrRepoFileDoesNotExist) Unwrap() error
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
func (ErrRepoTransferInProgress) Unwrap ¶ added in v1.17.4
func (err ErrRepoTransferInProgress) Unwrap() error
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
func (ErrSHANotFound) Unwrap ¶ added in v1.17.4
func (err ErrSHANotFound) Unwrap() error
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 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
func (ErrTagAlreadyExists) Unwrap ¶ added in v1.17.4
func (err ErrTagAlreadyExists) Unwrap() error
type ErrUpdateTaskNotExist ¶
type ErrUpdateTaskNotExist struct {
UUID string
}
ErrUpdateTaskNotExist represents a "UpdateTaskNotExist" kind of error.
func (ErrUpdateTaskNotExist) Error ¶
func (err ErrUpdateTaskNotExist) Error() string
func (ErrUpdateTaskNotExist) Unwrap ¶ added in v1.17.4
func (err ErrUpdateTaskNotExist) Unwrap() error
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
func (ErrUserCannotCommit) Unwrap ¶ added in v1.17.4
func (err ErrUserCannotCommit) Unwrap() error
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 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(ctx context.Context, 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(ctx context.Context, 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(ctx context.Context) error
LoadAttributes fetches the transfer recipient from the database