{"modulePath":"github.com/RedAFD/code-core","version":"v1.8.3","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package private\n\n## Functions\n\n```go\nfunc ActivePullRequest(baseRepoID int64, headRepoID int64, baseBranch, headBranch string) (*models.PullRequest, error)\n```\nActivePullRequest returns an active pull request if it exists\n\n```go\nfunc CanUserPush(protectedBranchID, userID int64) (bool, error)\n```\nCanUserPush returns if user can push\n\n```go\nfunc CheckUnitUser(userID, repoID int64, isAdmin bool, unitType models.UnitType) (*models.AccessMode, error)\n```\nCheckUnitUser check whether user could visit the unit of this repository\n\n```go\nfunc GetDeployKey(keyID, repoID int64) (*models.DeployKey, error)\n```\nGetDeployKey check if repo has deploy key\n\n```go\nfunc GetProtectedBranchBy(repoID int64, branchName string) (*models.ProtectedBranch, error)\n```\nGetProtectedBranchBy get protected branch information\n\n```go\nfunc GetPublicKeyByID(keyID int64) (*models.PublicKey, error)\n```\nGetPublicKeyByID  get public ssh key by his ID\n\n```go\nfunc GetRepository(repoID int64) (*models.Repository, bool, error)\n```\nGetRepository return the repository by its ID and a bool about if it's allowed to have PR\n\n```go\nfunc GetRepositoryByOwnerAndName(ownerName, repoName string) (*models.Repository, error)\n```\nGetRepositoryByOwnerAndName returns the repository by given ownername and reponame.\n\n```go\nfunc GetUserByKeyID(keyID int64) (*models.User, error)\n```\nGetUserByKeyID get user attached to key\n\n```go\nfunc HasDeployKey(keyID, repoID int64) (bool, error)\n```\nHasDeployKey check if repo has deploy key\n\n```go\nfunc InitWiki(repoID int64) error\n```\nInitWiki initwiki via repo id\n\n```go\nfunc PushUpdate(opt models.PushUpdateOptions) error\n```\nPushUpdate update publick key updates\n\n```go\nfunc UpdateDeployKeyUpdated(keyID int64, repoID int64) error\n```\nUpdateDeployKeyUpdated update deploy key updates\n\n```go\nfunc UpdatePublicKeyUpdated(keyID int64) error\n```\nUpdatePublicKeyUpdated update public key updates\n\n## Types\n\n```go\ntype Response struct {\n\tErr string `json:\"err\"`\n}\n```\nResponse internal request response\n\n","path":"github.com/RedAFD/code-core/modules/private","name":"private","synopsis":"","isRedistributable":true}
