gitea: code.gitea.io/gitea/models Index | Files | Directories

package models

import "code.gitea.io/gitea/models"

Index

Package Files

access.go action.go action_list.go admin.go attachment.go branches.go commit_status.go consistency.go context.go convert.go error.go error_oauth2.go external_login_user.go gpg_key.go graph.go helper.go helper_directory.go helper_environment.go issue.go issue_assignees.go issue_comment.go issue_comment_list.go issue_dependency.go issue_label.go issue_list.go issue_lock.go issue_milestone.go issue_reaction.go issue_stopwatch.go issue_tracked_time.go issue_user.go issue_watch.go issue_xref.go lfs.go lfs_lock.go log.go login_source.go migrate.go models.go notification.go oauth2.go oauth2_application.go org.go org_team.go pull.go pull_list.go release.go repo.go repo_activity.go repo_branch.go repo_collaboration.go repo_indexer.go repo_issue.go repo_list.go repo_mirror.go repo_permission.go repo_redirect.go repo_sign.go repo_unit.go repo_watch.go review.go ssh_key.go star.go task.go test_fixtures.go token.go topic.go twofactor.go u2f.go unit.go unit_tests.go update.go upload.go user.go user_follow.go user_heatmap.go user_mail.go user_openid.go userlist.go webhook.go wiki.go

Constants

const (
    // ProtectedBranchRepoID protected Repo ID
    ProtectedBranchRepoID = "GITEA_REPO_ID"
    // ProtectedBranchPRID protected Repo PR ID
    ProtectedBranchPRID = "GITEA_PR_ID"
)
const (
    // BadSignature is used as the reason when the signature has a KeyID that is in the db
    // but no key that has that ID verifies the signature. This is a suspicious failure.
    BadSignature = "gpg.error.probable_bad_signature"
    // BadDefaultSignature is used as the reason when the signature has a KeyID that matches the
    // default Key but is not verified by the default key. This is a suspicious failure.
    BadDefaultSignature = "gpg.error.probable_bad_default_signature"
    // NoKeyFound is used as the reason when no key can be found to verify the signature.
    NoKeyFound = "gpg.error.no_gpg_keys_found"
)
const (
    FilterModeAll = iota
    FilterModeAssign
    FilterModeCreate
    FilterModeMention
)

Filter modes.

const (
    // LFSMetaFileIdentifier is the string appearing at the first line of LFS pointer files.
    // https://github.com/git-lfs/git-lfs/blob/master/docs/spec.md
    LFSMetaFileIdentifier = "version https://git-lfs.github.com/spec/v1"

    // LFSMetaFileOidPrefix appears in LFS pointer files on a line before the sha256 hash.
    LFSMetaFileOidPrefix = "oid sha256:"
)
const (
    SMTPPlain = "PLAIN"
    SMTPLogin = "LOGIN"
)

SMTP authentication type names.

const (
    // KeyTypeUser specifies the user key
    KeyTypeUser = iota + 1
    // KeyTypeDeploy specifies the deploy key
    KeyTypeDeploy
)
const (
    EnvRepoName     = "GITEA_REPO_NAME"
    EnvRepoUsername = "GITEA_REPO_USER_NAME"
    EnvRepoIsWiki   = "GITEA_REPO_IS_WIKI"
    EnvPusherName   = "GITEA_PUSHER_NAME"
    EnvPusherEmail  = "GITEA_PUSHER_EMAIL"
    EnvPusherID     = "GITEA_PUSHER_ID"
    EnvKeyID        = "GITEA_KEY_ID"
    EnvIsDeployKey  = "GITEA_IS_DEPLOY_KEY"
)

env keys for git hooks need

const (

    // EmailNotificationsEnabled indicates that the user would like to receive all email notifications
    EmailNotificationsEnabled = "enabled"
    // EmailNotificationsOnMention indicates that the user would like to be notified via email when mentioned.
    EmailNotificationsOnMention = "onmention"
    // EmailNotificationsDisabled indicates that the user would not like to be notified via email.
    EmailNotificationsDisabled = "disabled"
)
const (
    HookStatusNone = iota
    HookStatusSucceed
    HookStatusFail
)

Possible statuses of a web hook

const NonexistentID = int64(math.MaxInt64)

NonexistentID an ID that will never exist

const RepositoryListDefaultPageSize = 64

RepositoryListDefaultPageSize is the default number of repositories to load in memory when running administrative tasks on all (or almost all) of them. The number should be low enough to avoid filling up all RAM with repository data...

Variables

var (
    // ErrMirrorNotExist mirror does not exist error
    ErrMirrorNotExist = errors.New("Mirror does not exist")

    // ErrNameEmpty name is empty error
    ErrNameEmpty = errors.New("Name is empty")
)
var (
    // Gitignores contains the gitiginore files
    Gitignores []string

    // Licenses contains the license files
    Licenses []string

    // Readmes contains the readme files
    Readmes []string

    // LabelTemplates contains the label template files
    LabelTemplates []string

    // ItemsPerPage maximum items per page in forks, watchers and stars of a repo
    ItemsPerPage = 40
)
var (
    // AllRepoUnitTypes contains all the unit types
    AllRepoUnitTypes = []UnitType{
        UnitTypeCode,
        UnitTypeIssues,
        UnitTypePullRequests,
        UnitTypeReleases,
        UnitTypeWiki,
        UnitTypeExternalWiki,
        UnitTypeExternalTracker,
    }

    // DefaultRepoUnits contains the default unit types
    DefaultRepoUnits = []UnitType{
        UnitTypeCode,
        UnitTypeIssues,
        UnitTypePullRequests,
        UnitTypeReleases,
        UnitTypeWiki,
    }

    // MustRepoUnits contains the units could not be disabled currently
    MustRepoUnits = []UnitType{
        UnitTypeCode,
        UnitTypeReleases,
    }
)
var (
    UnitCode = Unit{
        UnitTypeCode,
        "repo.code",
        "/",
        "repo.code.desc",
        0,
    }

    UnitIssues = Unit{
        UnitTypeIssues,
        "repo.issues",
        "/issues",
        "repo.issues.desc",
        1,
    }

    UnitExternalTracker = Unit{
        UnitTypeExternalTracker,
        "repo.ext_issues",
        "/issues",
        "repo.ext_issues.desc",
        1,
    }

    UnitPullRequests = Unit{
        UnitTypePullRequests,
        "repo.pulls",
        "/pulls",
        "repo.pulls.desc",
        2,
    }

    UnitReleases = Unit{
        UnitTypeReleases,
        "repo.releases",
        "/releases",
        "repo.releases.desc",
        3,
    }

    UnitWiki = Unit{
        UnitTypeWiki,
        "repo.wiki",
        "/wiki",
        "repo.wiki.desc",
        4,
    }

    UnitExternalWiki = Unit{
        UnitTypeExternalWiki,
        "repo.ext_wiki",
        "/wiki",
        "repo.ext_wiki.desc",
        4,
    }

    // Units contains all the units
    Units = map[UnitType]Unit{
        UnitTypeCode:            UnitCode,
        UnitTypeIssues:          UnitIssues,
        UnitTypeExternalTracker: UnitExternalTracker,
        UnitTypePullRequests:    UnitPullRequests,
        UnitTypeReleases:        UnitReleases,
        UnitTypeWiki:            UnitWiki,
        UnitTypeExternalWiki:    UnitExternalWiki,
    }
)

Enumerate all the units

var (
    // ErrUserNotKeyOwner user does not own this key error
    ErrUserNotKeyOwner = errors.New("User does not own this public key")

    // ErrEmailNotExist e-mail does not exist error
    ErrEmailNotExist = errors.New("E-mail does not exist")

    // ErrEmailNotActivated e-mail address has not been activated error
    ErrEmailNotActivated = errors.New("E-mail address has not been activated")

    // ErrUserNameIllegal user name contains illegal characters error
    ErrUserNameIllegal = errors.New("User name contains illegal characters")

    // ErrLoginSourceNotActived login source is not actived error
    ErrLoginSourceNotActived = errors.New("Login source is not actived")

    // ErrUnsupportedLoginType login source is unknown error
    ErrUnsupportedLoginType = errors.New("Login source is unknown")
)
var (
    // ErrEmailAddressNotExist email address not exist
    ErrEmailAddressNotExist = errors.New("Email address does not exist")
)
var (
    // ErrLFSObjectNotExist is returned from lfs models functions in order
    // to differentiate between database and missing object errors.
    ErrLFSObjectNotExist = errors.New("LFS Meta object does not exist")
)
var (
    // ErrOpenIDNotExist openid is not known
    ErrOpenIDNotExist = errors.New("OpenID is unknown")
)
var (

    // HasEngine specifies if we have a xorm.Engine
    HasEngine bool
)
var LoginNames = map[LoginType]string{
    LoginLDAP:   "LDAP (via BindDN)",
    LoginDLDAP:  "LDAP (simple auth)",
    LoginSMTP:   "SMTP",
    LoginPAM:    "PAM",
    LoginOAuth2: "OAuth2",
}

LoginNames contains the name of LoginType values.

var OAuth2DefaultCustomURLMappings = map[string]*oauth2.CustomURLMapping{
    "github": OAuth2Providers["github"].CustomURLMapping,
    "gitlab": OAuth2Providers["gitlab"].CustomURLMapping,
    "gitea":  OAuth2Providers["gitea"].CustomURLMapping,
}

OAuth2DefaultCustomURLMappings contains the map of default URL's for OAuth2 providers that are allowed to have custom urls key is used to map the OAuth2Provider value is the mapping as defined for the OAuth2Provider

var OAuth2Providers = map[string]OAuth2Provider{
    "bitbucket": {Name: "bitbucket", DisplayName: "Bitbucket", Image: "/img/auth/bitbucket.png"},
    "dropbox":   {Name: "dropbox", DisplayName: "Dropbox", Image: "/img/auth/dropbox.png"},
    "facebook":  {Name: "facebook", DisplayName: "Facebook", Image: "/img/auth/facebook.png"},
    "github": {Name: "github", DisplayName: "GitHub", Image: "/img/auth/github.png",
        CustomURLMapping: &oauth2.CustomURLMapping{
            TokenURL:   oauth2.GetDefaultTokenURL("github"),
            AuthURL:    oauth2.GetDefaultAuthURL("github"),
            ProfileURL: oauth2.GetDefaultProfileURL("github"),
            EmailURL:   oauth2.GetDefaultEmailURL("github"),
        },
    },
    "gitlab": {Name: "gitlab", DisplayName: "GitLab", Image: "/img/auth/gitlab.png",
        CustomURLMapping: &oauth2.CustomURLMapping{
            TokenURL:   oauth2.GetDefaultTokenURL("gitlab"),
            AuthURL:    oauth2.GetDefaultAuthURL("gitlab"),
            ProfileURL: oauth2.GetDefaultProfileURL("gitlab"),
        },
    },
    "gplus":         {Name: "gplus", DisplayName: "Google", Image: "/img/auth/google.png"},
    "openidConnect": {Name: "openidConnect", DisplayName: "OpenID Connect", Image: "/img/auth/openid_connect.png"},
    "twitter":       {Name: "twitter", DisplayName: "Twitter", Image: "/img/auth/twitter.png"},
    "discord":       {Name: "discord", DisplayName: "Discord", Image: "/img/auth/discord.png"},
    "gitea": {Name: "gitea", DisplayName: "Gitea", Image: "/img/auth/gitea.png",
        CustomURLMapping: &oauth2.CustomURLMapping{
            TokenURL:   oauth2.GetDefaultTokenURL("gitea"),
            AuthURL:    oauth2.GetDefaultAuthURL("gitea"),
            ProfileURL: oauth2.GetDefaultProfileURL("gitea"),
        },
    },
}

OAuth2Providers contains the map of registered OAuth2 providers in Gitea (based on goth) key is used to map the OAuth2Provider with the goth provider type (also in LoginSource.OAuth2Config.Provider) value is used to store display data

var SMTPAuths = []string{SMTPPlain, SMTPLogin}

SMTPAuths contains available SMTP authentication type names.

var SecurityProtocolNames = map[ldap.SecurityProtocol]string{
    ldap.SecurityProtocolUnencrypted: "Unencrypted",
    ldap.SecurityProtocolLDAPS:       "LDAPS",
    ldap.SecurityProtocolStartTLS:    "StartTLS",
}

SecurityProtocolNames contains the name of SecurityProtocol values.

func AddDeletePRBranchComment Uses

func AddDeletePRBranchComment(doer *User, repo *Repository, issueID int64, branchName string) error

AddDeletePRBranchComment adds delete branch comment for pull request issue

func AddEmailAddress Uses

func AddEmailAddress(email *EmailAddress) error

AddEmailAddress adds an email address to given user.

func AddEmailAddresses Uses

func AddEmailAddresses(emails []*EmailAddress) error

AddEmailAddresses adds an email address to given user.

func AddOrgUser Uses

func AddOrgUser(orgID, uid int64) error

AddOrgUser adds new user to given organization.

func AddReleaseAttachments Uses

func AddReleaseAttachments(releaseID int64, attachmentUUIDs []string) (err error)

AddReleaseAttachments adds a release attachments

func AddTeamMember Uses

func AddTeamMember(team *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 AddUserOpenID Uses

func AddUserOpenID(openid *UserOpenID) error

AddUserOpenID adds an pre-verified/normalized OpenID URI to given user.

func AssertCount Uses

func AssertCount(t testing.TB, bean interface{}, expected interface{})

AssertCount assert the count of a bean

func AssertExistsAndLoadBean Uses

func AssertExistsAndLoadBean(t testing.TB, bean interface{}, conditions ...interface{}) interface{}

AssertExistsAndLoadBean assert that a bean exists and load it from the test database

func AssertExistsIf Uses

func AssertExistsIf(t *testing.T, expected bool, bean interface{}, conditions ...interface{})

AssertExistsIf asserts that a bean exists or does not exist, depending on what is expected.

func AssertInt64InRange Uses

func AssertInt64InRange(t testing.TB, low, high, value int64)

AssertInt64InRange assert value is in range [low, high]

func AssertNotExistsBean Uses

func AssertNotExistsBean(t testing.TB, bean interface{}, conditions ...interface{})

AssertNotExistsBean assert that a bean does not exist in the test database

func AssertSuccessfulInsert Uses

func AssertSuccessfulInsert(t testing.TB, beans ...interface{})

AssertSuccessfulInsert assert that beans is successfully inserted

func AttachmentLocalPath Uses

func AttachmentLocalPath(uuid string) string

AttachmentLocalPath returns where attachment is stored in local file system based on given UUID.

func BeanExists Uses

func BeanExists(t testing.TB, bean interface{}, conditions ...interface{}) bool

BeanExists for testing, check if a bean exists

func CanBeAssigned Uses

func CanBeAssigned(user *User, repo *Repository, isPull bool) (bool, error)

CanBeAssigned return true if user can be assigned to issue or pull requests in repo Currently any write access (code, issues or pr's) is assignable, to match assignee list in user interface. FIXME: user could send PullRequest also could be assigned???

func CancelStopwatch Uses

func CancelStopwatch(user *User, issue *Issue) error

CancelStopwatch removes the given stopwatch and logs it into issue's timeline.

func Cell2Int64 Uses

func Cell2Int64(val xorm.Cell) int64

Cell2Int64 converts a xorm.Cell type to int64, and handles possible irregular cases.

func ChangeMilestoneAssign Uses

func ChangeMilestoneAssign(issue *Issue, doer *User, oldMilestoneID int64) (err error)

ChangeMilestoneAssign changes assignment of milestone for issue.

func ChangeMilestoneStatus Uses

func ChangeMilestoneStatus(m *Milestone, isClosed bool) (err error)

ChangeMilestoneStatus changes the milestone open/closed status.

func ChangeOrgUserStatus Uses

func ChangeOrgUserStatus(orgID, uid int64, public bool) error

ChangeOrgUserStatus changes public or private membership status.

func ChangeRepositoryName Uses

func ChangeRepositoryName(u *User, oldRepoName, newRepoName string) (err error)

ChangeRepositoryName changes all corresponding setting from old repository name to new one.

func ChangeUserName Uses

func ChangeUserName(u *User, newUserName string) (err error)

ChangeUserName changes all corresponding setting from old user name to new one.

func CheckConsistencyFor Uses

func CheckConsistencyFor(t *testing.T, beansToCheck ...interface{})

CheckConsistencyFor test that all matching database entries are consistent

func CheckConsistencyForAll Uses

func CheckConsistencyForAll(t *testing.T)

CheckConsistencyForAll test that the entire database is consistent

func CheckCreateRepository Uses

func CheckCreateRepository(doer, u *User, name string) error

CheckCreateRepository check if could created a repository

func CheckLFSAccessForRepo Uses

func CheckLFSAccessForRepo(u *User, repo *Repository, mode AccessMode) error

CheckLFSAccessForRepo check needed access mode base on action

func CheckPublicKeyString Uses

func CheckPublicKeyString(content string) (_ string, err error)

CheckPublicKeyString checks if the given public key string is recognized by SSH. It returns the actual public key line on success.

func CheckRepoStats Uses

func CheckRepoStats()

CheckRepoStats checks the repository stats

func CommentHashTag Uses

func CommentHashTag(id int64) string

CommentHashTag returns unique hash tag for comment id.

func CommentTypeIsRef Uses

func CommentTypeIsRef(t CommentType) bool

CommentTypeIsRef returns true if CommentType is a reference from another issue

func ComposeHTTPSCloneURL Uses

func ComposeHTTPSCloneURL(owner, repo string) string

ComposeHTTPSCloneURL returns HTTPS clone URL based on given owner and repository name.

func Cond Uses

func Cond(query interface{}, args ...interface{}) interface{}

Cond create a condition with arguments for a test

func ConvertUtf8ToUtf8mb4 Uses

func ConvertUtf8ToUtf8mb4() error

ConvertUtf8ToUtf8mb4 converts database and tables from utf8 to utf8mb4 if it's mysql

func CopyLFS Uses

func CopyLFS(newRepo, oldRepo *Repository) error

CopyLFS copies LFS data from one repo to another

func Count Uses

func Count(bean interface{}) (int64, error)

Count returns records number according struct's fields as database query conditions

func CountIssuesByRepo Uses

func CountIssuesByRepo(opts *IssuesOptions) (map[int64]int64, error)

CountIssuesByRepo map from repoID to number of issues matching the options

func CountLoginSources Uses

func CountLoginSources() int64

CountLoginSources returns number of login sources.

func CountNotices Uses

func CountNotices() int64

CountNotices returns number of notices.

func CountOrganizations Uses

func CountOrganizations() int64

CountOrganizations returns number of organizations.

func CountRepoClosedMilestones Uses

func CountRepoClosedMilestones(repoID int64) (int64, error)

CountRepoClosedMilestones returns number of closed milestones in given repository.

func CountRepositories Uses

func CountRepositories(private bool) int64

CountRepositories returns number of repositories. Argument private only takes effect when it is false, set it true to count all repositories.

func CountUserRepositories Uses

func CountUserRepositories(userID int64, private bool) int64

CountUserRepositories returns number of repositories user owns. Argument private only takes effect when it is false, set it true to count all repositories.

func CountUsers Uses

func CountUsers() int64

CountUsers returns number of users.

func CreateHookTask Uses

func CreateHookTask(t *HookTask) error

CreateHookTask creates a new hook task, it handles conversion from Payload to PayloadContent.

func CreateIssueDependency Uses

func CreateIssueDependency(user *User, issue, dep *Issue) error

CreateIssueDependency creates a new dependency for an issue

func CreateLoginSource Uses

func CreateLoginSource(source *LoginSource) error

CreateLoginSource inserts a LoginSource in the DB if not already existing with the given name.

func CreateNotice Uses

func CreateNotice(tp NoticeType, desc string) error

CreateNotice creates new system notice.

func CreateOrStopIssueStopwatch Uses

func CreateOrStopIssueStopwatch(user *User, issue *Issue) error

CreateOrStopIssueStopwatch will create or remove a stopwatch and will log it into issue's timeline.

func CreateOrUpdateIssueNotifications Uses

func CreateOrUpdateIssueNotifications(issueID, commentID int64, notificationAuthorID int64) error

CreateOrUpdateIssueNotifications creates an issue notification for each watcher, or updates it if already exists

func CreateOrUpdateIssueWatch Uses

func CreateOrUpdateIssueWatch(userID, issueID int64, isWatching bool) error

CreateOrUpdateIssueWatch set watching for a user and issue

func CreateOrganization Uses

func CreateOrganization(org, owner *User) (err error)

CreateOrganization creates record of a new organization.

func CreateRefComment Uses

func CreateRefComment(doer *User, repo *Repository, issue *Issue, content, commitSHA string) error

CreateRefComment creates a commit reference comment to issue.

func CreateRepositoryNotice Uses

func CreateRepositoryNotice(desc string) error

CreateRepositoryNotice creates new system notice with type NoticeRepository.

func CreateTemporaryPath Uses

func CreateTemporaryPath(prefix string) (string, error)

CreateTemporaryPath creates a temporary path

func CreateUser Uses

func CreateUser(u *User) (err error)

CreateUser creates record of a new user.

func CreateWebhook Uses

func CreateWebhook(w *Webhook) error

CreateWebhook creates a new web hook.

func DeleteAccessTokenByID Uses

func DeleteAccessTokenByID(id, userID int64) error

DeleteAccessTokenByID deletes access token by given ID.

func DeleteAttachment Uses

func DeleteAttachment(a *Attachment, remove bool) error

DeleteAttachment deletes the given attachment and optionally the associated file.

func DeleteAttachments Uses

func DeleteAttachments(attachments []*Attachment, remove bool) (int, error)

DeleteAttachments deletes the given attachments and optionally the associated files.

func DeleteAttachmentsByComment Uses

func DeleteAttachmentsByComment(commentID int64, remove bool) (int, error)

DeleteAttachmentsByComment deletes all attachments associated with the given comment.

func DeleteAttachmentsByIssue Uses

func DeleteAttachmentsByIssue(issueID int64, remove bool) (int, error)

DeleteAttachmentsByIssue deletes all attachments associated with the given issue.

func DeleteAttachmentsByRelease Uses

func DeleteAttachmentsByRelease(releaseID int64) error

DeleteAttachmentsByRelease deletes all attachments associated with the given release.

func DeleteComment Uses

func DeleteComment(comment *Comment, doer *User) error

DeleteComment deletes the comment

func DeleteCommentReaction Uses

func DeleteCommentReaction(doer *User, issue *Issue, comment *Comment, content string) error

DeleteCommentReaction deletes a reaction on comment.

func DeleteDefaultWebhook Uses

func DeleteDefaultWebhook(id int64) error

DeleteDefaultWebhook deletes an admin-default webhook by given ID.

func DeleteDeployKey Uses

func DeleteDeployKey(doer *User, id int64) error

DeleteDeployKey deletes deploy key from its repository authorized_keys file if needed.

func DeleteEmailAddress Uses

func DeleteEmailAddress(email *EmailAddress) (err error)

DeleteEmailAddress deletes an email address of given user.

func DeleteEmailAddresses Uses

func DeleteEmailAddresses(emails []*EmailAddress) (err error)

DeleteEmailAddresses deletes multiple email addresses

func DeleteGPGKey Uses

func DeleteGPGKey(doer *User, id int64) (err error)

DeleteGPGKey deletes GPG key information in database.

func DeleteInactivateUsers Uses

func DeleteInactivateUsers() (err error)

DeleteInactivateUsers deletes all inactivate users and email addresses.

func DeleteIssueLabel Uses

func DeleteIssueLabel(issue *Issue, label *Label, doer *User) (err error)

DeleteIssueLabel deletes issue-label relation.

func DeleteIssueReaction Uses

func DeleteIssueReaction(doer *User, issue *Issue, content string) error

DeleteIssueReaction deletes a reaction on issue.

func DeleteLabel Uses

func DeleteLabel(repoID, labelID int64) error

DeleteLabel delete a label of given repository.

func DeleteMilestoneByRepoID Uses

func DeleteMilestoneByRepoID(repoID, id int64) error

DeleteMilestoneByRepoID deletes a milestone from a repository.

func DeleteMirrorByRepoID Uses

func DeleteMirrorByRepoID(repoID int64) error

DeleteMirrorByRepoID deletes a mirror by repoID

func DeleteMissingRepositories Uses

func DeleteMissingRepositories(doer *User) error

DeleteMissingRepositories deletes all repository records that lost Git files.

func DeleteNotice Uses

func DeleteNotice(id int64) error

DeleteNotice deletes a system notice by given ID.

func DeleteNotices Uses

func DeleteNotices(start, end int64) error

DeleteNotices deletes all notices with ID from start to end (inclusive).

func DeleteNoticesByIDs Uses

func DeleteNoticesByIDs(ids []int64) error

DeleteNoticesByIDs deletes notices by given IDs.

func DeleteOAuth2Application Uses

func DeleteOAuth2Application(id, userid int64) error

DeleteOAuth2Application deletes the application with the given id and the grants and auth codes related to it. It checks if the userid was the creator of the app.

func DeleteOldRepositoryArchives Uses

func DeleteOldRepositoryArchives()

DeleteOldRepositoryArchives deletes old repository archives.

func DeleteOrganization Uses

func DeleteOrganization(org *User) (err error)

DeleteOrganization completely and permanently deletes everything of organization.

func DeletePublicKey Uses

func DeletePublicKey(doer *User, id int64) (err error)

DeletePublicKey deletes SSH key information both in database and authorized_keys file.

func DeleteReaction Uses

func DeleteReaction(opts *ReactionOptions) error

DeleteReaction deletes reaction for issue or comment.

func DeleteRegistration Uses

func DeleteRegistration(reg *U2FRegistration) error

DeleteRegistration will delete U2FRegistration

func DeleteReleaseByID Uses

func DeleteReleaseByID(id int64) error

DeleteReleaseByID deletes a release from database by given ID.

func DeleteRepoFromIndexer Uses

func DeleteRepoFromIndexer(repo *Repository, watchers ...chan<- error)

DeleteRepoFromIndexer remove all of a repository's entries from the indexer

func DeleteRepository Uses

func DeleteRepository(doer *User, uid, repoID int64) error

DeleteRepository deletes a repository for a user or organization.

func DeleteRepositoryArchives Uses

func DeleteRepositoryArchives() error

DeleteRepositoryArchives deletes all repositories' archives.

func DeleteSource Uses

func DeleteSource(source *LoginSource) error

DeleteSource deletes a LoginSource record in DB.

func DeleteTeam Uses

func DeleteTeam(t *Team) error

DeleteTeam deletes given team. It's caller's responsibility to assign organization ID.

func DeleteTwoFactorByID Uses

func DeleteTwoFactorByID(id, userID int64) error

DeleteTwoFactorByID deletes two-factor authentication token by given ID.

func DeleteUploadByUUID Uses

func DeleteUploadByUUID(uuid string) error

DeleteUploadByUUID deletes a upload by UUID

func DeleteUploads Uses

func DeleteUploads(uploads ...*Upload) (err error)

DeleteUploads deletes multiple uploads

func DeleteUser Uses

func DeleteUser(u *User) (err error)

DeleteUser completely and permanently deletes everything of a user, but issues/comments/pulls will be kept and shown as someone has been deleted.

func DeleteUserOpenID Uses

func DeleteUserOpenID(openid *UserOpenID) (err error)

DeleteUserOpenID deletes an openid address of given user.

func DeleteWebhookByOrgID Uses

func DeleteWebhookByOrgID(orgID, id int64) error

DeleteWebhookByOrgID deletes webhook of organization by given ID.

func DeleteWebhookByRepoID Uses

func DeleteWebhookByRepoID(repoID, id int64) error

DeleteWebhookByRepoID deletes webhook of repository by given ID.

func DumpDatabase Uses

func DumpDatabase(filePath string, dbType string) error

DumpDatabase dumps all data from database according the special database SQL syntax to file system.

func FindRepoRecentCommitStatusContexts Uses

func FindRepoRecentCommitStatusContexts(repoID int64, before time.Duration) ([]string, error)

FindRepoRecentCommitStatusContexts returns repository's recent commit status contexts

func FindUserAccessibleRepoIDs Uses

func FindUserAccessibleRepoIDs(userID int64) ([]int64, error)

FindUserAccessibleRepoIDs find all accessible repositories' ID by user's id

func FinishMigrateTask Uses

func FinishMigrateTask(task *Task) error

FinishMigrateTask updates database when migrate task finished

func FollowUser Uses

func FollowUser(userID, followID int64) (err error)

FollowUser marks someone be another's follower.

func FullPushingEnvironment Uses

func FullPushingEnvironment(author, committer *User, repo *Repository, repoName string, prID int64) []string

FullPushingEnvironment returns an os environment to allow hooks to work on push

func GPGKeyToEntity Uses

func GPGKeyToEntity(k *GPGKey) (*openpgp.Entity, error)

GPGKeyToEntity retrieve the imported key and the traducted entity

func GenerateLFSOid Uses

func GenerateLFSOid(content io.Reader) (string, error)

GenerateLFSOid generates a Sha256Sum to represent an oid for arbitrary content

func GetActiveOAuth2Providers Uses

func GetActiveOAuth2Providers() ([]string, map[string]OAuth2Provider, error)

GetActiveOAuth2Providers returns the map of configured active OAuth2 providers key is used as technical name (like in the callbackURL) values to display

func GetCount Uses

func GetCount(t testing.TB, bean interface{}, conditions ...interface{}) int

GetCount get the count of a bean

func GetExternalLogin Uses

func GetExternalLogin(externalLoginUser *ExternalLoginUser) (bool, error)

GetExternalLogin checks if a externalID in loginSourceID scope already exists

func GetIssueIDsByRepoID Uses

func GetIssueIDsByRepoID(repoID int64) ([]int64, error)

GetIssueIDsByRepoID returns all issue ids by repo id

func GetLabelIDsInRepoByNames Uses

func GetLabelIDsInRepoByNames(repoID int64, labelNames []string) ([]int64, error)

GetLabelIDsInRepoByNames returns a list of labelIDs by names in a given repository. it silently ignores label names that do not belong to the repository.

func GetLabelIDsInReposByNames Uses

func GetLabelIDsInReposByNames(repoIDs []int64, labelNames []string) ([]int64, error)

GetLabelIDsInReposByNames returns a list of labelIDs by names in one of the given repositories. it silently ignores label names that do not belong to the repository.

func GetLabelTemplateFile Uses

func GetLabelTemplateFile(name string) ([][3]string, error)

GetLabelTemplateFile loads the label template file by given name, then parses and returns a list of name-color pairs and optionally description.

func GetNotificationCount Uses

func GetNotificationCount(user *User, status NotificationStatus) (int64, error)

GetNotificationCount returns the notification count for user

func GetPrivateRepositoryCount Uses

func GetPrivateRepositoryCount(u *User) (int64, error)

GetPrivateRepositoryCount returns the total number of private repositories of user.

func GetPublicRepositoryCount Uses

func GetPublicRepositoryCount(u *User) (int64, error)

GetPublicRepositoryCount returns the total number of public repositories of user.

func GetReleaseAttachments Uses

func GetReleaseAttachments(rels ...*Release) (err error)

GetReleaseAttachments retrieves the attachments for releases

func GetReleaseCountByRepoID Uses

func GetReleaseCountByRepoID(repoID int64, opts FindReleasesOptions) (int64, error)

GetReleaseCountByRepoID returns the count of releases of repository

func GetRepoIssueStats Uses

func GetRepoIssueStats(repoID, uid int64, filterMode int, isPull bool) (numOpen int64, numClosed int64)

GetRepoIssueStats returns number of open and closed repository issues by given filter mode.

func GetRepositoriesMapByIDs Uses

func GetRepositoriesMapByIDs(ids []int64) (map[int64]*Repository, error)

GetRepositoriesMapByIDs returns the repositories by given id slice.

func GetRepositoryCount Uses

func GetRepositoryCount(u *User) (int64, error)

GetRepositoryCount returns the total number of repositories of user.

func GetUser Uses

func GetUser(user *User) (bool, error)

GetUser checks if a user already exists

func GetUserEmailsByNames Uses

func GetUserEmailsByNames(names []string) []string

GetUserEmailsByNames returns a list of e-mails corresponds to names of users that have their email notifications set to enabled or onmention.

func GetUserIDByExternalUserID Uses

func GetUserIDByExternalUserID(provider string, userID string) (int64, error)

GetUserIDByExternalUserID get user id according to provider and userID

func GetUserIDsByNames Uses

func GetUserIDsByNames(names []string, ignoreNonExistent bool) ([]int64, error)

GetUserIDsByNames returns a slice of ids corresponds to names.

func GetUserSalt Uses

func GetUserSalt() (string, error)

GetUserSalt returns a random user salt token.

func GitConfigPath Uses

func GitConfigPath(repoPath string) string

GitConfigPath returns the path to a repository's git config/ directory

func GitFsck Uses

func GitFsck()

GitFsck calls 'git fsck' to check repository health.

func GitGcRepos Uses

func GitGcRepos() error

GitGcRepos calls 'git gc' to remove unnecessary files and optimize the local repository

func HasAccess Uses

func HasAccess(userID int64, repo *Repository) (bool, error)

HasAccess returns true if user has access to repo

func HasAccessUnit Uses

func HasAccessUnit(user *User, repo *Repository, unitType UnitType, testMode AccessMode) (bool, error)

HasAccessUnit returns ture if user has testMode to the unit of the repository

func HasDeployKey Uses

func HasDeployKey(keyID, repoID int64) bool

HasDeployKey returns true if public key is a deploy key of given repository.

func HasIssueLabel Uses

func HasIssueLabel(issueID, labelID int64) bool

HasIssueLabel returns true if issue has been labeled.

func HasOrgVisible Uses

func HasOrgVisible(org *User, user *User) bool

HasOrgVisible tells if the given user can see the given org

func HasOrgsVisible Uses

func HasOrgsVisible(orgs []*User, user *User) bool

HasOrgsVisible tells if the given user can see at least one of the orgs provided

func HasTeamRepo Uses

func HasTeamRepo(orgID, teamID, repoID int64) bool

HasTeamRepo returns true if given repository belongs to team.

func InitFixtures Uses

func InitFixtures(helper testfixtures.Helper, dir string) (err error)

InitFixtures initialize test fixtures for a test database

func InitOAuth2 Uses

func InitOAuth2() error

InitOAuth2 initialize the OAuth2 lib and register all active OAuth2 providers in the library

func InitRepoIndexer Uses

func InitRepoIndexer()

InitRepoIndexer initialize the repo indexer

func InitTestPullRequests Uses

func InitTestPullRequests()

InitTestPullRequests runs the task to test all the checking status pull requests

func InitalizeLabels Uses

func InitalizeLabels(repoID int64, labelTemplate string) error

InitalizeLabels adds a label set to a repository using a template

func InsertIssueComments Uses

func InsertIssueComments(comments []*Comment) error

InsertIssueComments inserts many comments of issues.

func InsertIssues Uses

func InsertIssues(issues ...*Issue) error

InsertIssues insert issues to database

func InsertMilestones Uses

func InsertMilestones(ms ...*Milestone) (err error)

InsertMilestones creates milestones of repository.

func InsertPullRequests Uses

func InsertPullRequests(prs ...*PullRequest) error

InsertPullRequests inserted pull requests

func InsertRelease Uses

func InsertRelease(rel *Release) error

InsertRelease inserts a release

func InsertReleases Uses

func InsertReleases(rels ...*Release) error

InsertReleases migrates release

func IsEmailUsed Uses

func IsEmailUsed(email string) (bool, error)

IsEmailUsed returns true if the email has been used.

func IsErrAccessTokenEmpty Uses

func IsErrAccessTokenEmpty(err error) bool

IsErrAccessTokenEmpty checks if an error is a ErrAccessTokenEmpty.

func IsErrAccessTokenNotExist Uses

func IsErrAccessTokenNotExist(err error) bool

IsErrAccessTokenNotExist checks if an error is a ErrAccessTokenNotExist.

func IsErrAttachmentNotExist Uses

func IsErrAttachmentNotExist(err error) bool

IsErrAttachmentNotExist checks if an error is a ErrAttachmentNotExist.

func IsErrBranchAlreadyExists Uses

func IsErrBranchAlreadyExists(err error) bool

IsErrBranchAlreadyExists checks if an error is an ErrBranchAlreadyExists.

func IsErrBranchNameConflict Uses

func IsErrBranchNameConflict(err error) bool

IsErrBranchNameConflict checks if an error is an ErrBranchNameConflict.

func IsErrCircularDependency Uses

func IsErrCircularDependency(err error) bool

IsErrCircularDependency checks if an error is a ErrCircularDependency.

func IsErrCommentNotExist Uses

func IsErrCommentNotExist(err error) bool

IsErrCommentNotExist checks if an error is a ErrCommentNotExist.

func IsErrCommitIDDoesNotMatch Uses

func IsErrCommitIDDoesNotMatch(err error) bool

IsErrCommitIDDoesNotMatch checks if an error is a ErrCommitIDDoesNotMatch.

func IsErrDependenciesLeft Uses

func IsErrDependenciesLeft(err error) bool

IsErrDependenciesLeft checks if an error is a ErrDependenciesLeft.

func IsErrDependencyExists Uses

func IsErrDependencyExists(err error) bool

IsErrDependencyExists checks if an error is a ErrDependencyExists.

func IsErrDependencyNotExists Uses

func IsErrDependencyNotExists(err error) bool

IsErrDependencyNotExists checks if an error is a ErrDependencyExists.

func IsErrDeployKeyAlreadyExist Uses

func IsErrDeployKeyAlreadyExist(err error) bool

IsErrDeployKeyAlreadyExist checks if an error is a ErrDeployKeyAlreadyExist.

func IsErrDeployKeyNameAlreadyUsed Uses

func IsErrDeployKeyNameAlreadyUsed(err error) bool

IsErrDeployKeyNameAlreadyUsed checks if an error is a ErrDeployKeyNameAlreadyUsed.

func IsErrDeployKeyNotExist Uses

func IsErrDeployKeyNotExist(err error) bool

IsErrDeployKeyNotExist checks if an error is a ErrDeployKeyNotExist.

func IsErrEmailAlreadyUsed Uses

func IsErrEmailAlreadyUsed(err error) bool

IsErrEmailAlreadyUsed checks if an error is a ErrEmailAlreadyUsed.

func IsErrErrPullRequestHeadRepoMissing Uses

func IsErrErrPullRequestHeadRepoMissing(err error) bool

IsErrErrPullRequestHeadRepoMissing checks if an error is a ErrPullRequestHeadRepoMissing.

func IsErrExternalLoginUserAlreadyExist Uses

func IsErrExternalLoginUserAlreadyExist(err error) bool

IsErrExternalLoginUserAlreadyExist checks if an error is a ExternalLoginUserAlreadyExist.

func IsErrExternalLoginUserNotExist Uses

func IsErrExternalLoginUserNotExist(err error) bool

IsErrExternalLoginUserNotExist checks if an error is a ExternalLoginUserNotExist.

func IsErrFilePathInvalid Uses

func IsErrFilePathInvalid(err error) bool

IsErrFilePathInvalid checks if an error is an ErrFilePathInvalid.

func IsErrFilenameInvalid Uses

func IsErrFilenameInvalid(err error) bool

IsErrFilenameInvalid checks if an error is an ErrFilenameInvalid.

func IsErrForkAlreadyExist Uses

func IsErrForkAlreadyExist(err error) bool

IsErrForkAlreadyExist checks if an error is an ErrForkAlreadyExist.

func IsErrGPGKeyAccessDenied Uses

func IsErrGPGKeyAccessDenied(err error) bool

IsErrGPGKeyAccessDenied checks if an error is a ErrGPGKeyAccessDenied.

func IsErrGPGKeyIDAlreadyUsed Uses

func IsErrGPGKeyIDAlreadyUsed(err error) bool

IsErrGPGKeyIDAlreadyUsed checks if an error is a ErrKeyNameAlreadyUsed.

func IsErrGPGKeyImportNotExist Uses

func IsErrGPGKeyImportNotExist(err error) bool

IsErrGPGKeyImportNotExist checks if an error is a ErrGPGKeyImportNotExist.

func IsErrGPGKeyNotExist Uses

func IsErrGPGKeyNotExist(err error) bool

IsErrGPGKeyNotExist checks if an error is a ErrGPGKeyNotExist.

func IsErrGPGKeyParsing Uses

func IsErrGPGKeyParsing(err error) bool

IsErrGPGKeyParsing checks if an error is a ErrGPGKeyParsing.

func IsErrGPGNoEmailFound Uses

func IsErrGPGNoEmailFound(err error) bool

IsErrGPGNoEmailFound checks if an error is a ErrGPGNoEmailFound.

func IsErrInvalidCloneAddr Uses

func IsErrInvalidCloneAddr(err error) bool

IsErrInvalidCloneAddr checks if an error is a ErrInvalidCloneAddr.

func IsErrInvalidMergeStyle Uses

func IsErrInvalidMergeStyle(err error) bool

IsErrInvalidMergeStyle checks if an error is a ErrInvalidMergeStyle.

func IsErrInvalidTagName Uses

func IsErrInvalidTagName(err error) bool

IsErrInvalidTagName checks if an error is a ErrInvalidTagName.

func IsErrIssueLabelTemplateLoad Uses

func IsErrIssueLabelTemplateLoad(err error) bool

IsErrIssueLabelTemplateLoad checks if an error is a ErrIssueLabelTemplateLoad.

func IsErrIssueNotExist Uses

func IsErrIssueNotExist(err error) bool

IsErrIssueNotExist checks if an error is a ErrIssueNotExist.

func IsErrKeyAccessDenied Uses

func IsErrKeyAccessDenied(err error) bool

IsErrKeyAccessDenied checks if an error is a ErrKeyAccessDenied.

func IsErrKeyAlreadyExist Uses

func IsErrKeyAlreadyExist(err error) bool

IsErrKeyAlreadyExist checks if an error is a ErrKeyAlreadyExist.

func IsErrKeyNameAlreadyUsed Uses

func IsErrKeyNameAlreadyUsed(err error) bool

IsErrKeyNameAlreadyUsed checks if an error is a ErrKeyNameAlreadyUsed.

func IsErrKeyNotExist Uses

func IsErrKeyNotExist(err error) bool

IsErrKeyNotExist checks if an error is a ErrKeyNotExist.

func IsErrKeyUnableVerify Uses

func IsErrKeyUnableVerify(err error) bool

IsErrKeyUnableVerify checks if an error is a ErrKeyUnableVerify.

func IsErrLFSFileLocked Uses

func IsErrLFSFileLocked(err error) bool

IsErrLFSFileLocked checks if an error is a ErrLFSFileLocked.

func IsErrLFSLockAlreadyExist Uses

func IsErrLFSLockAlreadyExist(err error) bool

IsErrLFSLockAlreadyExist checks if an error is a ErrLFSLockAlreadyExist.

func IsErrLFSLockNotExist Uses

func IsErrLFSLockNotExist(err error) bool

IsErrLFSLockNotExist checks if an error is a ErrLFSLockNotExist.

func IsErrLFSUnauthorizedAction Uses

func IsErrLFSUnauthorizedAction(err error) bool

IsErrLFSUnauthorizedAction checks if an error is a ErrLFSUnauthorizedAction.

func IsErrLabelNotExist Uses

func IsErrLabelNotExist(err error) bool

IsErrLabelNotExist checks if an error is a ErrLabelNotExist.

func IsErrLastOrgOwner Uses

func IsErrLastOrgOwner(err error) bool

IsErrLastOrgOwner checks if an error is a ErrLastOrgOwner.

func IsErrLoginSourceAlreadyExist Uses

func IsErrLoginSourceAlreadyExist(err error) bool

IsErrLoginSourceAlreadyExist checks if an error is a ErrLoginSourceAlreadyExist.

func IsErrLoginSourceInUse Uses

func IsErrLoginSourceInUse(err error) bool

IsErrLoginSourceInUse checks if an error is a ErrLoginSourceInUse.

func IsErrLoginSourceNotExist Uses

func IsErrLoginSourceNotExist(err error) bool

IsErrLoginSourceNotExist checks if an error is a ErrLoginSourceNotExist.

func IsErrMergeConflicts Uses

func IsErrMergeConflicts(err error) bool

IsErrMergeConflicts checks if an error is a ErrMergeConflicts.

func IsErrMergePushOutOfDate Uses

func IsErrMergePushOutOfDate(err error) bool

IsErrMergePushOutOfDate checks if an error is a ErrMergePushOutOfDate.

func IsErrMergeUnrelatedHistories Uses

func IsErrMergeUnrelatedHistories(err error) bool

IsErrMergeUnrelatedHistories checks if an error is a ErrMergeUnrelatedHistories.

func IsErrMilestoneNotExist Uses

func IsErrMilestoneNotExist(err error) bool

IsErrMilestoneNotExist checks if an error is a ErrMilestoneNotExist.

func IsErrNamePatternNotAllowed Uses

func IsErrNamePatternNotAllowed(err error) bool

IsErrNamePatternNotAllowed checks if an error is an ErrNamePatternNotAllowed.

func IsErrNameReserved Uses

func IsErrNameReserved(err error) bool

IsErrNameReserved checks if an error is a ErrNameReserved.

func IsErrNewIssueInsert Uses

func IsErrNewIssueInsert(err error) bool

IsErrNewIssueInsert checks if an error is a ErrNewIssueInsert.

func IsErrNotAllowedToMerge Uses

func IsErrNotAllowedToMerge(err error) bool

IsErrNotAllowedToMerge checks if an error is an ErrNotAllowedToMerge.

func IsErrNotExist Uses

func IsErrNotExist(err error) bool

IsErrNotExist checks if an error is an ErrNotExist

func IsErrOAuthApplicationNotFound Uses

func IsErrOAuthApplicationNotFound(err error) bool

IsErrOAuthApplicationNotFound checks if an error is a ErrReviewNotExist.

func IsErrOauthClientIDInvalid Uses

func IsErrOauthClientIDInvalid(err error) bool

IsErrOauthClientIDInvalid checks if an error is a ErrReviewNotExist.

func IsErrOpenIDAlreadyUsed Uses

func IsErrOpenIDAlreadyUsed(err error) bool

IsErrOpenIDAlreadyUsed checks if an error is a ErrOpenIDAlreadyUsed.

func IsErrOpenIDConnectInitialize Uses

func IsErrOpenIDConnectInitialize(err error) bool

IsErrOpenIDConnectInitialize checks if an error is a ExternalLoginUserAlreadyExist.

func IsErrOrgNotExist Uses

func IsErrOrgNotExist(err error) bool

IsErrOrgNotExist checks if an error is a ErrOrgNotExist.

func IsErrPullRequestAlreadyExists Uses

func IsErrPullRequestAlreadyExists(err error) bool

IsErrPullRequestAlreadyExists checks if an error is a ErrPullRequestAlreadyExists.

func IsErrPullRequestNotExist Uses

func IsErrPullRequestNotExist(err error) bool

IsErrPullRequestNotExist checks if an error is a ErrPullRequestNotExist.

func IsErrReachLimitOfRepo Uses

func IsErrReachLimitOfRepo(err error) bool

IsErrReachLimitOfRepo checks if an error is a ErrReachLimitOfRepo.

func IsErrRebaseConflicts Uses

func IsErrRebaseConflicts(err error) bool

IsErrRebaseConflicts checks if an error is a ErrRebaseConflicts.

func IsErrReleaseAlreadyExist Uses

func IsErrReleaseAlreadyExist(err error) bool

IsErrReleaseAlreadyExist checks if an error is a ErrReleaseAlreadyExist.

func IsErrReleaseNotExist Uses

func IsErrReleaseNotExist(err error) bool

IsErrReleaseNotExist checks if an error is a ErrReleaseNotExist.

func IsErrRepoAlreadyExist Uses

func IsErrRepoAlreadyExist(err error) bool

IsErrRepoAlreadyExist checks if an error is a ErrRepoAlreadyExist.

func IsErrRepoFileAlreadyExists Uses

func IsErrRepoFileAlreadyExists(err error) bool

IsErrRepoFileAlreadyExists checks if an error is a ErrRepoFileAlreadyExists.

func IsErrRepoFileDoesNotExist Uses

func IsErrRepoFileDoesNotExist(err error) bool

IsErrRepoFileDoesNotExist checks if an error is a ErrRepoDoesNotExist.

func IsErrRepoNotExist Uses

func IsErrRepoNotExist(err error) bool

IsErrRepoNotExist checks if an error is a ErrRepoNotExist.

func IsErrRepoRedirectNotExist Uses

func IsErrRepoRedirectNotExist(err error) bool

IsErrRepoRedirectNotExist check if an error is an ErrRepoRedirectNotExist.

func IsErrReviewNotExist Uses

func IsErrReviewNotExist(err error) bool

IsErrReviewNotExist checks if an error is a ErrReviewNotExist.

func IsErrSHADoesNotMatch Uses

func IsErrSHADoesNotMatch(err error) bool

IsErrSHADoesNotMatch checks if an error is a ErrSHADoesNotMatch.

func IsErrSHANotFound Uses

func IsErrSHANotFound(err error) bool

IsErrSHANotFound checks if an error is a ErrSHANotFound.

func IsErrSHAOrCommitIDNotProvided Uses

func IsErrSHAOrCommitIDNotProvided(err error) bool

IsErrSHAOrCommitIDNotProvided checks if an error is a ErrSHAOrCommitIDNotProvided.

func IsErrSSHDisabled Uses

func IsErrSSHDisabled(err error) bool

IsErrSSHDisabled checks if an error is a ErrSSHDisabled.

func IsErrStopwatchNotExist Uses

func IsErrStopwatchNotExist(err error) bool

IsErrStopwatchNotExist checks if an error is a ErrStopwatchNotExist.

func IsErrTagAlreadyExists Uses

func IsErrTagAlreadyExists(err error) bool

IsErrTagAlreadyExists checks if an error is an ErrTagAlreadyExists.

func IsErrTaskDoesNotExist Uses

func IsErrTaskDoesNotExist(err error) bool

IsErrTaskDoesNotExist checks if an error is a ErrTaskIsNotExist.

func IsErrTeamAlreadyExist Uses

func IsErrTeamAlreadyExist(err error) bool

IsErrTeamAlreadyExist checks if an error is a ErrTeamAlreadyExist.

func IsErrTeamNotExist Uses

func IsErrTeamNotExist(err error) bool

IsErrTeamNotExist checks if an error is a ErrTeamNotExist.

func IsErrTopicNotExist Uses

func IsErrTopicNotExist(err error) bool

IsErrTopicNotExist checks if an error is an ErrTopicNotExist.

func IsErrTrackedTimeNotExist Uses

func IsErrTrackedTimeNotExist(err error) bool

IsErrTrackedTimeNotExist checks if an error is a ErrTrackedTimeNotExist.

func IsErrTwoFactorNotEnrolled Uses

func IsErrTwoFactorNotEnrolled(err error) bool

IsErrTwoFactorNotEnrolled checks if an error is a ErrTwoFactorNotEnrolled.

func IsErrU2FRegistrationNotExist Uses

func IsErrU2FRegistrationNotExist(err error) bool

IsErrU2FRegistrationNotExist checks if an error is a ErrU2FRegistrationNotExist.

func IsErrUnitTypeNotExist Uses

func IsErrUnitTypeNotExist(err error) bool

IsErrUnitTypeNotExist checks if an error is a ErrUnitNotExist.

func IsErrUnknownDependencyType Uses

func IsErrUnknownDependencyType(err error) bool

IsErrUnknownDependencyType checks if an error is ErrUnknownDependencyType

func IsErrUpdateTaskNotExist Uses

func IsErrUpdateTaskNotExist(err error) bool

IsErrUpdateTaskNotExist checks if an error is a ErrUpdateTaskNotExist.

func IsErrUploadNotExist Uses

func IsErrUploadNotExist(err error) bool

IsErrUploadNotExist checks if an error is a ErrUploadNotExist.

func IsErrUserAlreadyExist Uses

func IsErrUserAlreadyExist(err error) bool

IsErrUserAlreadyExist checks if an error is a ErrUserAlreadyExists.

func IsErrUserCannotCommit Uses

func IsErrUserCannotCommit(err error) bool

IsErrUserCannotCommit checks if an error is an ErrUserCannotCommit.

func IsErrUserDoesNotHaveAccessToRepo Uses

func IsErrUserDoesNotHaveAccessToRepo(err error) bool

IsErrUserDoesNotHaveAccessToRepo checks if an error is a ErrRepoFileAlreadyExists.

func IsErrUserHasOrgs Uses

func IsErrUserHasOrgs(err error) bool

IsErrUserHasOrgs checks if an error is a ErrUserHasOrgs.

func IsErrUserInactive Uses

func IsErrUserInactive(err error) bool

IsErrUserInactive checks if an error is a ErrUserInactive

func IsErrUserNotAllowedCreateOrg Uses

func IsErrUserNotAllowedCreateOrg(err error) bool

IsErrUserNotAllowedCreateOrg checks if an error is an ErrUserNotAllowedCreateOrg.

func IsErrUserNotExist Uses

func IsErrUserNotExist(err error) bool

IsErrUserNotExist checks if an error is a ErrUserNotExist.

func IsErrUserOwnRepos Uses

func IsErrUserOwnRepos(err error) bool

IsErrUserOwnRepos checks if an error is a ErrUserOwnRepos.

func IsErrUserProhibitLogin Uses

func IsErrUserProhibitLogin(err error) bool

IsErrUserProhibitLogin checks if an error is a ErrUserProhibitLogin

func IsErrWebhookNotExist Uses

func IsErrWebhookNotExist(err error) bool

IsErrWebhookNotExist checks if an error is a ErrWebhookNotExist.

func IsErrWikiAlreadyExist Uses

func IsErrWikiAlreadyExist(err error) bool

IsErrWikiAlreadyExist checks if an error is an ErrWikiAlreadyExist.

func IsErrWikiInvalidFileName Uses

func IsErrWikiInvalidFileName(err error) bool

IsErrWikiInvalidFileName checks if an error is an ErrWikiInvalidFileName.

func IsErrWikiReservedName Uses

func IsErrWikiReservedName(err error) bool

IsErrWikiReservedName checks if an error is an ErrWikiReservedName.

func IsFollowing Uses

func IsFollowing(userID, followID int64) bool

IsFollowing returns true if user is following followID.

func IsOpenIDUsed Uses

func IsOpenIDUsed(openid string) (bool, error)

IsOpenIDUsed returns true if the openid has been used.

func IsOrganizationMember Uses

func IsOrganizationMember(orgID, uid int64) (bool, error)

IsOrganizationMember returns true if given user is member of organization.

func IsOrganizationOwner Uses

func IsOrganizationOwner(orgID, uid int64) (bool, error)

IsOrganizationOwner returns true if given user is in the owner team.

func IsPublicMembership Uses

func IsPublicMembership(orgID, uid int64) (bool, error)

IsPublicMembership returns true if given user public his/her membership.

func IsReleaseExist Uses

func IsReleaseExist(repoID int64, tagName string) (bool, error)

IsReleaseExist returns true if release with given tag name already exists.

func IsRepositoryExist Uses

func IsRepositoryExist(u *User, repoName string) (bool, error)

IsRepositoryExist returns true if the repository with given name under user has already existed.

func IsStaring Uses

func IsStaring(userID, repoID int64) bool

IsStaring checks if user has starred given repository.

func IsTeamMember Uses

func IsTeamMember(orgID, teamID, userID int64) (bool, error)

IsTeamMember returns true if given user is a member of team.

func IsUsableRepoName Uses

func IsUsableRepoName(name string) error

IsUsableRepoName returns true when repository is usable

func IsUsableTeamName Uses

func IsUsableTeamName(name string) error

IsUsableTeamName tests if a name could be as team name

func IsUsableUsername Uses

func IsUsableUsername(name string) error

IsUsableUsername returns an error when a username is reserved

func IsUserAssignedToIssue Uses

func IsUserAssignedToIssue(issue *Issue, user *User) (isAssigned bool, err error)

IsUserAssignedToIssue returns true when the user is assigned to the issue

func IsUserExist Uses

func IsUserExist(uid int64, name string) (bool, error)

IsUserExist checks if given user name exist, the user name should be noncased unique. If uid is presented, then check will rule out that one, it is used when update a user name in settings page.

func IsUserInTeams Uses

func IsUserInTeams(userID int64, teamIDs []int64) (bool, error)

IsUserInTeams returns if a user in some teams

func IsUserRepoAdmin Uses

func IsUserRepoAdmin(repo *Repository, user *User) (bool, error)

IsUserRepoAdmin return ture if user has admin right of a repo

func IsValidHookContentType Uses

func IsValidHookContentType(name string) bool

IsValidHookContentType returns true if given name is a valid hook content type.

func IsValidHookTaskType Uses

func IsValidHookTaskType(name string) bool

IsValidHookTaskType returns true if given name is a valid hook task type.

func IsWatching Uses

func IsWatching(userID, repoID int64) bool

IsWatching checks if user has watched given repository.

func IssueNoDependenciesLeft Uses

func IssueNoDependenciesLeft(issue *Issue) (bool, error)

IssueNoDependenciesLeft checks if issue can be closed

func LFSAutoAssociate Uses

func LFSAutoAssociate(metas []*LFSMetaObject, user *User, repoID int64) error

LFSAutoAssociate auto associates accessible LFSMetaObjects

func LFSObjectAccessible Uses

func LFSObjectAccessible(user *User, oid string) (bool, error)

LFSObjectAccessible checks if a provided Oid is accessible to the user

func LinkExternalToUser Uses

func LinkExternalToUser(user *User, externalLoginUser *ExternalLoginUser) error

LinkExternalToUser link the external user to the user

func LoadFixtures Uses

func LoadFixtures() error

LoadFixtures load fixtures for a test database

func LocalCopyPath Uses

func LocalCopyPath() string

LocalCopyPath returns the local repository temporary copy path.

func LockIssue Uses

func LockIssue(opts *IssueLockOptions) error

LockIssue locks an issue. This would limit commenting abilities to users with write access to the repo

func LookupRepoRedirect Uses

func LookupRepoRedirect(ownerID int64, repoName string) (int64, error)

LookupRepoRedirect look up if a repository has a redirect name

func MainTest Uses

func MainTest(m *testing.M, pathToGiteaRoot string)

MainTest a reusable TestMain(..) function for unit tests that need to use a test database. Creates the test database, and sets necessary settings.

func MakeAssigneeList Uses

func MakeAssigneeList(issue *Issue) (assigneeList string, err error)

MakeAssigneeList concats a string with all names of the assignees. Useful for logs.

func MakeEmailPrimary Uses

func MakeEmailPrimary(email *EmailAddress) error

MakeEmailPrimary sets primary email address of given user.

func MakeIDsFromAPIAssigneesToAdd Uses

func MakeIDsFromAPIAssigneesToAdd(oneAssignee string, multipleAssignees []string) (assigneeIDs []int64, err error)

MakeIDsFromAPIAssigneesToAdd returns an array with all assignee IDs

func MaxBatchInsertSize Uses

func MaxBatchInsertSize(bean interface{}) int

MaxBatchInsertSize returns the table's max batch insert size

func MergePullRequestAction Uses

func MergePullRequestAction(actUser *User, repo *Repository, pull *Issue) error

MergePullRequestAction adds new action for merging pull request.

func MilestoneStats Uses

func MilestoneStats(repoID int64) (open int64, closed int64, err error)

MilestoneStats returns number of open and closed milestones of given repository.

func MirrorsIterate Uses

func MirrorsIterate(f func(idx int, bean interface{}) error) error

MirrorsIterate iterates all mirror repositories.

func NewAccessToken Uses

func NewAccessToken(t *AccessToken) error

NewAccessToken creates new access token.

func NewCommitStatus Uses

func NewCommitStatus(opts NewCommitStatusOptions) error

NewCommitStatus save commit statuses into database

func NewEngine Uses

func NewEngine(migrateFunc func(*xorm.Engine) error) (err error)

NewEngine initializes a new xorm.Engine

func NewIssue Uses

func NewIssue(repo *Repository, issue *Issue, labelIDs []int64, uuids []string) (err error)

NewIssue creates new issue with labels for repository.

func NewIssueLabel Uses

func NewIssueLabel(issue *Issue, label *Label, doer *User) (err error)

NewIssueLabel creates a new issue-label relation.

func NewIssueLabels Uses

func NewIssueLabels(issue *Issue, labels []*Label, doer *User) (err error)

NewIssueLabels creates a list of issue-label relations.

func NewLabel Uses

func NewLabel(label *Label) error

NewLabel creates a new label for a repository

func NewLabels Uses

func NewLabels(labels ...*Label) error

NewLabels creates new labels for a repository.

func NewMilestone Uses

func NewMilestone(m *Milestone) (err error)

NewMilestone creates new milestone of repository.

func NewPullRequest Uses

func NewPullRequest(repo *Repository, pull *Issue, labelIDs []int64, uuids []string, pr *PullRequest, patch []byte) (err error)

NewPullRequest creates new pull request with labels for repository.

func NewRepoContext Uses

func NewRepoContext()

NewRepoContext creates a new repository context

func NewRepoRedirect Uses

func NewRepoRedirect(ownerID, repoID int64, oldRepoName, newRepoName string) error

NewRepoRedirect create a new repo redirect

func NewTeam Uses

func NewTeam(t *Team) (err error)

NewTeam creates a record of new team. It's caller's responsibility to assign organization ID.

func NewTestEngine Uses

func NewTestEngine(x *xorm.Engine) (err error)

NewTestEngine sets a new test xorm.Engine

func NewTwoFactor Uses

func NewTwoFactor(t *TwoFactor) error

NewTwoFactor creates a new two-factor authentication token.

func NewXORMLogger Uses

func NewXORMLogger(showSQL bool) core.ILogger

NewXORMLogger inits a log bridge for xorm

func NormalizeWikiName Uses

func NormalizeWikiName(name string) string

NormalizeWikiName normalizes a wiki name

func NotifyWatchers Uses

func NotifyWatchers(act *Action) error

NotifyWatchers creates batch of actions for every watcher.

func ParseCommitsWithSignature Uses

func ParseCommitsWithSignature(oldCommits *list.List) *list.List

ParseCommitsWithSignature checks if signaute of commits are corresponding to users gpg keys.

func ParseCommitsWithStatus Uses

func ParseCommitsWithStatus(oldCommits *list.List, repo *Repository) *list.List

ParseCommitsWithStatus checks commits latest statuses and calculates its worst status state

func Ping Uses

func Ping() error

Ping tests if database is alive

func PrepareTestDatabase Uses

func PrepareTestDatabase() error

PrepareTestDatabase load test fixtures into test database

func PrepareTestEnv Uses

func PrepareTestEnv(t testing.TB)

PrepareTestEnv prepares the environment for unit tests. Can only be called by tests that use the above MainTest(..) function.

func PublicSigningKey Uses

func PublicSigningKey(repoPath string) (string, error)

PublicSigningKey gets the public signing key within a provided repository directory

func PushUpdateAddTag Uses

func PushUpdateAddTag(repo *Repository, gitRepo *git.Repository, tagName string) error

PushUpdateAddTag must be called for any push actions to add tag

func PushUpdateDeleteTag Uses

func PushUpdateDeleteTag(repo *Repository, tagName string) error

PushUpdateDeleteTag must be called for any push actions to delete tag

func PushingEnvironment Uses

func PushingEnvironment(doer *User, repo *Repository) []string

PushingEnvironment returns an os environment to allow hooks to work on push

func ReinitMissingRepositories Uses

func ReinitMissingRepositories() error

ReinitMissingRepositories reinitializes all repository records that lost Git files.

func RemoveAccountLink(user *User, loginSourceID int64) (int64, error)

RemoveAccountLink will remove all external login sources for the given user

func RemoveAllWithNotice Uses

func RemoveAllWithNotice(title, path string)

RemoveAllWithNotice removes all directories in given path and creates a system notice when error occurs.

func RemoveIssueDependency Uses

func RemoveIssueDependency(user *User, issue *Issue, dep *Issue, depType DependencyType) (err error)

RemoveIssueDependency removes a dependency from an issue

func RemoveOldDeletedBranches Uses

func RemoveOldDeletedBranches()

RemoveOldDeletedBranches removes old deleted branches

func RemoveOrgUser Uses

func RemoveOrgUser(orgID, userID int64) error

RemoveOrgUser removes user from given organization.

func RemoveRandomAvatars Uses

func RemoveRandomAvatars() error

RemoveRandomAvatars removes the randomly generated avatars that were created for repositories

func RemoveTeamMember Uses

func RemoveTeamMember(team *Team, userID int64) error

RemoveTeamMember removes member from given team of given organization.

func RemoveTemporaryPath Uses

func RemoveTemporaryPath(basePath string) error

RemoveTemporaryPath removes the temporary path

func RepoPath Uses

func RepoPath(userName, repoName string) string

RepoPath returns repository path by given user and repository name.

func RevokeOAuth2Grant Uses

func RevokeOAuth2Grant(grantID, userID int64) error

RevokeOAuth2Grant deletes the grant with grantID and userID

func RewriteAllPublicKeys Uses

func RewriteAllPublicKeys() error

RewriteAllPublicKeys removes any authorized key and rewrite all keys from database again. Note: x.Iterate does not get latest data after insert/delete, so we have to call this function outside any session scope independently.

func SMTPAuth Uses

func SMTPAuth(a smtp.Auth, cfg *SMTPConfig) error

SMTPAuth performs an SMTP authentication.

func SSHKeyGenParsePublicKey Uses

func SSHKeyGenParsePublicKey(key string) (string, int, error)

SSHKeyGenParsePublicKey extracts key type and length using ssh-keygen.

func SSHNativeParsePublicKey Uses

func SSHNativeParsePublicKey(keyLine string) (string, int, error)

SSHNativeParsePublicKey extracts the key type and length using the golang SSH library.

func SanitizeAndValidateTopics Uses

func SanitizeAndValidateTopics(topics []string) (validTopics []string, invalidTopics []string)

SanitizeAndValidateTopics sanitizes and checks an array or topics

func SaveTopics Uses

func SaveTopics(repoID int64, topicNames ...string) error

SaveTopics save topics to a repository

func SearchIssueIDsByKeyword Uses

func SearchIssueIDsByKeyword(kw string, repoIDs []int64, limit, start int) (int64, []int64, error)

SearchIssueIDsByKeyword search issues on database

func SecToTime Uses

func SecToTime(duration int64) string

SecToTime converts an amount of seconds to a human-readable string (example: 66s -> 1min 6s)

func SetEngine Uses

func SetEngine() (err error)

SetEngine sets the xorm.Engine

func SetNotificationStatus Uses

func SetNotificationStatus(notificationID int64, user *User, status NotificationStatus) error

SetNotificationStatus change the notification status

func SignInitialCommit Uses

func SignInitialCommit(repoPath string, u *User) (bool, string)

SignInitialCommit determines if we should sign the initial commit to this repository

func SortReleases Uses

func SortReleases(rels []*Release)

SortReleases sorts releases by number of commits and created time.

func StarRepo Uses

func StarRepo(userID, repoID int64, star bool) error

StarRepo or unstar repository.

func StopwatchExists Uses

func StopwatchExists(userID int64, issueID int64) bool

StopwatchExists returns true if the stopwatch exists

func SyncExternalUsers Uses

func SyncExternalUsers()

SyncExternalUsers is used to synchronize users with external authorization source

func SyncReleasesWithTags Uses

func SyncReleasesWithTags(repo *Repository, gitRepo *git.Repository) error

SyncReleasesWithTags synchronizes release table with repository tags

func SyncRepositoryHooks Uses

func SyncRepositoryHooks() error

SyncRepositoryHooks rewrites all repositories' pre-receive, update and post-receive hooks to make sure the binary and custom conf path are up-to-date.

func TestPullRequests Uses

func TestPullRequests()

TestPullRequests checks and tests untested patches of pull requests. TODO: test more pull requests at same time.

func ToggleUserOpenIDVisibility Uses

func ToggleUserOpenIDVisibility(id int64) (err error)

ToggleUserOpenIDVisibility toggles visibility of an openid address of given user.

func TotalTimes Uses

func TotalTimes(options FindTrackedTimesOptions) (map[*User]string, error)

TotalTimes returns the spent time for each user by an issue

func TransferOwnership Uses

func TransferOwnership(doer *User, newOwnerName string, repo *Repository) error

TransferOwnership transfers all corresponding setting from old user to new one.

func TransferRepoAction Uses

func TransferRepoAction(doer, oldOwner *User, repo *Repository) error

TransferRepoAction adds new action for transferring repository, the Owner field of repository is assumed to be new owner.

func TxDBContext Uses

func TxDBContext() (DBContext, Committer, error)

TxDBContext represents a transaction DBContext

func UnfollowUser Uses

func UnfollowUser(userID, followID int64) (err error)

UnfollowUser unmarks someone as another's follower.

func UnlockIssue Uses

func UnlockIssue(opts *IssueLockOptions) error

UnlockIssue unlocks a previously locked issue.

func UpdateAccessToken Uses

func UpdateAccessToken(t *AccessToken) error

UpdateAccessToken updates information of access token.

func UpdateAttachment Uses

func UpdateAttachment(atta *Attachment) error

UpdateAttachment updates the given attachment in database

func UpdateComment Uses

func UpdateComment(c *Comment, doer *User) error

UpdateComment updates information of comment.

func UpdateCommentsMigrationsByType Uses

func UpdateCommentsMigrationsByType(tp structs.GitServiceType, originalAuthorID string, posterID int64) error

UpdateCommentsMigrationsByType updates comments' migrations information via given git service type and original id and poster id

func UpdateDeployKey Uses

func UpdateDeployKey(key *DeployKey) error

UpdateDeployKey updates deploy key information.

func UpdateDeployKeyCols Uses

func UpdateDeployKeyCols(key *DeployKey, cols ...string) error

UpdateDeployKeyCols updates deploy key information in the specified columns.

func UpdateExternalUser Uses

func UpdateExternalUser(user *User, gothUser goth.User) error

UpdateExternalUser updates external user's information

func UpdateHookTask Uses

func UpdateHookTask(t *HookTask) error

UpdateHookTask updates information of hook task.

func UpdateIssue Uses

func UpdateIssue(issue *Issue) error

UpdateIssue updates all fields of given issue.

func UpdateIssueDeadline Uses

func UpdateIssueDeadline(issue *Issue, deadlineUnix timeutil.TimeStamp, doer *User) (err error)

UpdateIssueDeadline updates an issue deadline and adds comments. Setting a deadline to 0 means deleting it.

func UpdateIssueMentions Uses

func UpdateIssueMentions(ctx DBContext, issueID int64, mentions []*User) error

UpdateIssueMentions updates issue-user relations for mentioned users.

func UpdateIssueUserByRead Uses

func UpdateIssueUserByRead(uid, issueID int64) error

UpdateIssueUserByRead updates issue-user relation for reading.

func UpdateIssueUsersByMentions Uses

func UpdateIssueUsersByMentions(ctx DBContext, issueID int64, uids []int64) error

UpdateIssueUsersByMentions updates issue-user pairs by mentioning.

func UpdateIssuesCommit Uses

func UpdateIssuesCommit(doer *User, repo *Repository, commits []*PushCommit, branchName string) error

UpdateIssuesCommit checks if issues are manipulated by commit message.

func UpdateIssuesMigrationsByType Uses

func UpdateIssuesMigrationsByType(gitServiceType structs.GitServiceType, originalAuthorID string, posterID int64) error

UpdateIssuesMigrationsByType updates all migrated repositories' issues from gitServiceType to replace originalAuthorID to posterID

func UpdateLabel Uses

func UpdateLabel(l *Label) error

UpdateLabel updates label information.

func UpdateMigrationsByType Uses

func UpdateMigrationsByType(tp structs.GitServiceType, externalUserID string, userID int64) error

UpdateMigrationsByType updates all migrated repositories' posterid from gitServiceType to replace originalAuthorID to posterID

func UpdateMilestone Uses

func UpdateMilestone(m *Milestone) error

UpdateMilestone updates information of given milestone.

func UpdateMirror Uses

func UpdateMirror(m *Mirror) error

UpdateMirror updates the mirror

func UpdateNotificationStatuses Uses

func UpdateNotificationStatuses(user *User, currentStatus NotificationStatus, desiredStatus NotificationStatus) error

UpdateNotificationStatuses updates the statuses of all of a user's notifications that are of the currentStatus type to the desiredStatus

func UpdateOAuth2Application Uses

func UpdateOAuth2Application(opts UpdateOAuth2ApplicationOptions) error

UpdateOAuth2Application updates an oauth2 application

func UpdateProtectBranch Uses

func UpdateProtectBranch(repo *Repository, protectBranch *ProtectedBranch, opts WhitelistOptions) (err error)

UpdateProtectBranch saves branch protection options of repository. If ID is 0, it creates a new record. Otherwise, updates existing record. This function also performs check if whitelist user and team's IDs have been changed to avoid unnecessary whitelist delete and regenerate.

func UpdatePublicKeyUpdated Uses

func UpdatePublicKeyUpdated(id int64) error

UpdatePublicKeyUpdated updates public key use time.

func UpdateRelease Uses

func UpdateRelease(rel *Release) error

UpdateRelease updates all columns of a release

func UpdateReleasesMigrationsByType Uses

func UpdateReleasesMigrationsByType(gitServiceType structs.GitServiceType, originalAuthorID string, posterID int64) error

UpdateReleasesMigrationsByType updates all migrated repositories' releases from gitServiceType to replace originalAuthorID to posterID

func UpdateRepoIndexer Uses

func UpdateRepoIndexer(repo *Repository, watchers ...chan<- error)

UpdateRepoIndexer update a repository's entries in the indexer

func UpdateRepository Uses

func UpdateRepository(repo *Repository, visibilityChanged bool) (err error)

UpdateRepository updates a repository

func UpdateRepositoryCols Uses

func UpdateRepositoryCols(repo *Repository, cols ...string) error

UpdateRepositoryCols updates repository's columns

func UpdateRepositoryUnits Uses

func UpdateRepositoryUnits(repo *Repository, units []RepoUnit) (err error)

UpdateRepositoryUnits updates a repository's units

func UpdateRepositoryUpdatedTime Uses

func UpdateRepositoryUpdatedTime(repoID int64, updateTime time.Time) error

UpdateRepositoryUpdatedTime updates a repository's updated time

func UpdateReview Uses

func UpdateReview(r *Review) error

UpdateReview will update all cols of the given review in db

func UpdateSource Uses

func UpdateSource(source *LoginSource) error

UpdateSource updates a LoginSource record in DB.

func UpdateTeam Uses

func UpdateTeam(t *Team, authChanged bool, includeAllChanged bool) (err error)

UpdateTeam updates information of team.

func UpdateTeamUnits Uses

func UpdateTeamUnits(team *Team, units []TeamUnit) (err error)

UpdateTeamUnits updates a teams's units

func UpdateTwoFactor Uses

func UpdateTwoFactor(t *TwoFactor) error

UpdateTwoFactor updates a two-factor authentication token.

func UpdateUser Uses

func UpdateUser(u *User) error

UpdateUser updates user's information.

func UpdateUserCols Uses

func UpdateUserCols(u *User, cols ...string) error

UpdateUserCols update user according special columns

func UpdateUserSetting Uses

func UpdateUserSetting(u *User) error

UpdateUserSetting updates user's settings.

func UpdateWebhook Uses

func UpdateWebhook(w *Webhook) error

UpdateWebhook updates information of webhook.

func UpdateWebhookLastStatus Uses

func UpdateWebhookLastStatus(w *Webhook) error

UpdateWebhookLastStatus updates last status of webhook.

func UploadLocalPath Uses

func UploadLocalPath(uuid string) string

UploadLocalPath returns where uploads is stored in local file system based on given UUID.

func UserPath Uses

func UserPath(userName string) string

UserPath returns the path absolute path of user repositories.

func UsersInTeamsCount Uses

func UsersInTeamsCount(userIDs []int64, teamIDs []int64) (int64, error)

UsersInTeamsCount counts the number of users which are in userIDs and teamIDs

func ValidateCommitsWithEmails Uses

func ValidateCommitsWithEmails(oldCommits *list.List) *list.List

ValidateCommitsWithEmails checks if authors' e-mails of commits are corresponding to users.

func ValidateTopic Uses

func ValidateTopic(topic string) bool

ValidateTopic checks a topic by length and match pattern rules

func WatchIfAuto Uses

func WatchIfAuto(userID int64, repoID int64, isWrite bool) error

WatchIfAuto subscribes to repo if AutoWatchOnChanges is set

func WatchRepo Uses

func WatchRepo(userID, repoID int64, watch bool) (err error)

WatchRepo watch or unwatch repository.

func WatchRepoMode Uses

func WatchRepoMode(userID, repoID int64, mode RepoWatchMode) (err error)

WatchRepoMode watch repository in specific mode.

func WikiFilenameToName Uses

func WikiFilenameToName(filename string) (string, error)

WikiFilenameToName converts a wiki filename to its corresponding page name.

func WikiNameToFilename Uses

func WikiNameToFilename(name string) string

WikiNameToFilename converts a wiki name to its corresponding filename.

func WikiNameToSubURL Uses

func WikiNameToSubURL(name string) string

WikiNameToSubURL converts a wiki name to its corresponding sub-URL.

func WikiPath Uses

func WikiPath(userName, repoName string) string

WikiPath returns wiki data path by given user and repository name.

func WithContext Uses

func WithContext(f func(ctx DBContext) error) error

WithContext represents executing database operations

func WithTx Uses

func WithTx(f func(ctx DBContext) error) error

WithTx represents executing database operations on a trasaction

type Access Uses

type Access struct {
    ID     int64 `xorm:"pk autoincr"`
    UserID int64 `xorm:"UNIQUE(s)"`
    RepoID int64 `xorm:"UNIQUE(s)"`
    Mode   AccessMode
}

Access represents the highest access level of a user to the repository. The only access type that is not in this table is the real owner of a repository. In case of an organization repository, the members of the owners team are in this table.

type AccessMode Uses

type AccessMode int

AccessMode specifies the users access mode

const (
    // AccessModeNone no access
    AccessModeNone AccessMode = iota // 0
    // AccessModeRead read access
    AccessModeRead // 1
    // AccessModeWrite write access
    AccessModeWrite // 2
    // AccessModeAdmin admin access
    AccessModeAdmin // 3
    // AccessModeOwner owner access
    AccessModeOwner // 4
)

func AccessLevel Uses

func AccessLevel(user *User, repo *Repository) (AccessMode, error)

AccessLevel returns the Access a user has to a repository. Will return NoneAccess if the user does not have access.

func AccessLevelUnit Uses

func AccessLevelUnit(user *User, repo *Repository, unitType UnitType) (AccessMode, error)

AccessLevelUnit returns the Access a user has to a repository's. Will return NoneAccess if the user does not have access.

func ParseAccessMode Uses

func ParseAccessMode(permission string) AccessMode

ParseAccessMode returns corresponding access mode to given permission string.

func (AccessMode) ColorFormat Uses

func (mode AccessMode) ColorFormat(s fmt.State)

ColorFormat provides a ColorFormatted version of this AccessMode

func (AccessMode) String Uses

func (mode AccessMode) String() string

type AccessToken Uses

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 Uses

func GetAccessTokenBySHA(token string) (*AccessToken, error)

GetAccessTokenBySHA returns access token by given token value

func ListAccessTokens Uses

func ListAccessTokens(uid int64) ([]*AccessToken, error)

ListAccessTokens returns a list of access tokens belongs to given user.

func (*AccessToken) AfterLoad Uses

func (t *AccessToken) AfterLoad()

AfterLoad is invoked from XORM after setting the values of all fields of this object.

type AccessibleReposEnvironment Uses

type AccessibleReposEnvironment interface {
    CountRepos() (int64, error)
    RepoIDs(page, pageSize int) ([]int64, error)
    Repos(page, pageSize int) ([]*Repository, error)
    MirrorRepos() ([]*Repository, error)
    AddKeyword(keyword string)
    SetSort(SearchOrderBy)
}

AccessibleReposEnvironment operations involving the repositories that are accessible to a particular user

type Action Uses

type Action struct {
    ID          int64 `xorm:"pk autoincr"`
    UserID      int64 `xorm:"INDEX"` // Receiver user id.
    OpType      ActionType
    ActUserID   int64       `xorm:"INDEX"` // Action user id.
    ActUser     *User       `xorm:"-"`
    RepoID      int64       `xorm:"INDEX"`
    Repo        *Repository `xorm:"-"`
    CommentID   int64       `xorm:"INDEX"`
    Comment     *Comment    `xorm:"-"`
    IsDeleted   bool        `xorm:"INDEX NOT NULL DEFAULT false"`
    RefName     string
    IsPrivate   bool               `xorm:"INDEX NOT NULL DEFAULT false"`
    Content     string             `xorm:"TEXT"`
    CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"`
}

Action represents user operation type and other information to repository. It implemented interface base.Actioner so that can be used in template render.

func GetFeeds Uses

func GetFeeds(opts GetFeedsOptions) ([]*Action, error)

GetFeeds returns actions according to the provided options

func (*Action) GetActAvatar Uses

func (a *Action) GetActAvatar() string

GetActAvatar the action's user's avatar link

func (*Action) GetActFullName Uses

func (a *Action) GetActFullName() string

GetActFullName gets the action's user full name.

func (*Action) GetActUserName Uses

func (a *Action) GetActUserName() string

GetActUserName gets the action's user name.

func (*Action) GetBranch Uses

func (a *Action) GetBranch() string

GetBranch returns the action's repository branch.

func (a *Action) GetCommentLink() string

GetCommentLink returns link to action comment.

func (*Action) GetContent Uses

func (a *Action) GetContent() string

GetContent returns the action's content.

func (*Action) GetCreate Uses

func (a *Action) GetCreate() time.Time

GetCreate returns the action creation time.

func (*Action) GetDisplayName Uses

func (a *Action) GetDisplayName() string

GetDisplayName gets the action's display name based on DEFAULT_SHOW_FULL_NAME

func (*Action) GetDisplayNameTitle Uses

func (a *Action) GetDisplayNameTitle() string

GetDisplayNameTitle gets the action's display name used for the title (tooltip) based on DEFAULT_SHOW_FULL_NAME

func (*Action) GetIssueContent Uses

func (a *Action) GetIssueContent() string

GetIssueContent returns the content of first issue associated with this action.

func (*Action) GetIssueInfos Uses

func (a *Action) GetIssueInfos() []string

GetIssueInfos returns a list of issues associated with the action.

func (*Action) GetIssueTitle Uses

func (a *Action) GetIssueTitle() string

GetIssueTitle returns the title of first issue associated with the action.

func (*Action) GetOpType Uses

func (a *Action) GetOpType() ActionType

GetOpType gets the ActionType of this action.

func (a *Action) GetRepoLink() string

GetRepoLink returns relative link to action repository.

func (*Action) GetRepoName Uses

func (a *Action) GetRepoName() string

GetRepoName returns the name of the action repository.

func (*Action) GetRepoPath Uses

func (a *Action) GetRepoPath() string

GetRepoPath returns the virtual path to the action repository.

func (*Action) GetRepoUserName Uses

func (a *Action) GetRepoUserName() string

GetRepoUserName returns the name of the action repository owner.

func (*Action) ShortActUserName Uses

func (a *Action) ShortActUserName() string

ShortActUserName gets the action's user name trimmed to max 20 chars.

func (*Action) ShortRepoName Uses

func (a *Action) ShortRepoName() string

ShortRepoName returns the name of the action repository trimmed to max 33 chars.

func (*Action) ShortRepoPath Uses

func (a *Action) ShortRepoPath() string

ShortRepoPath returns the virtual path to the action repository trimmed to max 20 + 1 + 33 chars.

func (*Action) ShortRepoUserName Uses

func (a *Action) ShortRepoUserName() string

ShortRepoUserName returns the name of the action repository owner trimmed to max 20 chars.

type ActionList Uses

type ActionList []*Action

ActionList defines a list of actions

func (ActionList) LoadAttributes Uses

func (actions ActionList) LoadAttributes() error

LoadAttributes loads attributes of the actions

func (ActionList) LoadRepositories Uses

func (actions ActionList) LoadRepositories() ([]*Repository, error)

LoadRepositories loads actions' all repositories

func (ActionList) LoadUsers Uses

func (actions ActionList) LoadUsers() ([]*User, error)

LoadUsers loads actions' all users

type ActionType Uses

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
)

Possible action types.

type ActivityAuthorData Uses

type ActivityAuthorData struct {
    Name       string `json:"name"`
    Login      string `json:"login"`
    AvatarLink string `json:"avatar_link"`
    Commits    int64  `json:"commits"`
}

ActivityAuthorData represents statistical git commit count data

func GetActivityStatsTopAuthors Uses

func GetActivityStatsTopAuthors(repo *Repository, timeFrom time.Time, count int) ([]*ActivityAuthorData, error)

GetActivityStatsTopAuthors returns top author stats for git commits for all branches

type ActivityStats Uses

type ActivityStats struct {
    OpenedPRs                   PullRequestList
    OpenedPRAuthorCount         int64
    MergedPRs                   PullRequestList
    MergedPRAuthorCount         int64
    OpenedIssues                IssueList
    OpenedIssueAuthorCount      int64
    ClosedIssues                IssueList
    ClosedIssueAuthorCount      int64
    UnresolvedIssues            IssueList
    PublishedReleases           []*Release
    PublishedReleaseAuthorCount int64
    Code                        *git.CodeActivityStats
}

ActivityStats represets issue and pull request information.

func GetActivityStats Uses

func GetActivityStats(repo *Repository, timeFrom time.Time, releases, issues, prs, code bool) (*ActivityStats, error)

GetActivityStats return stats for repository at given time range

func (*ActivityStats) ActiveIssueCount Uses

func (stats *ActivityStats) ActiveIssueCount() int

ActiveIssueCount returns total active issue count

func (*ActivityStats) ActivePRCount Uses

func (stats *ActivityStats) ActivePRCount() int

ActivePRCount returns total active pull request count

func (*ActivityStats) ClosedIssueCount Uses

func (stats *ActivityStats) ClosedIssueCount() int

ClosedIssueCount returns closed issue count

func (*ActivityStats) ClosedIssuePerc Uses

func (stats *ActivityStats) ClosedIssuePerc() int

ClosedIssuePerc returns closed issue count percent from total active

func (*ActivityStats) FillIssues Uses

func (stats *ActivityStats) FillIssues(repoID int64, fromTime time.Time) error

FillIssues returns issue information for activity page

func (*ActivityStats) FillPullRequests Uses

func (stats *ActivityStats) FillPullRequests(repoID int64, fromTime time.Time) error

FillPullRequests returns pull request information for activity page

func (*ActivityStats) FillReleases Uses

func (stats *ActivityStats) FillReleases(repoID int64, fromTime time.Time) error

FillReleases returns release information for activity page

func (*ActivityStats) FillUnresolvedIssues Uses

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 Uses

func (stats *ActivityStats) MergedPRCount() int

MergedPRCount returns merged pull request count

func (*ActivityStats) MergedPRPerc Uses

func (stats *ActivityStats) MergedPRPerc() int

MergedPRPerc returns merged pull request percent from total active

func (*ActivityStats) OpenedIssueCount Uses

func (stats *ActivityStats) OpenedIssueCount() int

OpenedIssueCount returns open issue count

func (*ActivityStats) OpenedIssuePerc Uses

func (stats *ActivityStats) OpenedIssuePerc() int

OpenedIssuePerc returns open issue count percent from total active

func (*ActivityStats) OpenedPRCount Uses

func (stats *ActivityStats) OpenedPRCount() int

OpenedPRCount returns opened pull request count

func (*ActivityStats) OpenedPRPerc Uses

func (stats *ActivityStats) OpenedPRPerc() int

OpenedPRPerc returns opened pull request percents from total active

func (*ActivityStats) PublishedReleaseCount Uses

func (stats *ActivityStats) PublishedReleaseCount() int

PublishedReleaseCount returns published release count

func (*ActivityStats) UnresolvedIssueCount Uses

func (stats *ActivityStats) UnresolvedIssueCount() int

UnresolvedIssueCount returns unresolved issue and pull request count

type Attachment Uses

type Attachment struct {
    ID            int64  `xorm:"pk autoincr"`
    UUID          string `xorm:"uuid UNIQUE"`
    IssueID       int64  `xorm:"INDEX"`
    ReleaseID     int64  `xorm:"INDEX"`
    UploaderID    int64  `xorm:"INDEX DEFAULT 0"` // Notice: will be zero before this column added
    CommentID     int64
    Name          string
    DownloadCount int64              `xorm:"DEFAULT 0"`
    Size          int64              `xorm:"DEFAULT 0"`
    CreatedUnix   timeutil.TimeStamp `xorm:"created"`
}

Attachment represent a attachment of issue/comment/release.

func GetAttachmentByID Uses

func GetAttachmentByID(id int64) (*Attachment, error)

GetAttachmentByID returns attachment by given id

func GetAttachmentByReleaseIDFileName Uses

func GetAttachmentByReleaseIDFileName(releaseID int64, fileName string) (*Attachment, error)

GetAttachmentByReleaseIDFileName returns attachment by given releaseId and fileName.

func GetAttachmentByUUID Uses

func GetAttachmentByUUID(uuid string) (*Attachment, error)

GetAttachmentByUUID returns attachment by given UUID.

func GetAttachmentsByCommentID Uses

func GetAttachmentsByCommentID(commentID int64) ([]*Attachment, error)

GetAttachmentsByCommentID returns all attachments if comment by given ID.

func GetAttachmentsByIssueID Uses

func GetAttachmentsByIssueID(issueID int64) ([]*Attachment, error)

GetAttachmentsByIssueID returns all attachments of an issue.

func NewAttachment Uses

func NewAttachment(attach *Attachment, buf []byte, file io.Reader) (_ *Attachment, err error)

NewAttachment creates a new attachment object.

func (*Attachment) APIFormat Uses

func (a *Attachment) APIFormat() *api.Attachment

APIFormat converts models.Attachment to api.Attachment

func (*Attachment) DownloadURL Uses

func (a *Attachment) DownloadURL() string

DownloadURL returns the download url of the attached file

func (*Attachment) IncreaseDownloadCount Uses

func (a *Attachment) IncreaseDownloadCount() error

IncreaseDownloadCount is update download count + 1

func (*Attachment) LocalPath Uses

func (a *Attachment) LocalPath() string

LocalPath returns where attachment is stored in local file system.

type CloneLink struct {
    SSH   string
    HTTPS string
    Git   string
}

CloneLink represents different types of clone URLs of repository.

type CodeComments Uses

type CodeComments map[string]map[int64][]*Comment

CodeComments represents comments on code by using this structure: FILENAME -> LINE (+ == proposed; - == previous) -> COMMENTS

func FetchCodeComments Uses

func FetchCodeComments(issue *Issue, currentUser *User) (CodeComments, error)

FetchCodeComments will return a 2d-map: ["Path"]["Line"] = Comments at line

type Collaboration Uses

type Collaboration struct {
    ID     int64      `xorm:"pk autoincr"`
    RepoID int64      `xorm:"UNIQUE(s) INDEX NOT NULL"`
    UserID int64      `xorm:"UNIQUE(s) INDEX NOT NULL"`
    Mode   AccessMode `xorm:"DEFAULT 2 NOT NULL"`
}

Collaboration represent the relation between an individual and a repository.

type Collaborator Uses

type Collaborator struct {
    *User
    Collaboration *Collaboration
}

Collaborator represents a user with collaboration details.

type Comment Uses

type Comment struct {
    ID               int64       `xorm:"pk autoincr"`
    Type             CommentType `xorm:"index"`
    PosterID         int64       `xorm:"INDEX"`
    Poster           *User       `xorm:"-"`
    OriginalAuthor   string
    OriginalAuthorID int64
    IssueID          int64  `xorm:"INDEX"`
    Issue            *Issue `xorm:"-"`
    LabelID          int64
    Label            *Label `xorm:"-"`
    OldMilestoneID   int64
    MilestoneID      int64
    OldMilestone     *Milestone `xorm:"-"`
    Milestone        *Milestone `xorm:"-"`
    AssigneeID       int64
    RemovedAssignee  bool
    Assignee         *User `xorm:"-"`
    OldTitle         string
    NewTitle         string
    DependentIssueID int64
    DependentIssue   *Issue `xorm:"-"`

    CommitID        int64
    Line            int64 // - previous line / + proposed line
    TreePath        string
    Content         string `xorm:"TEXT"`
    RenderedContent string `xorm:"-"`

    // Path represents the 4 lines of code cemented by this comment
    Patch string `xorm:"TEXT"`

    CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"`
    UpdatedUnix timeutil.TimeStamp `xorm:"INDEX updated"`

    // Reference issue in commit message
    CommitSHA string `xorm:"VARCHAR(40)"`

    Attachments []*Attachment `xorm:"-"`
    Reactions   ReactionList  `xorm:"-"`

    // For view issue page.
    ShowTag CommentTag `xorm:"-"`

    Review      *Review `xorm:"-"`
    ReviewID    int64   `xorm:"index"`
    Invalidated bool

    // Reference an issue or pull from another comment, issue or PR
    // All information is about the origin of the reference
    RefRepoID    int64                 `xorm:"index"` // Repo where the referencing
    RefIssueID   int64                 `xorm:"index"`
    RefCommentID int64                 `xorm:"index"`    // 0 if origin is Issue title or content (or PR's)
    RefAction    references.XRefAction `xorm:"SMALLINT"` // What hapens if RefIssueID resolves
    RefIsPull    bool

    RefRepo    *Repository `xorm:"-"`
    RefIssue   *Issue      `xorm:"-"`
    RefComment *Comment    `xorm:"-"`
}

Comment represents a comment in commit and issue page.

func CreateComment Uses

func CreateComment(opts *CreateCommentOptions) (comment *Comment, err error)

CreateComment creates comment of issue or commit.

func FindComments Uses

func FindComments(opts FindCommentsOptions) ([]*Comment, error)

FindComments returns all comments according options

func GetCommentByID Uses

func GetCommentByID(id int64) (*Comment, error)

GetCommentByID returns the comment by given ID.

func (*Comment) APIFormat Uses

func (c *Comment) APIFormat() *api.Comment

APIFormat converts a Comment to the api.Comment format

func (*Comment) AfterDelete Uses

func (c *Comment) AfterDelete()

AfterDelete is invoked from XORM after the object is deleted.

func (*Comment) CheckInvalidation Uses

func (c *Comment) CheckInvalidation(repo *git.Repository, doer *User, branch string) error

CheckInvalidation checks if the line of code comment got changed by another commit. If the line got changed the comment is going to be invalidated.

func (*Comment) CodeCommentURL Uses

func (c *Comment) CodeCommentURL() string

CodeCommentURL returns the url to a comment in code

func (*Comment) DiffSide Uses

func (c *Comment) DiffSide() string

DiffSide returns "previous" if Comment.Line is a LOC of the previous changes and "proposed" if it is a LOC of the proposed changes.

func (*Comment) EventTag Uses

func (c *Comment) EventTag() string

EventTag returns unique event hash tag for comment.

func (*Comment) HTMLURL Uses

func (c *Comment) HTMLURL() string

HTMLURL formats a URL-string to the issue-comment

func (*Comment) HashTag Uses

func (c *Comment) HashTag() string

HashTag returns unique hash tag for comment.

func (*Comment) IssueURL Uses

func (c *Comment) IssueURL() string

IssueURL formats a URL-string to the issue

func (*Comment) LoadAssigneeUser Uses

func (c *Comment) LoadAssigneeUser() error

LoadAssigneeUser if comment.Type is CommentTypeAssignees, then load assignees

func (*Comment) LoadAttachments Uses

func (c *Comment) LoadAttachments() error

LoadAttachments loads attachments

func (*Comment) LoadDepIssueDetails Uses

func (c *Comment) LoadDepIssueDetails() (err error)

LoadDepIssueDetails loads Dependent Issue Details

func (*Comment) LoadIssue Uses

func (c *Comment) LoadIssue() (err error)

LoadIssue loads issue from database

func (*Comment) LoadLabel Uses

func (c *Comment) LoadLabel() error

LoadLabel if comment.Type is CommentTypeLabel, then load Label

func (*Comment) LoadMilestone Uses

func (c *Comment) LoadMilestone() error

LoadMilestone if comment.Type is CommentTypeMilestone, then load milestone

func (*Comment) LoadPoster Uses

func (c *Comment) LoadPoster() error

LoadPoster loads comment poster

func (*Comment) LoadReactions Uses

func (c *Comment) LoadReactions() error

LoadReactions loads comment reactions

func (*Comment) LoadRefComment Uses

func (comment *Comment) LoadRefComment() (err error)

LoadRefComment loads comment that created this reference from database

func (*Comment) LoadRefIssue Uses

func (comment *Comment) LoadRefIssue() (err error)

LoadRefIssue loads comment that created this reference from database

func (*Comment) LoadReview Uses

func (c *Comment) LoadReview() error

LoadReview loads the associated review

func (*Comment) PRURL Uses

func (c *Comment) PRURL() string

PRURL formats a URL-string to the pull-request

func (*Comment) RefCommentHTMLURL Uses

func (comment *Comment) RefCommentHTMLURL() string

RefCommentHTMLURL returns the HTML URL for the comment that created this reference

func (*Comment) RefIssueHTMLURL Uses

func (comment *Comment) RefIssueHTMLURL() string

RefIssueHTMLURL returns the HTML URL of the issue where this reference was created

func (*Comment) RefIssueIdent Uses

func (comment *Comment) RefIssueIdent() string

RefIssueIdent returns the user friendly identity (e.g. "#1234") of the issue where this reference was created

func (*Comment) RefIssueTitle Uses

func (comment *Comment) RefIssueTitle() string

RefIssueTitle returns the title of the issue where this reference was created

func (*Comment) UnsignedLine Uses

func (c *Comment) UnsignedLine() uint64

UnsignedLine returns the LOC of the code comment without + or -

func (*Comment) UpdateAttachments Uses

func (c *Comment) UpdateAttachments(uuids []string) error

UpdateAttachments update attachments by UUIDs for the comment

type CommentList Uses

type CommentList []*Comment

CommentList defines a list of comments

func (CommentList) Issues Uses

func (comments CommentList) Issues() IssueList

Issues returns all the issues of comments

func (CommentList) LoadAttachments Uses

func (comments CommentList) LoadAttachments() error

LoadAttachments loads attachments

func (CommentList) LoadAttributes Uses

func (comments CommentList) LoadAttributes() error

LoadAttributes loads attributes of the comments, except for attachments and comments

func (CommentList) LoadIssues Uses

func (comments CommentList) LoadIssues() error

LoadIssues loads issues of comments

func (CommentList) LoadPosters Uses

func (comments CommentList) LoadPosters() error

LoadPosters loads posters

type CommentTag Uses

type CommentTag int

CommentTag defines comment tag type

const (
    CommentTagNone CommentTag = iota
    CommentTagPoster
    CommentTagWriter
    CommentTagOwner
)

Enumerate all the comment tag types

type CommentType Uses

type CommentType int

CommentType defines whether a comment is just a simple comment, an action (like close) or a reference.

const (
    // Plain comment, can be associated with a commit (CommitID > 0) and a line (LineNum > 0)
    CommentTypeComment CommentType = iota
    CommentTypeReopen
    CommentTypeClose

    // References.
    CommentTypeIssueRef
    // Reference from a commit (not part of a pull request)
    CommentTypeCommitRef
    // Reference from a comment
    CommentTypeCommentRef
    // Reference from a pull request
    CommentTypePullRef
    // Labels changed
    CommentTypeLabel
    // Milestone changed
    CommentTypeMilestone
    // Assignees changed
    CommentTypeAssignees
    // Change Title
    CommentTypeChangeTitle
    // Delete Branch
    CommentTypeDeleteBranch
    // Start a stopwatch for time tracking
    CommentTypeStartTracking
    // Stop a stopwatch for time tracking
    CommentTypeStopTracking
    // Add time manual for time tracking
    CommentTypeAddTimeManual
    // Cancel a stopwatch for time tracking
    CommentTypeCancelTracking
    // Added a due date
    CommentTypeAddedDeadline
    // Modified the due date
    CommentTypeModifiedDeadline
    // Removed a due date
    CommentTypeRemovedDeadline
    // Dependency added
    CommentTypeAddDependency
    //Dependency removed
    CommentTypeRemoveDependency
    // Comment a line of code
    CommentTypeCode
    // Reviews a pull request by giving general feedback
    CommentTypeReview
    // Lock an issue, giving only collaborators access
    CommentTypeLock
    // Unlocks a previously locked issue
    CommentTypeUnlock
)

Enumerate all the comment types

const (
    CommentTypeUnknown CommentType = -1
)

define unknown comment type

type CommitStatus Uses

type CommitStatus struct {
    ID          int64             `xorm:"pk autoincr"`
    Index       int64             `xorm:"INDEX UNIQUE(repo_sha_index)"`
    RepoID      int64             `xorm:"INDEX UNIQUE(repo_sha_index)"`
    Repo        *Repository       `xorm:"-"`
    State       CommitStatusState `xorm:"VARCHAR(7) NOT NULL"`
    SHA         string            `xorm:"VARCHAR(64) NOT NULL INDEX UNIQUE(repo_sha_index)"`
    TargetURL   string            `xorm:"TEXT"`
    Description string            `xorm:"TEXT"`
    ContextHash string            `xorm:"char(40) index"`
    Context     string            `xorm:"TEXT"`
    Creator     *User             `xorm:"-"`
    CreatorID   int64

    CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"`
    UpdatedUnix timeutil.TimeStamp `xorm:"INDEX updated"`
}

CommitStatus holds a single Status of a single Commit

func CalcCommitStatus Uses

func CalcCommitStatus(statuses []*CommitStatus) *CommitStatus

CalcCommitStatus returns commit status state via some status, the commit statues should order by id desc

func GetCommitStatuses Uses

func GetCommitStatuses(repo *Repository, sha string, opts *CommitStatusOptions) ([]*CommitStatus, int64, error)

GetCommitStatuses returns all statuses for a given commit.

func GetLatestCommitStatus Uses

func GetLatestCommitStatus(repo *Repository, sha string, page int) ([]*CommitStatus, error)

GetLatestCommitStatus returns all statuses with a unique context for a given commit.

func (*CommitStatus) APIFormat Uses

func (status *CommitStatus) APIFormat() *api.Status

APIFormat assumes some fields assigned with values: Required - Repo, Creator

func (*CommitStatus) APIURL Uses

func (status *CommitStatus) APIURL() string

APIURL returns the absolute APIURL to this commit-status.

type CommitStatusOptions Uses

type CommitStatusOptions struct {
    Page     int
    State    string
    SortType string
}

CommitStatusOptions holds the options for query commit statuses

type CommitStatusState Uses

type CommitStatusState string

CommitStatusState holds the state of a Status It can be "pending", "success", "error", "failure", and "warning"

const (
    // CommitStatusPending is for when the Status is Pending
    CommitStatusPending CommitStatusState = "pending"
    // CommitStatusSuccess is for when the Status is Success
    CommitStatusSuccess CommitStatusState = "success"
    // CommitStatusError is for when the Status is Error
    CommitStatusError CommitStatusState = "error"
    // CommitStatusFailure is for when the Status is Failure
    CommitStatusFailure CommitStatusState = "failure"
    // CommitStatusWarning is for when the Status is Warning
    CommitStatusWarning CommitStatusState = "warning"
)

func (CommitStatusState) IsWorseThan Uses

func (css CommitStatusState) IsWorseThan(css2 CommitStatusState) bool

IsWorseThan returns true if this State is worse than the given State

type CommitVerification Uses

type CommitVerification struct {
    Verified       bool
    Warning        bool
    Reason         string
    SigningUser    *User
    CommittingUser *User
    SigningEmail   string
    SigningKey     *GPGKey
}

CommitVerification represents a commit validation of signature

func ParseCommitWithSignature Uses

func ParseCommitWithSignature(c *git.Commit) *CommitVerification

ParseCommitWithSignature check if signature is good against keystore.

type Committer Uses

type Committer interface {
    Commit() error
    Close()
}

Committer represents an interface to Commit or Close the dbcontext

type CreateCommentOptions Uses

type CreateCommentOptions struct {
    Type  CommentType
    Doer  *User
    Repo  *Repository
    Issue *Issue
    Label *Label

    DependentIssueID int64
    OldMilestoneID   int64
    MilestoneID      int64
    AssigneeID       int64
    RemovedAssignee  bool
    OldTitle         string
    NewTitle         string
    CommitID         int64
    CommitSHA        string
    Patch            string
    LineNum          int64
    TreePath         string
    ReviewID         int64
    Content          string
    Attachments      []string // UUIDs of attachments
    RefRepoID        int64
    RefIssueID       int64
    RefCommentID     int64
    RefAction        references.XRefAction
    RefIsPull        bool
}

CreateCommentOptions defines options for creating comment

type CreateOAuth2ApplicationOptions Uses

type CreateOAuth2ApplicationOptions struct {
    Name         string
    UserID       int64
    RedirectURIs []string
}

CreateOAuth2ApplicationOptions holds options to create an oauth2 application

type CreateRepoOptions Uses

type CreateRepoOptions struct {
    Name        string
    Description string
    OriginalURL string
    Gitignores  string
    IssueLabels string
    License     string
    Readme      string
    IsPrivate   bool
    IsMirror    bool
    AutoInit    bool
    Status      RepositoryStatus
}

CreateRepoOptions contains the create repository options

type CreateReviewOptions Uses

type CreateReviewOptions struct {
    Content  string
    Type     ReviewType
    Issue    *Issue
    Reviewer *User
}

CreateReviewOptions represent the options to create a review. Type, Issue and Reviewer are required.

type DBContext Uses

type DBContext struct {
    // contains filtered or unexported fields
}

DBContext represents a db context

func DefaultDBContext Uses

func DefaultDBContext() DBContext

DefaultDBContext represents a DBContext with default Engine

type DeletedBranch Uses

type DeletedBranch struct {
    ID          int64              `xorm:"pk autoincr"`
    RepoID      int64              `xorm:"UNIQUE(s) INDEX NOT NULL"`
    Name        string             `xorm:"UNIQUE(s) NOT NULL"`
    Commit      string             `xorm:"UNIQUE(s) NOT NULL"`
    DeletedByID int64              `xorm:"INDEX"`
    DeletedBy   *User              `xorm:"-"`
    DeletedUnix timeutil.TimeStamp `xorm:"INDEX created"`
}

DeletedBranch struct

func (*DeletedBranch) LoadUser Uses

func (deletedBranch *DeletedBranch) LoadUser()

LoadUser loads the user that deleted the branch When there's no user found it returns a NewGhostUser

type DependencyInfo Uses

type DependencyInfo struct {
    Issue      `xorm:"extends"`
    Repository `xorm:"extends"`
}

DependencyInfo represents high level information about an issue which is a dependency of another issue.

type DependencyType Uses

type DependencyType int

DependencyType Defines Dependency Type Constants

const (
    DependencyTypeBlockedBy DependencyType = iota
    DependencyTypeBlocking
)

Define Dependency Types

type DeployKey Uses

type DeployKey struct {
    ID          int64 `xorm:"pk autoincr"`
    KeyID       int64 `xorm:"UNIQUE(s) INDEX"`
    RepoID      int64 `xorm:"UNIQUE(s) INDEX"`
    Name        string
    Fingerprint string
    Content     string `xorm:"-"`

    Mode AccessMode `xorm:"NOT NULL DEFAULT 1"`

    CreatedUnix       timeutil.TimeStamp `xorm:"created"`
    UpdatedUnix       timeutil.TimeStamp `xorm:"updated"`
    HasRecentActivity bool               `xorm:"-"`
    HasUsed           bool               `xorm:"-"`
}

DeployKey represents deploy key information and its relation with repository.

func AddDeployKey Uses

func AddDeployKey(repoID int64, name, content string, readOnly bool) (*DeployKey, error)

AddDeployKey add new deploy key to database and authorized_keys file.

func GetDeployKeyByID Uses

func GetDeployKeyByID(id int64) (*DeployKey, error)

GetDeployKeyByID returns deploy key by given ID.

func GetDeployKeyByRepo Uses

func GetDeployKeyByRepo(keyID, repoID int64) (*DeployKey, error)

GetDeployKeyByRepo returns deploy key by given public key ID and repository ID.

func ListDeployKeys Uses

func ListDeployKeys(repoID int64) ([]*DeployKey, error)

ListDeployKeys returns all deploy keys by given repository ID.

func SearchDeployKeys Uses

func SearchDeployKeys(repoID int64, keyID int64, fingerprint string) ([]*DeployKey, error)

SearchDeployKeys returns a list of deploy keys matching the provided arguments.

func (*DeployKey) AfterLoad Uses

func (key *DeployKey) AfterLoad()

AfterLoad is invoked from XORM after setting the values of all fields of this object.

func (*DeployKey) GetContent Uses

func (key *DeployKey) GetContent() error

GetContent gets associated public key content.

func (*DeployKey) IsReadOnly Uses

func (key *DeployKey) IsReadOnly() bool

IsReadOnly checks if the key can only be used for read operations

type EmailAddress Uses

type EmailAddress struct {
    ID          int64  `xorm:"pk autoincr"`
    UID         int64  `xorm:"INDEX NOT NULL"`
    Email       string `xorm:"UNIQUE NOT NULL"`
    IsActivated bool
    IsPrimary   bool `xorm:"-"`
}

EmailAddress is the list of all email addresses of a user. Can contain the primary email address, but is not obligatory.

func GetEmailAddresses Uses

func GetEmailAddresses(uid int64) ([]*EmailAddress, error)

GetEmailAddresses returns all email addresses belongs to given user.

func VerifyActiveEmailCode Uses

func VerifyActiveEmailCode(code, email string) *EmailAddress

VerifyActiveEmailCode verifies active email code when active account

func (*EmailAddress) Activate Uses

func (email *EmailAddress) Activate() error

Activate activates the email address to given user.

type Engine Uses

type Engine interface {
    Table(tableNameOrBean interface{}) *xorm.Session
    Count(...interface{}) (int64, error)
    Decr(column string, arg ...interface{}) *xorm.Session
    Delete(interface{}) (int64, error)
    Exec(...interface{}) (sql.Result, error)
    Find(interface{}, ...interface{}) error
    Get(interface{}) (bool, error)
    ID(interface{}) *xorm.Session
    In(string, ...interface{}) *xorm.Session
    Incr(column string, arg ...interface{}) *xorm.Session
    Insert(...interface{}) (int64, error)
    InsertOne(interface{}) (int64, error)
    Iterate(interface{}, xorm.IterFunc) error
    Join(joinOperator string, tablename interface{}, condition string, args ...interface{}) *xorm.Session
    SQL(interface{}, ...interface{}) *xorm.Session
    Where(interface{}, ...interface{}) *xorm.Session
    Asc(colNames ...string) *xorm.Session
}

Engine represents a xorm engine or session.

type ErrAccessTokenEmpty Uses

type ErrAccessTokenEmpty struct {
}

ErrAccessTokenEmpty represents a "AccessTokenEmpty" kind of error.

func (ErrAccessTokenEmpty) Error Uses

func (err ErrAccessTokenEmpty) Error() string

type ErrAccessTokenNotExist Uses

type ErrAccessTokenNotExist struct {
    Token string
}

ErrAccessTokenNotExist represents a "AccessTokenNotExist" kind of error.

func (ErrAccessTokenNotExist) Error Uses

func (err ErrAccessTokenNotExist) Error() string

type ErrAttachmentNotExist Uses

type ErrAttachmentNotExist struct {
    ID   int64
    UUID string
}

ErrAttachmentNotExist represents a "AttachmentNotExist" kind of error.

func (ErrAttachmentNotExist) Error Uses

func (err ErrAttachmentNotExist) Error() string

type ErrBranchAlreadyExists Uses

type ErrBranchAlreadyExists struct {
    BranchName string
}

ErrBranchAlreadyExists represents an error that branch with such name already exists.

func (ErrBranchAlreadyExists) Error Uses

func (err ErrBranchAlreadyExists) Error() string

type ErrBranchNameConflict Uses

type ErrBranchNameConflict struct {
    BranchName string
}

ErrBranchNameConflict represents an error that branch name conflicts with other branch.

func (ErrBranchNameConflict) Error Uses

func (err ErrBranchNameConflict) Error() string

type ErrCircularDependency Uses

type ErrCircularDependency struct {
    IssueID      int64
    DependencyID int64
}

ErrCircularDependency represents a "DependencyCircular" kind of error.

func (ErrCircularDependency) Error Uses

func (err ErrCircularDependency) Error() string

type ErrCommentNotExist Uses

type ErrCommentNotExist struct {
    ID      int64
    IssueID int64
}

ErrCommentNotExist represents a "CommentNotExist" kind of error.

func (ErrCommentNotExist) Error Uses

func (err ErrCommentNotExist) Error() string

type ErrCommitIDDoesNotMatch Uses

type ErrCommitIDDoesNotMatch struct {
    GivenCommitID   string
    CurrentCommitID string
}

ErrCommitIDDoesNotMatch represents a "CommitIDDoesNotMatch" kind of error.

func (ErrCommitIDDoesNotMatch) Error Uses

func (err ErrCommitIDDoesNotMatch) Error() string

type ErrDependenciesLeft Uses

type ErrDependenciesLeft struct {
    IssueID int64
}

ErrDependenciesLeft represents an error where the issue you're trying to close still has dependencies left.

func (ErrDependenciesLeft) Error Uses

func (err ErrDependenciesLeft) Error() string

type ErrDependencyExists Uses

type ErrDependencyExists struct {
    IssueID      int64
    DependencyID int64
}

ErrDependencyExists represents a "DependencyAlreadyExists" kind of error.

func (ErrDependencyExists) Error Uses

func (err ErrDependencyExists) Error() string

type ErrDependencyNotExists Uses

type ErrDependencyNotExists struct {
    IssueID      int64
    DependencyID int64
}

ErrDependencyNotExists represents a "DependencyAlreadyExists" kind of error.

func (ErrDependencyNotExists) Error Uses

func (err ErrDependencyNotExists) Error() string

type ErrDeployKeyAlreadyExist Uses

type ErrDeployKeyAlreadyExist struct {
    KeyID  int64
    RepoID int64
}

ErrDeployKeyAlreadyExist represents a "DeployKeyAlreadyExist" kind of error.

func (ErrDeployKeyAlreadyExist) Error Uses

func (err ErrDeployKeyAlreadyExist) Error() string

type ErrDeployKeyNameAlreadyUsed Uses

type ErrDeployKeyNameAlreadyUsed struct {
    RepoID int64
    Name   string
}

ErrDeployKeyNameAlreadyUsed represents a "DeployKeyNameAlreadyUsed" kind of error.

func (ErrDeployKeyNameAlreadyUsed) Error Uses

func (err ErrDeployKeyNameAlreadyUsed) Error() string

type ErrDeployKeyNotExist Uses

type ErrDeployKeyNotExist struct {
    ID     int64
    KeyID  int64
    RepoID int64
}

ErrDeployKeyNotExist represents a "DeployKeyNotExist" kind of error.

func (ErrDeployKeyNotExist) Error Uses

func (err ErrDeployKeyNotExist) Error() string

type ErrEmailAlreadyUsed Uses

type ErrEmailAlreadyUsed struct {
    Email string
}

ErrEmailAlreadyUsed represents a "EmailAlreadyUsed" kind of error.

func (ErrEmailAlreadyUsed) Error Uses

func (err ErrEmailAlreadyUsed) Error() string

type ErrExternalLoginUserAlreadyExist Uses

type ErrExternalLoginUserAlreadyExist struct {
    ExternalID    string
    UserID        int64
    LoginSourceID int64
}

ErrExternalLoginUserAlreadyExist represents a "ExternalLoginUserAlreadyExist" kind of error.

func (ErrExternalLoginUserAlreadyExist) Error Uses

func (err ErrExternalLoginUserAlreadyExist) Error() string

type ErrExternalLoginUserNotExist Uses

type ErrExternalLoginUserNotExist struct {
    UserID        int64
    LoginSourceID int64
}

ErrExternalLoginUserNotExist represents a "ExternalLoginUserNotExist" kind of error.

func (ErrExternalLoginUserNotExist) Error Uses

func (err ErrExternalLoginUserNotExist) Error() string

type ErrFilePathInvalid Uses

type ErrFilePathInvalid struct {
    Message string
    Path    string
    Name    string
    Type    git.EntryMode
}

ErrFilePathInvalid represents a "FilePathInvalid" kind of error.

func (ErrFilePathInvalid) Error Uses

func (err ErrFilePathInvalid) Error() string

type ErrFilenameInvalid Uses

type ErrFilenameInvalid struct {
    Path string
}

ErrFilenameInvalid represents a "FilenameInvalid" kind of error.

func (ErrFilenameInvalid) Error Uses

func (err ErrFilenameInvalid) Error() string

type ErrForkAlreadyExist Uses

type ErrForkAlreadyExist struct {
    Uname    string
    RepoName string
    ForkName string
}

ErrForkAlreadyExist represents a "ForkAlreadyExist" kind of error.

func (ErrForkAlreadyExist) Error Uses

func (err ErrForkAlreadyExist) Error() string

type ErrGPGKeyAccessDenied Uses

type ErrGPGKeyAccessDenied struct {
    UserID int64
    KeyID  int64
}

ErrGPGKeyAccessDenied represents a "GPGKeyAccessDenied" kind of Error.

func (ErrGPGKeyAccessDenied) Error Uses

func (err ErrGPGKeyAccessDenied) Error() string

Error pretty-prints an error of type ErrGPGKeyAccessDenied.

type ErrGPGKeyIDAlreadyUsed Uses

type ErrGPGKeyIDAlreadyUsed struct {
    KeyID string
}

ErrGPGKeyIDAlreadyUsed represents a "GPGKeyIDAlreadyUsed" kind of error.

func (ErrGPGKeyIDAlreadyUsed) Error Uses

func (err ErrGPGKeyIDAlreadyUsed) Error() string

type ErrGPGKeyImportNotExist Uses

type ErrGPGKeyImportNotExist struct {
    ID string
}

ErrGPGKeyImportNotExist represents a "GPGKeyImportNotExist" kind of error.

func (ErrGPGKeyImportNotExist) Error Uses

func (err ErrGPGKeyImportNotExist) Error() string

type ErrGPGKeyNotExist Uses

type ErrGPGKeyNotExist struct {
    ID int64
}

ErrGPGKeyNotExist represents a "GPGKeyNotExist" kind of error.

func (ErrGPGKeyNotExist) Error Uses

func (err ErrGPGKeyNotExist) Error() string

type ErrGPGKeyParsing Uses

type ErrGPGKeyParsing struct {
    ParseError error
}

ErrGPGKeyParsing represents a "ErrGPGKeyParsing" kind of error.

func (ErrGPGKeyParsing) Error Uses

func (err ErrGPGKeyParsing) Error() string

type ErrGPGNoEmailFound Uses

type ErrGPGNoEmailFound struct {
    FailedEmails []string
}

ErrGPGNoEmailFound represents a "ErrGPGNoEmailFound" kind of error.

func (ErrGPGNoEmailFound) Error Uses

func (err ErrGPGNoEmailFound) Error() string

type ErrInvalidCloneAddr Uses

type ErrInvalidCloneAddr struct {
    IsURLError         bool
    IsInvalidPath      bool
    IsPermissionDenied bool
}

ErrInvalidCloneAddr represents a "InvalidCloneAddr" kind of error.

func (ErrInvalidCloneAddr) Error Uses

func (err ErrInvalidCloneAddr) Error() string

type ErrInvalidMergeStyle Uses

type ErrInvalidMergeStyle struct {
    ID    int64
    Style MergeStyle
}

ErrInvalidMergeStyle represents an error if merging with disabled merge strategy

func (ErrInvalidMergeStyle) Error Uses

func (err ErrInvalidMergeStyle) Error() string

type ErrInvalidTagName Uses

type ErrInvalidTagName struct {
    TagName string
}

ErrInvalidTagName represents a "InvalidTagName" kind of error.

func (ErrInvalidTagName) Error Uses

func (err ErrInvalidTagName) Error() string

type ErrIssueLabelTemplateLoad Uses

type ErrIssueLabelTemplateLoad struct {
    TemplateFile  string
    OriginalError error
}

ErrIssueLabelTemplateLoad represents a "ErrIssueLabelTemplateLoad" kind of error.

func (ErrIssueLabelTemplateLoad) Error Uses

func (err ErrIssueLabelTemplateLoad) Error() string

type ErrIssueNotExist Uses

type ErrIssueNotExist struct {
    ID     int64
    RepoID int64
    Index  int64
}

ErrIssueNotExist represents a "IssueNotExist" kind of error.

func (ErrIssueNotExist) Error Uses

func (err ErrIssueNotExist) Error() string

type ErrKeyAccessDenied Uses

type ErrKeyAccessDenied struct {
    UserID int64
    KeyID  int64
    Note   string
}

ErrKeyAccessDenied represents a "KeyAccessDenied" kind of error.

func (ErrKeyAccessDenied) Error Uses

func (err ErrKeyAccessDenied) Error() string

type ErrKeyAlreadyExist Uses

type ErrKeyAlreadyExist struct {
    OwnerID     int64
    Fingerprint string
    Content     string
}

ErrKeyAlreadyExist represents a "KeyAlreadyExist" kind of error.

func (ErrKeyAlreadyExist) Error Uses

func (err ErrKeyAlreadyExist) Error() string

type ErrKeyNameAlreadyUsed Uses

type ErrKeyNameAlreadyUsed struct {
    OwnerID int64
    Name    string
}

ErrKeyNameAlreadyUsed represents a "KeyNameAlreadyUsed" kind of error.

func (ErrKeyNameAlreadyUsed) Error Uses

func (err ErrKeyNameAlreadyUsed) Error() string

type ErrKeyNotExist Uses

type ErrKeyNotExist struct {
    ID int64
}

ErrKeyNotExist represents a "KeyNotExist" kind of error.

func (ErrKeyNotExist) Error Uses

func (err ErrKeyNotExist) Error() string

type ErrKeyUnableVerify Uses

type ErrKeyUnableVerify struct {
    Result string
}

ErrKeyUnableVerify represents a "KeyUnableVerify" kind of error.

func (ErrKeyUnableVerify) Error Uses

func (err ErrKeyUnableVerify) Error() string

type ErrLFSFileLocked Uses

type ErrLFSFileLocked struct {
    RepoID   int64
    Path     string
    UserName string
}

ErrLFSFileLocked represents a "LFSFileLocked" kind of error.

func (ErrLFSFileLocked) Error Uses

func (err ErrLFSFileLocked) Error() string

type ErrLFSLockAlreadyExist Uses

type ErrLFSLockAlreadyExist struct {
    RepoID int64
    Path   string
}

ErrLFSLockAlreadyExist represents a "LFSLockAlreadyExist" kind of error.

func (ErrLFSLockAlreadyExist) Error Uses

func (err ErrLFSLockAlreadyExist) Error() string

type ErrLFSLockNotExist Uses

type ErrLFSLockNotExist struct {
    ID     int64
    RepoID int64
    Path   string
}

ErrLFSLockNotExist represents a "LFSLockNotExist" kind of error.

func (ErrLFSLockNotExist) Error Uses

func (err ErrLFSLockNotExist) Error() string

type ErrLFSUnauthorizedAction Uses

type ErrLFSUnauthorizedAction struct {
    RepoID   int64
    UserName string
    Mode     AccessMode
}

ErrLFSUnauthorizedAction represents a "LFSUnauthorizedAction" kind of error.

func (ErrLFSUnauthorizedAction) Error Uses

func (err ErrLFSUnauthorizedAction) Error() string

type ErrLabelNotExist Uses

type ErrLabelNotExist struct {
    LabelID int64
    RepoID  int64
}

ErrLabelNotExist represents a "LabelNotExist" kind of error.

func (ErrLabelNotExist) Error Uses

func (err ErrLabelNotExist) Error() string

type ErrLastOrgOwner Uses

type ErrLastOrgOwner struct {
    UID int64
}

ErrLastOrgOwner represents a "LastOrgOwner" kind of error.

func (ErrLastOrgOwner) Error Uses

func (err ErrLastOrgOwner) Error() string

type ErrLoginSourceAlreadyExist Uses

type ErrLoginSourceAlreadyExist struct {
    Name string
}

ErrLoginSourceAlreadyExist represents a "LoginSourceAlreadyExist" kind of error.

func (ErrLoginSourceAlreadyExist) Error Uses

func (err ErrLoginSourceAlreadyExist) Error() string

type ErrLoginSourceInUse Uses

type ErrLoginSourceInUse struct {
    ID int64
}

ErrLoginSourceInUse represents a "LoginSourceInUse" kind of error.

func (ErrLoginSourceInUse) Error Uses

func (err ErrLoginSourceInUse) Error() string

type ErrLoginSourceNotExist Uses

type ErrLoginSourceNotExist struct {
    ID int64
}

ErrLoginSourceNotExist represents a "LoginSourceNotExist" kind of error.

func (ErrLoginSourceNotExist) Error Uses

func (err ErrLoginSourceNotExist) Error() string

type ErrMergeConflicts Uses

type ErrMergeConflicts struct {
    Style  MergeStyle
    StdOut string
    StdErr string
    Err    error
}

ErrMergeConflicts represents an error if merging fails with a conflict

func (ErrMergeConflicts) Error Uses

func (err ErrMergeConflicts) Error() string

type ErrMergePushOutOfDate Uses

type ErrMergePushOutOfDate struct {
    Style  MergeStyle
    StdOut string
    StdErr string
    Err    error
}

ErrMergePushOutOfDate represents an error if merging fails due to unrelated histories

func (ErrMergePushOutOfDate) Error Uses

func (err ErrMergePushOutOfDate) Error() string

type ErrMergeUnrelatedHistories Uses

type ErrMergeUnrelatedHistories struct {
    Style  MergeStyle
    StdOut string
    StdErr string
    Err    error
}

ErrMergeUnrelatedHistories represents an error if merging fails due to unrelated histories

func (ErrMergeUnrelatedHistories) Error Uses

func (err ErrMergeUnrelatedHistories) Error() string

type ErrMilestoneNotExist Uses

type ErrMilestoneNotExist struct {
    ID     int64
    RepoID int64
}

ErrMilestoneNotExist represents a "MilestoneNotExist" kind of error.

func (ErrMilestoneNotExist) Error Uses

func (err ErrMilestoneNotExist) Error() string

type ErrNamePatternNotAllowed Uses

type ErrNamePatternNotAllowed struct {
    Pattern string
}

ErrNamePatternNotAllowed represents a "pattern not allowed" error.

func (ErrNamePatternNotAllowed) Error Uses

func (err ErrNamePatternNotAllowed) Error() string

type ErrNameReserved Uses

type ErrNameReserved struct {
    Name string
}

ErrNameReserved represents a "reserved name" error.

func (ErrNameReserved) Error Uses

func (err ErrNameReserved) Error() string

type ErrNewIssueInsert Uses

type ErrNewIssueInsert struct {
    OriginalError error
}

ErrNewIssueInsert is used when the INSERT statement in newIssue fails

func (ErrNewIssueInsert) Error Uses

func (err ErrNewIssueInsert) Error() string

type ErrNotAllowedToMerge Uses

type ErrNotAllowedToMerge struct {
    Reason string
}

ErrNotAllowedToMerge represents an error that a branch is protected and the current user is not allowed to modify it.

func (ErrNotAllowedToMerge) Error Uses

func (err ErrNotAllowedToMerge) Error() string

type ErrNotExist Uses

type ErrNotExist struct {
    ID int64
}

ErrNotExist represents a non-exist error.

func (ErrNotExist) Error Uses

func (err ErrNotExist) Error() string

type ErrOAuthApplicationNotFound Uses

type ErrOAuthApplicationNotFound struct {
    ID int64
}

ErrOAuthApplicationNotFound will be thrown if id cannot be found

func (ErrOAuthApplicationNotFound) Error Uses

func (err ErrOAuthApplicationNotFound) Error() string

Error returns the error message

type ErrOAuthClientIDInvalid Uses

type ErrOAuthClientIDInvalid struct {
    ClientID string
}

ErrOAuthClientIDInvalid will be thrown if client id cannot be found

func (ErrOAuthClientIDInvalid) Error Uses

func (err ErrOAuthClientIDInvalid) Error() string

Error returns the error message

type ErrOpenIDAlreadyUsed Uses

type ErrOpenIDAlreadyUsed struct {
    OpenID string
}

ErrOpenIDAlreadyUsed represents a "OpenIDAlreadyUsed" kind of error.

func (ErrOpenIDAlreadyUsed) Error Uses

func (err ErrOpenIDAlreadyUsed) Error() string

type ErrOpenIDConnectInitialize Uses

type ErrOpenIDConnectInitialize struct {
    OpenIDConnectAutoDiscoveryURL string
    ProviderName                  string
    Cause                         error
}

ErrOpenIDConnectInitialize represents a "OpenIDConnectInitialize" kind of error.

func (ErrOpenIDConnectInitialize) Error Uses

func (err ErrOpenIDConnectInitialize) Error() string

type ErrOrgNotExist Uses

type ErrOrgNotExist struct {
    ID   int64
    Name string
}

ErrOrgNotExist represents a "OrgNotExist" kind of error.

func (ErrOrgNotExist) Error Uses

func (err ErrOrgNotExist) Error() string

type ErrPullRequestAlreadyExists Uses

type ErrPullRequestAlreadyExists struct {
    ID         int64
    IssueID    int64
    HeadRepoID int64
    BaseRepoID int64
    HeadBranch string
    BaseBranch string
}

ErrPullRequestAlreadyExists represents a "PullRequestAlreadyExists"-error

func (ErrPullRequestAlreadyExists) Error Uses

func (err ErrPullRequestAlreadyExists) Error() string

Error does pretty-printing :D

type ErrPullRequestHeadRepoMissing Uses

type ErrPullRequestHeadRepoMissing struct {
    ID         int64
    HeadRepoID int64
}

ErrPullRequestHeadRepoMissing represents a "ErrPullRequestHeadRepoMissing" error

func (ErrPullRequestHeadRepoMissing) Error Uses

func (err ErrPullRequestHeadRepoMissing) Error() string

Error does pretty-printing :D

type ErrPullRequestNotExist Uses

type ErrPullRequestNotExist struct {
    ID         int64
    IssueID    int64
    HeadRepoID int64
    BaseRepoID int64
    HeadBranch string
    BaseBranch string
}

ErrPullRequestNotExist represents a "PullRequestNotExist" kind of error.

func (ErrPullRequestNotExist) Error Uses

func (err ErrPullRequestNotExist) Error() string

type ErrReachLimitOfRepo Uses

type ErrReachLimitOfRepo struct {
    Limit int
}

ErrReachLimitOfRepo represents a "ReachLimitOfRepo" kind of error.

func (ErrReachLimitOfRepo) Error Uses

func (err ErrReachLimitOfRepo) Error() string

type ErrRebaseConflicts Uses

type ErrRebaseConflicts struct {
    Style     MergeStyle
    CommitSHA string
    StdOut    string
    StdErr    string
    Err       error
}

ErrRebaseConflicts represents an error if rebase fails with a conflict

func (ErrRebaseConflicts) Error Uses

func (err ErrRebaseConflicts) Error() string

type ErrReleaseAlreadyExist Uses

type ErrReleaseAlreadyExist struct {
    TagName string
}

ErrReleaseAlreadyExist represents a "ReleaseAlreadyExist" kind of error.

func (ErrReleaseAlreadyExist) Error Uses

func (err ErrReleaseAlreadyExist) Error() string

type ErrReleaseNotExist Uses

type ErrReleaseNotExist struct {
    ID      int64
    TagName string
}

ErrReleaseNotExist represents a "ReleaseNotExist" kind of error.

func (ErrReleaseNotExist) Error Uses

func (err ErrReleaseNotExist) Error() string

type ErrRepoAlreadyExist Uses

type ErrRepoAlreadyExist struct {
    Uname string
    Name  string
}

ErrRepoAlreadyExist represents a "RepoAlreadyExist" kind of error.

func (ErrRepoAlreadyExist) Error Uses

func (err ErrRepoAlreadyExist) Error() string

type ErrRepoFileAlreadyExists Uses

type ErrRepoFileAlreadyExists struct {
    Path string
}

ErrRepoFileAlreadyExists represents a "RepoFileAlreadyExist" kind of error.

func (ErrRepoFileAlreadyExists) Error Uses

func (err ErrRepoFileAlreadyExists) Error() string

type ErrRepoFileDoesNotExist Uses

type ErrRepoFileDoesNotExist struct {
    Path string
    Name string
}

ErrRepoFileDoesNotExist represents a "RepoFileDoesNotExist" kind of error.

func (ErrRepoFileDoesNotExist) Error Uses

func (err ErrRepoFileDoesNotExist) Error() string

type ErrRepoNotExist Uses

type ErrRepoNotExist struct {
    ID        int64
    UID       int64
    OwnerName string
    Name      string
}

ErrRepoNotExist represents a "RepoNotExist" kind of error.

func (ErrRepoNotExist) Error Uses

func (err ErrRepoNotExist) Error() string

type ErrRepoRedirectNotExist Uses

type ErrRepoRedirectNotExist struct {
    OwnerID  int64
    RepoName string
}

ErrRepoRedirectNotExist represents a "RepoRedirectNotExist" kind of error.

func (ErrRepoRedirectNotExist) Error Uses

func (err ErrRepoRedirectNotExist) Error() string

type ErrReviewNotExist Uses

type ErrReviewNotExist struct {
    ID int64
}

ErrReviewNotExist represents a "ReviewNotExist" kind of error.

func (ErrReviewNotExist) Error Uses

func (err ErrReviewNotExist) Error() string

type ErrSHADoesNotMatch Uses

type ErrSHADoesNotMatch struct {
    Path       string
    GivenSHA   string
    CurrentSHA string
}

ErrSHADoesNotMatch represents a "SHADoesNotMatch" kind of error.

func (ErrSHADoesNotMatch) Error Uses

func (err ErrSHADoesNotMatch) Error() string

type ErrSHANotFound Uses

type ErrSHANotFound struct {
    SHA string
}

ErrSHANotFound represents a "SHADoesNotMatch" kind of error.

func (ErrSHANotFound) Error Uses

func (err ErrSHANotFound) Error() string

type ErrSHAOrCommitIDNotProvided Uses

type ErrSHAOrCommitIDNotProvided struct{}

ErrSHAOrCommitIDNotProvided represents a "SHAOrCommitIDNotProvided" kind of error.

func (ErrSHAOrCommitIDNotProvided) Error Uses

func (err ErrSHAOrCommitIDNotProvided) Error() string

type ErrSSHDisabled Uses

type ErrSSHDisabled struct {
}

ErrSSHDisabled represents an "SSH disabled" error.

func (ErrSSHDisabled) Error Uses

func (err ErrSSHDisabled) Error() string

type ErrStopwatchNotExist Uses

type ErrStopwatchNotExist struct {
    ID int64
}

ErrStopwatchNotExist represents a "Stopwatch Not Exist" kind of error.

func (ErrStopwatchNotExist) Error Uses

func (err ErrStopwatchNotExist) Error() string

type ErrTagAlreadyExists Uses

type ErrTagAlreadyExists struct {
    TagName string
}

ErrTagAlreadyExists represents an error that tag with such name already exists.

func (ErrTagAlreadyExists) Error Uses

func (err ErrTagAlreadyExists) Error() string

type ErrTaskDoesNotExist Uses

type ErrTaskDoesNotExist struct {
    ID     int64
    RepoID int64
    Type   structs.TaskType
}

ErrTaskDoesNotExist represents a "TaskDoesNotExist" kind of error.

func (ErrTaskDoesNotExist) Error Uses

func (err ErrTaskDoesNotExist) Error() string

type ErrTeamAlreadyExist Uses

type ErrTeamAlreadyExist struct {
    OrgID int64
    Name  string
}

ErrTeamAlreadyExist represents a "TeamAlreadyExist" kind of error.

func (ErrTeamAlreadyExist) Error Uses

func (err ErrTeamAlreadyExist) Error() string

type ErrTeamNotExist Uses

type ErrTeamNotExist struct {
    OrgID  int64
    TeamID int64
    Name   string
}

ErrTeamNotExist represents a "TeamNotExist" error

func (ErrTeamNotExist) Error Uses

func (err ErrTeamNotExist) Error() string

type ErrTopicNotExist Uses

type ErrTopicNotExist struct {
    Name string
}

ErrTopicNotExist represents an error that a topic is not exist

func (ErrTopicNotExist) Error Uses

func (err ErrTopicNotExist) Error() string

Error implements error interface

type ErrTrackedTimeNotExist Uses

type ErrTrackedTimeNotExist struct {
    ID int64
}

ErrTrackedTimeNotExist represents a "TrackedTime Not Exist" kind of error.

func (ErrTrackedTimeNotExist) Error Uses

func (err ErrTrackedTimeNotExist) Error() string

type ErrTwoFactorNotEnrolled Uses

type ErrTwoFactorNotEnrolled struct {
    UID int64
}

ErrTwoFactorNotEnrolled indicates that a user is not enrolled in two-factor authentication.

func (ErrTwoFactorNotEnrolled) Error Uses

func (err ErrTwoFactorNotEnrolled) Error() string

type ErrU2FRegistrationNotExist Uses

type ErrU2FRegistrationNotExist struct {
    ID int64
}

ErrU2FRegistrationNotExist represents a "ErrU2FRegistrationNotExist" kind of error.

func (ErrU2FRegistrationNotExist) Error Uses

func (err ErrU2FRegistrationNotExist) Error() string

type ErrUnitTypeNotExist Uses

type ErrUnitTypeNotExist struct {
    UT UnitType
}

ErrUnitTypeNotExist represents a "UnitTypeNotExist" kind of error.

func (ErrUnitTypeNotExist) Error Uses

func (err ErrUnitTypeNotExist) Error() string

type ErrUnknownDependencyType Uses

type ErrUnknownDependencyType struct {
    Type DependencyType
}

ErrUnknownDependencyType represents an error where an unknown dependency type was passed

func (ErrUnknownDependencyType) Error Uses

func (err ErrUnknownDependencyType) Error() string

type ErrUpdateTaskNotExist Uses

type ErrUpdateTaskNotExist struct {
    UUID string
}

ErrUpdateTaskNotExist represents a "UpdateTaskNotExist" kind of error.

func (ErrUpdateTaskNotExist) Error Uses

func (err ErrUpdateTaskNotExist) Error() string

type ErrUploadNotExist Uses

type ErrUploadNotExist struct {
    ID   int64
    UUID string
}

ErrUploadNotExist represents a "UploadNotExist" kind of error.

func (ErrUploadNotExist) Error Uses

func (err ErrUploadNotExist) Error() string

type ErrUserAlreadyExist Uses

type ErrUserAlreadyExist struct {
    Name string
}

ErrUserAlreadyExist represents a "user already exists" error.

func (ErrUserAlreadyExist) Error Uses

func (err ErrUserAlreadyExist) Error() string

type ErrUserCannotCommit Uses

type ErrUserCannotCommit struct {
    UserName string
}

ErrUserCannotCommit represents "UserCannotCommit" kind of error.

func (ErrUserCannotCommit) Error Uses

func (err ErrUserCannotCommit) Error() string

type ErrUserDoesNotHaveAccessToRepo Uses

type ErrUserDoesNotHaveAccessToRepo struct {
    UserID   int64
    RepoName string
}

ErrUserDoesNotHaveAccessToRepo represets an error where the user doesn't has access to a given repo.

func (ErrUserDoesNotHaveAccessToRepo) Error Uses

func (err ErrUserDoesNotHaveAccessToRepo) Error() string

type ErrUserHasOrgs Uses

type ErrUserHasOrgs struct {
    UID int64
}

ErrUserHasOrgs represents a "UserHasOrgs" kind of error.

func (ErrUserHasOrgs) Error Uses

func (err ErrUserHasOrgs) Error() string

type ErrUserInactive Uses

type ErrUserInactive struct {
    UID  int64
    Name string
}

ErrUserInactive represents a "ErrUserInactive" kind of error.

func (ErrUserInactive) Error Uses

func (err ErrUserInactive) Error() string

type ErrUserNotAllowedCreateOrg Uses

type ErrUserNotAllowedCreateOrg struct {
}

ErrUserNotAllowedCreateOrg represents a "UserNotAllowedCreateOrg" kind of error.

func (ErrUserNotAllowedCreateOrg) Error Uses

func (err ErrUserNotAllowedCreateOrg) Error() string

type ErrUserNotExist Uses

type ErrUserNotExist struct {
    UID   int64
    Name  string
    KeyID int64
}

ErrUserNotExist represents a "UserNotExist" kind of error.

func (ErrUserNotExist) Error Uses

func (err ErrUserNotExist) Error() string

type ErrUserOwnRepos Uses

type ErrUserOwnRepos struct {
    UID int64
}

ErrUserOwnRepos represents a "UserOwnRepos" kind of error.

func (ErrUserOwnRepos) Error Uses

func (err ErrUserOwnRepos) Error() string

type ErrUserProhibitLogin Uses

type ErrUserProhibitLogin struct {
    UID  int64
    Name string
}

ErrUserProhibitLogin represents a "ErrUserProhibitLogin" kind of error.

func (ErrUserProhibitLogin) Error Uses

func (err ErrUserProhibitLogin) Error() string

type ErrWebhookNotExist Uses

type ErrWebhookNotExist struct {
    ID int64
}

ErrWebhookNotExist represents a "WebhookNotExist" kind of error.

func (ErrWebhookNotExist) Error Uses

func (err ErrWebhookNotExist) Error() string

type ErrWikiAlreadyExist Uses

type ErrWikiAlreadyExist struct {
    Title string
}

ErrWikiAlreadyExist represents a "WikiAlreadyExist" kind of error.

func (ErrWikiAlreadyExist) Error Uses

func (err ErrWikiAlreadyExist) Error() string

type ErrWikiInvalidFileName Uses

type ErrWikiInvalidFileName struct {
    FileName string
}

ErrWikiInvalidFileName represents an invalid wiki file name.

func (ErrWikiInvalidFileName) Error Uses

func (err ErrWikiInvalidFileName) Error() string

type ErrWikiReservedName Uses

type ErrWikiReservedName struct {
    Title string
}

ErrWikiReservedName represents a reserved name error.

func (ErrWikiReservedName) Error Uses

func (err ErrWikiReservedName) Error() string

type ExternalLoginUser Uses

type ExternalLoginUser struct {
    ExternalID        string                 `xorm:"pk NOT NULL"`
    UserID            int64                  `xorm:"INDEX NOT NULL"`
    LoginSourceID     int64                  `xorm:"pk NOT NULL"`
    RawData           map[string]interface{} `xorm:"TEXT JSON"`
    Provider          string                 `xorm:"index VARCHAR(25)"`
    Email             string
    Name              string
    FirstName         string
    LastName          string
    NickName          string
    Description       string
    AvatarURL         string
    Location          string
    AccessToken       string `xorm:"TEXT"`
    AccessTokenSecret string `xorm:"TEXT"`
    RefreshToken      string `xorm:"TEXT"`
    ExpiresAt         time.Time
}

ExternalLoginUser makes the connecting between some existing user and additional external login sources

func FindExternalUsersByProvider Uses

func FindExternalUsersByProvider(opts FindExternalUserOptions) ([]ExternalLoginUser, error)

FindExternalUsersByProvider represents external users via provider

func ListAccountLinks(user *User) ([]*ExternalLoginUser, error)

ListAccountLinks returns a map with the ExternalLoginUser and its LoginSource

type ExternalTrackerConfig Uses

type ExternalTrackerConfig struct {
    ExternalTrackerURL    string
    ExternalTrackerFormat string
    ExternalTrackerStyle  string
}

ExternalTrackerConfig describes external tracker config

func (*ExternalTrackerConfig) FromDB Uses

func (cfg *ExternalTrackerConfig) FromDB(bs []byte) error

FromDB fills up a ExternalTrackerConfig from serialized format.

func (*ExternalTrackerConfig) ToDB Uses

func (cfg *ExternalTrackerConfig) ToDB() ([]byte, error)

ToDB exports a ExternalTrackerConfig to a serialized format.

type ExternalWikiConfig Uses

type ExternalWikiConfig struct {
    ExternalWikiURL string
}

ExternalWikiConfig describes external wiki config

func (*ExternalWikiConfig) FromDB Uses

func (cfg *ExternalWikiConfig) FromDB(bs []byte) error

FromDB fills up a ExternalWikiConfig from serialized format.

func (*ExternalWikiConfig) ToDB Uses

func (cfg *ExternalWikiConfig) ToDB() ([]byte, error)

ToDB exports a ExternalWikiConfig to a serialized format.

type FindCommentsOptions Uses

type FindCommentsOptions struct {
    RepoID   int64
    IssueID  int64
    ReviewID int64
    Since    int64
    Type     CommentType
}

FindCommentsOptions describes the conditions to Find comments

type FindExternalUserOptions Uses

type FindExternalUserOptions struct {
    Provider string
    Limit    int
    Start    int
}

FindExternalUserOptions represents an options to find external users

type FindReactionsOptions Uses

type FindReactionsOptions struct {
    IssueID   int64
    CommentID int64
}

FindReactionsOptions describes the conditions to Find reactions

type FindReleasesOptions Uses

type FindReleasesOptions struct {
    IncludeDrafts bool
    IncludeTags   bool
    TagNames      []string
}

FindReleasesOptions describes the conditions to Find releases

type FindReviewOptions Uses

type FindReviewOptions struct {
    Type       ReviewType
    IssueID    int64
    ReviewerID int64
}

FindReviewOptions represent possible filters to find reviews

type FindTaskOptions Uses

type FindTaskOptions struct {
    Status int
}

FindTaskOptions find all tasks

func (FindTaskOptions) ToConds Uses

func (opts FindTaskOptions) ToConds() builder.Cond

ToConds generates conditions for database operation.

type FindTopicOptions Uses

type FindTopicOptions struct {
    RepoID  int64
    Keyword string
    Limit   int
    Page    int
}

FindTopicOptions represents the options when fdin topics

type FindTrackedTimesOptions Uses

type FindTrackedTimesOptions struct {
    IssueID      int64
    UserID       int64
    RepositoryID int64
    MilestoneID  int64
}

FindTrackedTimesOptions represent the filters for tracked times. If an ID is 0 it will be ignored.

func (*FindTrackedTimesOptions) ToCond Uses

func (opts *FindTrackedTimesOptions) ToCond() builder.Cond

ToCond will convert each condition into a xorm-Cond

func (*FindTrackedTimesOptions) ToSession Uses

func (opts *FindTrackedTimesOptions) ToSession(e Engine) *xorm.Session

ToSession will convert the given options to a xorm Session by using the conditions from ToCond and joining with issue table if required

type Follow Uses

type Follow struct {
    ID       int64 `xorm:"pk autoincr"`
    UserID   int64 `xorm:"UNIQUE(follow)"`
    FollowID int64 `xorm:"UNIQUE(follow)"`
}

Follow represents relations of user and his/her followers.

type GPGKey Uses

type GPGKey struct {
    ID                int64              `xorm:"pk autoincr"`
    OwnerID           int64              `xorm:"INDEX NOT NULL"`
    KeyID             string             `xorm:"INDEX CHAR(16) NOT NULL"`
    PrimaryKeyID      string             `xorm:"CHAR(16)"`
    Content           string             `xorm:"TEXT NOT NULL"`
    CreatedUnix       timeutil.TimeStamp `xorm:"created"`
    ExpiredUnix       timeutil.TimeStamp
    AddedUnix         timeutil.TimeStamp
    SubsKey           []*GPGKey `xorm:"-"`
    Emails            []*EmailAddress
    CanSign           bool
    CanEncryptComms   bool
    CanEncryptStorage bool
    CanCertify        bool
}

GPGKey represents a GPG key.

func AddGPGKey Uses

func AddGPGKey(ownerID int64, content string) (*GPGKey, error)

AddGPGKey adds new public key to database.

func GetGPGKeyByID Uses

func GetGPGKeyByID(keyID int64) (*GPGKey, error)

GetGPGKeyByID returns public key by given ID.

func GetGPGKeysByKeyID Uses

func GetGPGKeysByKeyID(keyID string) ([]*GPGKey, error)

GetGPGKeysByKeyID returns public key by given ID.

func ListGPGKeys Uses

func ListGPGKeys(uid int64) ([]*GPGKey, error)

ListGPGKeys returns a list of public keys belongs to given user.

func (*GPGKey) AfterLoad Uses

func (key *GPGKey) AfterLoad(session *xorm.Session)

AfterLoad is invoked from XORM after setting the values of all fields of this object.

func (*GPGKey) BeforeInsert Uses

func (key *GPGKey) BeforeInsert()

BeforeInsert will be invoked by XORM before inserting a record

type GPGKeyImport Uses

type GPGKeyImport struct {
    KeyID   string `xorm:"pk CHAR(16) NOT NULL"`
    Content string `xorm:"TEXT NOT NULL"`
}

GPGKeyImport the original import of key

func GetGPGImportByKeyID Uses

func GetGPGImportByKeyID(keyID string) (*GPGKeyImport, error)

GetGPGImportByKeyID returns the import public armored key by given KeyID.

type GenerateRepoOptions Uses

type GenerateRepoOptions struct {
    Name        string
    Description string
    Private     bool
    GitContent  bool
    Topics      bool
}

GenerateRepoOptions contains the template units to generate

func (GenerateRepoOptions) IsValid Uses

func (gro GenerateRepoOptions) IsValid() bool

IsValid checks whether at least one option is chosen for generation

type GetFeedsOptions Uses

type GetFeedsOptions struct {
    RequestedUser    *User
    RequestingUserID int64
    IncludePrivate   bool // include private actions
    OnlyPerformedBy  bool // only actions performed by requested user
    IncludeDeleted   bool // include deleted actions
}

GetFeedsOptions options for retrieving feeds

type GraphItem Uses

type GraphItem struct {
    GraphAcii    string
    Relation     string
    Branch       string
    Rev          string
    Date         string
    Author       string
    AuthorEmail  string
    ShortRev     string
    Subject      string
    OnlyRelation bool
}

GraphItem represent one commit, or one relation in timeline

type GraphItems Uses

type GraphItems []GraphItem

GraphItems is a list of commits from all branches

func GetCommitGraph Uses

func GetCommitGraph(r *git.Repository, page int) (GraphItems, error)

GetCommitGraph return a list of commit (GraphItems) from all branches

type HookContentType Uses

type HookContentType int

HookContentType is the content type of a web hook

const (
    // ContentTypeJSON is a JSON payload for web hooks
    ContentTypeJSON HookContentType = iota + 1
    // ContentTypeForm is an url-encoded form payload for web hook
    ContentTypeForm
)

func ToHookContentType Uses

func ToHookContentType(name string) HookContentType

ToHookContentType returns HookContentType by given name.

func (HookContentType) Name Uses

func (t HookContentType) Name() string

Name returns the name of a given web hook's content type

type HookEvent Uses

type HookEvent struct {
    PushOnly       bool   `json:"push_only"`
    SendEverything bool   `json:"send_everything"`
    ChooseEvents   bool   `json:"choose_events"`
    BranchFilter   string `json:"branch_filter"`

    HookEvents `json:"events"`
}

HookEvent represents events that will delivery hook.

type HookEventType Uses

type HookEventType string

HookEventType is the type of an hook event

const (
    HookEventCreate              HookEventType = "create"
    HookEventDelete              HookEventType = "delete"
    HookEventFork                HookEventType = "fork"
    HookEventPush                HookEventType = "push"
    HookEventIssues              HookEventType = "issues"
    HookEventIssueComment        HookEventType = "issue_comment"
    HookEventPullRequest         HookEventType = "pull_request"
    HookEventRepository          HookEventType = "repository"
    HookEventRelease             HookEventType = "release"
    HookEventPullRequestApproved HookEventType = "pull_request_approved"
    HookEventPullRequestRejected HookEventType = "pull_request_rejected"
    HookEventPullRequestComment  HookEventType = "pull_request_comment"
)

Types of hook events

type HookEvents Uses

type HookEvents struct {
    Create       bool `json:"create"`
    Delete       bool `json:"delete"`
    Fork         bool `json:"fork"`
    Issues       bool `json:"issues"`
    IssueComment bool `json:"issue_comment"`
    Push         bool `json:"push"`
    PullRequest  bool `json:"pull_request"`
    Repository   bool `json:"repository"`
    Release      bool `json:"release"`
}

HookEvents is a set of web hook events

type HookRequest Uses

type HookRequest struct {
    Headers map[string]string `json:"headers"`
}

HookRequest represents hook task request information.

type HookResponse Uses

type HookResponse struct {
    Status  int               `json:"status"`
    Headers map[string]string `json:"headers"`
    Body    string            `json:"body"`
}

HookResponse represents hook task response information.

type HookStatus Uses

type HookStatus int

HookStatus is the status of a web hook

type HookTask Uses

type HookTask struct {
    ID              int64 `xorm:"pk autoincr"`
    RepoID          int64 `xorm:"INDEX"`
    HookID          int64
    UUID            string
    Type            HookTaskType
    URL             string `xorm:"TEXT"`
    Signature       string `xorm:"TEXT"`
    api.Payloader   `xorm:"-"`
    PayloadContent  string `xorm:"TEXT"`
    HTTPMethod      string `xorm:"http_method"`
    ContentType     HookContentType
    EventType       HookEventType
    IsSSL           bool
    IsDelivered     bool
    Delivered       int64
    DeliveredString string `xorm:"-"`

    // History info.
    IsSucceed       bool
    RequestContent  string        `xorm:"TEXT"`
    RequestInfo     *HookRequest  `xorm:"-"`
    ResponseContent string        `xorm:"TEXT"`
    ResponseInfo    *HookResponse `xorm:"-"`
}

HookTask represents a hook task.

func FindRepoUndeliveredHookTasks Uses

func FindRepoUndeliveredHookTasks(repoID int64) ([]*HookTask, error)

FindRepoUndeliveredHookTasks represents find the undelivered hook tasks of one repository

func FindUndeliveredHookTasks Uses

func FindUndeliveredHookTasks() ([]*HookTask, error)

FindUndeliveredHookTasks represents find the undelivered hook tasks

func HookTasks Uses

func HookTasks(hookID int64, page int) ([]*HookTask, error)

HookTasks returns a list of hook tasks by given conditions.

func (*HookTask) AfterLoad Uses

func (t *HookTask) AfterLoad()

AfterLoad updates the webhook object upon setting a column

func (*HookTask) BeforeUpdate Uses

func (t *HookTask) BeforeUpdate()

BeforeUpdate will be invoked by XORM before updating a record representing this object

type HookTaskType Uses

type HookTaskType int

HookTaskType is the type of an hook task

const (
    GOGS HookTaskType = iota + 1
    SLACK
    GITEA
    DISCORD
    DINGTALK
    TELEGRAM
    MSTEAMS
)

Types of hook tasks

func ToHookTaskType Uses

func ToHookTaskType(name string) HookTaskType

ToHookTaskType returns HookTaskType by given name.

func (HookTaskType) Name Uses

func (t HookTaskType) Name() string

Name returns the name of an hook task type

type Issue Uses

type Issue struct {
    ID               int64       `xorm:"pk autoincr"`
    RepoID           int64       `xorm:"INDEX UNIQUE(repo_index)"`
    Repo             *Repository `xorm:"-"`
    Index            int64       `xorm:"UNIQUE(repo_index)"` // Index in one repository.
    PosterID         int64       `xorm:"INDEX"`
    Poster           *User       `xorm:"-"`
    OriginalAuthor   string
    OriginalAuthorID int64      `xorm:"index"`
    Title            string     `xorm:"name"`
    Content          string     `xorm:"TEXT"`
    RenderedContent  string     `xorm:"-"`
    Labels           []*Label   `xorm:"-"`
    MilestoneID      int64      `xorm:"INDEX"`
    Milestone        *Milestone `xorm:"-"`
    Priority         int
    AssigneeID       int64        `xorm:"-"`
    Assignee         *User        `xorm:"-"`
    IsClosed         bool         `xorm:"INDEX"`
    IsRead           bool         `xorm:"-"`
    IsPull           bool         `xorm:"INDEX"` // Indicates whether is a pull request or not.
    PullRequest      *PullRequest `xorm:"-"`
    NumComments      int
    Ref              string

    DeadlineUnix timeutil.TimeStamp `xorm:"INDEX"`

    CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"`
    UpdatedUnix timeutil.TimeStamp `xorm:"INDEX updated"`
    ClosedUnix  timeutil.TimeStamp `xorm:"INDEX"`

    Attachments      []*Attachment `xorm:"-"`
    Comments         []*Comment    `xorm:"-"`
    Reactions        ReactionList  `xorm:"-"`
    TotalTrackedTime int64         `xorm:"-"`
    Assignees        []*User       `xorm:"-"`

    // IsLocked limits commenting abilities to users on an issue
    // with write access
    IsLocked bool `xorm:"NOT NULL DEFAULT false"`
}

Issue represents an issue or pull request of repository.

func GetIssueByID Uses

func GetIssueByID(id int64) (*Issue, error)

GetIssueByID returns an issue by given ID.

func GetIssueByIndex Uses

func GetIssueByIndex(repoID, index int64) (*Issue, error)

GetIssueByIndex returns raw issue without loading attributes by index in a repository.

func GetIssueWithAttrsByID Uses

func GetIssueWithAttrsByID(id int64) (*Issue, error)

GetIssueWithAttrsByID returns an issue with attributes by given ID.

func GetIssueWithAttrsByIndex Uses

func GetIssueWithAttrsByIndex(repoID, index int64) (*Issue, error)

GetIssueWithAttrsByIndex returns issue by index in a repository.

func GetIssuesByIDs Uses

func GetIssuesByIDs(issueIDs []int64) ([]*Issue, error)

GetIssuesByIDs return issues with the given IDs.

func Issues Uses

func Issues(opts *IssuesOptions) ([]*Issue, error)

Issues returns a list of issues by given conditions.

func (*Issue) APIFormat Uses

func (issue *Issue) APIFormat() *api.Issue

APIFormat assumes some fields assigned with values: Required - Poster, Labels, Optional - Milestone, Assignee, PullRequest

func (*Issue) APIURL Uses

func (issue *Issue) APIURL() string

APIURL returns the absolute APIURL to this issue.

func (*Issue) BlockedByDependencies Uses

func (issue *Issue) BlockedByDependencies() ([]*DependencyInfo, error)

BlockedByDependencies finds all Dependencies an issue is blocked by

func (*Issue) BlockingDependencies Uses

func (issue *Issue) BlockingDependencies() ([]*DependencyInfo, error)

BlockingDependencies returns all blocking dependencies, aka all other issues a given issue blocks

func (*Issue) ChangeContent Uses

func (issue *Issue) ChangeContent(doer *User, content string) (err error)

ChangeContent changes issue content, as the given user.

func (*Issue) ChangeStatus Uses

func (issue *Issue) ChangeStatus(doer *User, isClosed bool) (err error)

ChangeStatus changes issue status to open or closed.

func (*Issue) ChangeTitle Uses

func (issue *Issue) ChangeTitle(doer *User, oldTitle string) (err error)

ChangeTitle changes the title of this issue, as the given user.

func (*Issue) ClearLabels Uses

func (issue *Issue) ClearLabels(doer *User) (err error)

ClearLabels removes all issue labels as the given user. Triggers appropriate WebHooks, if any.

func (*Issue) DiffURL Uses

func (issue *Issue) DiffURL() string

DiffURL returns the absolute URL to this diff

func (*Issue) GetIsRead Uses

func (issue *Issue) GetIsRead(userID int64) error

GetIsRead load the `IsRead` field of the issue

func (*Issue) GetLastEventLabel Uses

func (issue *Issue) GetLastEventLabel() string

GetLastEventLabel returns the localization label for the current issue.

func (*Issue) GetLastEventLabelFake Uses

func (issue *Issue) GetLastEventLabelFake() string

GetLastEventLabelFake returns the localization label for the current issue without providing a link in the username.

func (*Issue) GetLastEventTimestamp Uses

func (issue *Issue) GetLastEventTimestamp() timeutil.TimeStamp

GetLastEventTimestamp returns the last user visible event timestamp, either the creation of this issue or the close.

func (*Issue) GetPullRequest Uses

func (issue *Issue) GetPullRequest() (pr *PullRequest, err error)

GetPullRequest returns the issue pull request

func (*Issue) GetTasks Uses

func (issue *Issue) GetTasks() int

GetTasks returns the amount of tasks in the issues content

func (*Issue) GetTasksDone Uses

func (issue *Issue) GetTasksDone() int

GetTasksDone returns the amount of completed tasks in the issues content

func (*Issue) HTMLURL Uses

func (issue *Issue) HTMLURL() string

HTMLURL returns the absolute URL to this issue.

func (*Issue) HasLabel Uses

func (issue *Issue) HasLabel(labelID int64) bool

HasLabel returns true if issue has been labeled by given ID.

func (*Issue) HashTag Uses

func (issue *Issue) HashTag() string

HashTag returns unique hash tag for issue.

func (*Issue) IsOverdue Uses

func (issue *Issue) IsOverdue() bool

IsOverdue checks if the issue is overdue

func (*Issue) IsPoster Uses

func (issue *Issue) IsPoster(uid int64) bool

IsPoster returns true if given user by ID is the poster.

func (*Issue) IsTimetrackerEnabled Uses

func (issue *Issue) IsTimetrackerEnabled() bool

IsTimetrackerEnabled returns true if the repo enables timetracking

func (*Issue) LoadAttributes Uses

func (issue *Issue) LoadAttributes() error

LoadAttributes loads the attribute of this issue.

func (*Issue) LoadDiscussComments Uses

func (issue *Issue) LoadDiscussComments() error

LoadDiscussComments loads discuss comments

func (*Issue) LoadPoster Uses

func (issue *Issue) LoadPoster() error

LoadPoster loads poster

func (*Issue) LoadPullRequest Uses

func (issue *Issue) LoadPullRequest() error

LoadPullRequest loads pull request info

func (*Issue) LoadRepo Uses

func (issue *Issue) LoadRepo() error

LoadRepo loads issue's repository

func (*Issue) PatchURL Uses

func (issue *Issue) PatchURL() string

PatchURL returns the absolute URL to this patch

func (*Issue) ReadBy Uses

func (issue *Issue) ReadBy(userID int64) error

ReadBy sets issue to be read by given user.

func (*Issue) ReplaceLabels Uses

func (issue *Issue) ReplaceLabels(labels []*Label, doer *User) (err error)

ReplaceLabels removes all current labels and add new labels to the issue. Triggers appropriate WebHooks, if any.

func (*Issue) ReplyReference Uses

func (issue *Issue) ReplyReference() string

ReplyReference returns tokenized address to use for email reply headers

func (*Issue) ResolveMentionsByVisibility Uses

func (issue *Issue) ResolveMentionsByVisibility(ctx DBContext, doer *User, mentions []string) (users []*User, err error)

ResolveMentionsByVisibility returns the users mentioned in an issue, removing those that don't have access to reading it. Teams are expanded into their users, but organizations are ignored.

func (*Issue) State Uses

func (issue *Issue) State() api.StateType

State returns string representation of issue status.

func (*Issue) ToggleAssignee Uses

func (issue *Issue) ToggleAssignee(doer *User, assigneeID int64) (removed bool, comment *Comment, err error)

ToggleAssignee changes a user between assigned and not assigned for this issue, and make issue comment for it.

func (*Issue) UpdateAttachments Uses

func (issue *Issue) UpdateAttachments(uuids []string) (err error)

UpdateAttachments update attachments by UUIDs for the issue

type IssueAssignees Uses

type IssueAssignees struct {
    ID         int64 `xorm:"pk autoincr"`
    AssigneeID int64 `xorm:"INDEX"`
    IssueID    int64 `xorm:"INDEX"`
}

IssueAssignees saves all issue assignees

type IssueDependency Uses

type IssueDependency struct {
    ID           int64              `xorm:"pk autoincr"`
    UserID       int64              `xorm:"NOT NULL"`
    IssueID      int64              `xorm:"UNIQUE(issue_dependency) NOT NULL"`
    DependencyID int64              `xorm:"UNIQUE(issue_dependency) NOT NULL"`
    CreatedUnix  timeutil.TimeStamp `xorm:"created"`
    UpdatedUnix  timeutil.TimeStamp `xorm:"updated"`
}

IssueDependency represents an issue dependency

type IssueLabel Uses

type IssueLabel struct {
    ID      int64 `xorm:"pk autoincr"`
    IssueID int64 `xorm:"UNIQUE(s)"`
    LabelID int64 `xorm:"UNIQUE(s)"`
}

IssueLabel represents an issue-label relation.

type IssueList Uses

type IssueList []*Issue

IssueList defines a list of issues

func (IssueList) LoadAttachments Uses

func (issues IssueList) LoadAttachments() error

LoadAttachments loads attachments

func (IssueList) LoadAttributes Uses

func (issues IssueList) LoadAttributes() error

LoadAttributes loads attributes of the issues, except for attachments and comments

func (IssueList) LoadComments Uses

func (issues IssueList) LoadComments() error

LoadComments loads comments

func (IssueList) LoadDiscussComments Uses

func (issues IssueList) LoadDiscussComments() error

LoadDiscussComments loads discuss comments

func (IssueList) LoadRepositories Uses

func (issues IssueList) LoadRepositories() ([]*Repository, error)

LoadRepositories loads issues' all repositories

type IssueLockOptions Uses

type IssueLockOptions struct {
    Doer   *User
    Issue  *Issue
    Reason string
}

IssueLockOptions defines options for locking and/or unlocking an issue/PR

type IssueStats Uses

type IssueStats struct {
    OpenCount, ClosedCount int64
    YourRepositoriesCount  int64
    AssignCount            int64
    CreateCount            int64
    MentionCount           int64
}

IssueStats represents issue statistic information.

func GetIssueStats Uses

func GetIssueStats(opts *IssueStatsOptions) (*IssueStats, error)

GetIssueStats returns issue statistic information by given conditions.

func GetUserIssueStats Uses

func GetUserIssueStats(opts UserIssueStatsOptions) (*IssueStats, error)

GetUserIssueStats returns issue statistic information for dashboard by given conditions.

type IssueStatsOptions Uses

type IssueStatsOptions struct {
    RepoID      int64
    Labels      string
    MilestoneID int64
    AssigneeID  int64
    MentionedID int64
    PosterID    int64
    IsPull      util.OptionalBool
    IssueIDs    []int64
}

IssueStatsOptions contains parameters accepted by GetIssueStats.

type IssueUser Uses

type IssueUser struct {
    ID          int64 `xorm:"pk autoincr"`
    UID         int64 `xorm:"INDEX"` // User ID.
    IssueID     int64
    IsRead      bool
    IsMentioned bool
}

IssueUser represents an issue-user relation.

type IssueWatch Uses

type IssueWatch struct {
    ID          int64              `xorm:"pk autoincr"`
    UserID      int64              `xorm:"UNIQUE(watch) NOT NULL"`
    IssueID     int64              `xorm:"UNIQUE(watch) NOT NULL"`
    IsWatching  bool               `xorm:"NOT NULL"`
    CreatedUnix timeutil.TimeStamp `xorm:"created NOT NULL"`
    UpdatedUnix timeutil.TimeStamp `xorm:"updated NOT NULL"`
}

IssueWatch is connection request for receiving issue notification.

func GetIssueWatch Uses

func GetIssueWatch(userID, issueID int64) (iw *IssueWatch, exists bool, err error)

GetIssueWatch returns an issue watch by user and issue

type IssueWatchList Uses

type IssueWatchList []*IssueWatch

IssueWatchList contains IssueWatch

func GetIssueWatchers Uses

func GetIssueWatchers(issueID int64) (IssueWatchList, error)

GetIssueWatchers returns watchers/unwatchers of a given issue

func (IssueWatchList) LoadWatchUsers Uses

func (iwl IssueWatchList) LoadWatchUsers() (users UserList, err error)

LoadWatchUsers return watching users

type IssuesConfig Uses

type IssuesConfig struct {
    EnableTimetracker                bool
    AllowOnlyContributorsToTrackTime bool
    EnableDependencies               bool
}

IssuesConfig describes issues config

func (*IssuesConfig) FromDB Uses

func (cfg *IssuesConfig) FromDB(bs []byte) error

FromDB fills up a IssuesConfig from serialized format.

func (*IssuesConfig) ToDB Uses

func (cfg *IssuesConfig) ToDB() ([]byte, error)

ToDB exports a IssuesConfig to a serialized format.

type IssuesOptions Uses

type IssuesOptions struct {
    RepoIDs     []int64 // include all repos if empty
    AssigneeID  int64
    PosterID    int64
    MentionedID int64
    MilestoneID int64
    Page        int
    PageSize    int
    IsClosed    util.OptionalBool
    IsPull      util.OptionalBool
    LabelIDs    []int64
    SortType    string
    IssueIDs    []int64
    // prioritize issues from this repo
    PriorityRepoID int64
}

IssuesOptions represents options of an issue.

type KeyType Uses

type KeyType int

KeyType specifies the key type

type LDAPConfig Uses

type LDAPConfig struct {
    *ldap.Source
}

LDAPConfig holds configuration for LDAP login source.

func (*LDAPConfig) FromDB Uses

func (cfg *LDAPConfig) FromDB(bs []byte) error

FromDB fills up a LDAPConfig from serialized format.

func (*LDAPConfig) SecurityProtocolName Uses

func (cfg *LDAPConfig) SecurityProtocolName() string

SecurityProtocolName returns the name of configured security protocol.

func (*LDAPConfig) ToDB Uses

func (cfg *LDAPConfig) ToDB() ([]byte, error)

ToDB exports a LDAPConfig to a serialized format.

type LFSLock Uses

type LFSLock struct {
    ID      int64       `xorm:"pk autoincr"`
    Repo    *Repository `xorm:"-"`
    RepoID  int64       `xorm:"INDEX NOT NULL"`
    Owner   *User       `xorm:"-"`
    OwnerID int64       `xorm:"INDEX NOT NULL"`
    Path    string      `xorm:"TEXT"`
    Created time.Time   `xorm:"created"`
}

LFSLock represents a git lfs lock of repository.

func CreateLFSLock Uses

func CreateLFSLock(lock *LFSLock) (*LFSLock, error)

CreateLFSLock creates a new lock.

func DeleteLFSLockByID Uses

func DeleteLFSLockByID(id int64, u *User, force bool) (*LFSLock, error)

DeleteLFSLockByID deletes a lock by given ID.

func GetLFSLock Uses

func GetLFSLock(repo *Repository, path string) (*LFSLock, error)

GetLFSLock returns release by given path.

func GetLFSLockByID Uses

func GetLFSLockByID(id int64) (*LFSLock, error)

GetLFSLockByID returns release by given id.

func GetLFSLockByRepoID Uses

func GetLFSLockByRepoID(repoID int64) (locks []*LFSLock, err error)

GetLFSLockByRepoID returns a list of locks of repository.

func (*LFSLock) APIFormat Uses

func (l *LFSLock) APIFormat() *api.LFSLock

APIFormat convert a Release to lfs.LFSLock

func (*LFSLock) AfterLoad Uses

func (l *LFSLock) AfterLoad(session *xorm.Session)

AfterLoad is invoked from XORM after setting the values of all fields of this object.

func (*LFSLock) BeforeInsert Uses

func (l *LFSLock) BeforeInsert()

BeforeInsert is invoked from XORM before inserting an object of this type.

type LFSMetaObject Uses

type LFSMetaObject struct {
    ID           int64              `xorm:"pk autoincr"`
    Oid          string             `xorm:"UNIQUE(s) INDEX NOT NULL"`
    Size         int64              `xorm:"NOT NULL"`
    RepositoryID int64              `xorm:"UNIQUE(s) INDEX NOT NULL"`
    Existing     bool               `xorm:"-"`
    CreatedUnix  timeutil.TimeStamp `xorm:"created"`
}

LFSMetaObject stores metadata for LFS tracked files.

func NewLFSMetaObject Uses

func NewLFSMetaObject(m *LFSMetaObject) (*LFSMetaObject, error)

NewLFSMetaObject stores a given populated LFSMetaObject structure in the database if it is not already present.

func (*LFSMetaObject) Pointer Uses

func (m *LFSMetaObject) Pointer() string

Pointer returns the string representation of an LFS pointer file

type LFSTokenResponse Uses

type LFSTokenResponse struct {
    Header map[string]string `json:"header"`
    Href   string            `json:"href"`
}

LFSTokenResponse defines the JSON structure in which the JWT token is stored. This structure is fetched via SSH and passed by the Git LFS client to the server endpoint for authorization.

type Label Uses

type Label struct {
    ID              int64 `xorm:"pk autoincr"`
    RepoID          int64 `xorm:"INDEX"`
    Name            string
    Description     string
    Color           string `xorm:"VARCHAR(7)"`
    NumIssues       int
    NumClosedIssues int
    NumOpenIssues   int    `xorm:"-"`
    IsChecked       bool   `xorm:"-"`
    QueryString     string `xorm:"-"`
    IsSelected      bool   `xorm:"-"`
    IsExcluded      bool   `xorm:"-"`
}

Label represents a label of repository for issues.

func GetLabelByID Uses

func GetLabelByID(id int64) (*Label, error)

GetLabelByID returns a label by given ID.

func GetLabelInRepoByID Uses

func GetLabelInRepoByID(repoID, labelID int64) (*Label, error)

GetLabelInRepoByID returns a label by ID in given repository.

func GetLabelInRepoByName Uses

func GetLabelInRepoByName(repoID int64, labelName string) (*Label, error)

GetLabelInRepoByName returns a label by name in given repository.

func GetLabelsByIssueID Uses

func GetLabelsByIssueID(issueID int64) ([]*Label, error)

GetLabelsByIssueID returns all labels that belong to given issue by ID.

func GetLabelsByRepoID Uses

func GetLabelsByRepoID(repoID int64, sortType string) ([]*Label, error)

GetLabelsByRepoID returns all labels that belong to given repository by ID.

func GetLabelsInRepoByIDs Uses

func GetLabelsInRepoByIDs(repoID int64, labelIDs []int64) ([]*Label, error)

GetLabelsInRepoByIDs returns a list of labels by IDs in given repository, it silently ignores label IDs that do not belong to the repository.

func (*Label) APIFormat Uses

func (label *Label) APIFormat() *api.Label

APIFormat converts a Label to the api.Label format

func (*Label) CalOpenIssues Uses

func (label *Label) CalOpenIssues()

CalOpenIssues calculates the open issues of label.

func (*Label) ForegroundColor Uses

func (label *Label) ForegroundColor() template.CSS

ForegroundColor calculates the text color for labels based on their background color.

func (*Label) LoadSelectedLabelsAfterClick Uses

func (label *Label) LoadSelectedLabelsAfterClick(currentSelectedLabels []int64)

LoadSelectedLabelsAfterClick calculates the set of selected labels when a label is clicked

type LoginSource Uses

type LoginSource struct {
    ID            int64 `xorm:"pk autoincr"`
    Type          LoginType
    Name          string          `xorm:"UNIQUE"`
    IsActived     bool            `xorm:"INDEX NOT NULL DEFAULT false"`
    IsSyncEnabled bool            `xorm:"INDEX NOT NULL DEFAULT false"`
    Cfg           core.Conversion `xorm:"TEXT"`

    CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"`
    UpdatedUnix timeutil.TimeStamp `xorm:"INDEX updated"`
}

LoginSource represents an external way for authorizing users.

func GetActiveOAuth2LoginSourceByName Uses

func GetActiveOAuth2LoginSourceByName(name string) (*LoginSource, error)

GetActiveOAuth2LoginSourceByName returns a OAuth2 LoginSource based on the given name

func GetActiveOAuth2ProviderLoginSources Uses

func GetActiveOAuth2ProviderLoginSources() ([]*LoginSource, error)

GetActiveOAuth2ProviderLoginSources returns all actived LoginOAuth2 sources

func GetLoginSourceByID Uses

func GetLoginSourceByID(id int64) (*LoginSource, error)

GetLoginSourceByID returns login source by given ID.

func LoginSources Uses

func LoginSources() ([]*LoginSource, error)

LoginSources returns a slice of all login sources found in DB.

func (*LoginSource) BeforeSet Uses

func (source *LoginSource) BeforeSet(colName string, val xorm.Cell)

BeforeSet is invoked from XORM before setting the value of a field of this object.

func (*LoginSource) HasTLS Uses

func (source *LoginSource) HasTLS() bool

HasTLS returns true of this source supports TLS.

func (*LoginSource) IsDLDAP Uses

func (source *LoginSource) IsDLDAP() bool

IsDLDAP returns true of this source is of the DLDAP type.

func (*LoginSource) IsLDAP Uses

func (source *LoginSource) IsLDAP() bool

IsLDAP returns true of this source is of the LDAP type.

func (*LoginSource) IsOAuth2 Uses

func (source *LoginSource) IsOAuth2() bool

IsOAuth2 returns true of this source is of the OAuth2 type.

func (*LoginSource) IsPAM Uses

func (source *LoginSource) IsPAM() bool

IsPAM returns true of this source is of the PAM type.

func (*LoginSource) IsSMTP Uses

func (source *LoginSource) IsSMTP() bool

IsSMTP returns true of this source is of the SMTP type.

func (*LoginSource) LDAP Uses

func (source *LoginSource) LDAP() *LDAPConfig

LDAP returns LDAPConfig for this source, if of LDAP type.

func (*LoginSource) OAuth2 Uses

func (source *LoginSource) OAuth2() *OAuth2Config

OAuth2 returns OAuth2Config for this source, if of OAuth2 type.

func (*LoginSource) PAM Uses

func (source *LoginSource) PAM() *PAMConfig

PAM returns PAMConfig for this source, if of PAM type.

func (*LoginSource) SMTP Uses

func (source *LoginSource) SMTP() *SMTPConfig

SMTP returns SMTPConfig for this source, if of SMTP type.

func (*LoginSource) SkipVerify Uses

func (source *LoginSource) SkipVerify() bool

SkipVerify returns true if this source is configured to skip SSL verification.

func (*LoginSource) TypeName Uses

func (source *LoginSource) TypeName() string

TypeName return name of this login source type.

func (*LoginSource) UseTLS Uses

func (source *LoginSource) UseTLS() bool

UseTLS returns true of this source is configured to use TLS.

type LoginType Uses

type LoginType int

LoginType represents an login type.

const (
    LoginNoType LoginType = iota
    LoginPlain            // 1
    LoginLDAP             // 2
    LoginSMTP             // 3
    LoginPAM              // 4
    LoginDLDAP            // 5
    LoginOAuth2           // 6
)

Note: new type must append to the end of list to maintain compatibility.

type MergeStyle Uses

type MergeStyle string

MergeStyle represents the approach to merge commits into base branch.

const (
    // MergeStyleMerge create merge commit
    MergeStyleMerge MergeStyle = "merge"
    // MergeStyleRebase rebase before merging
    MergeStyleRebase MergeStyle = "rebase"
    // MergeStyleRebaseMerge rebase before merging with merge commit (--no-ff)
    MergeStyleRebaseMerge MergeStyle = "rebase-merge"
    // MergeStyleSquash squash commits into single commit before merging
    MergeStyleSquash MergeStyle = "squash"
)

type Milestone Uses

type Milestone struct {
    ID              int64 `xorm:"pk autoincr"`
    RepoID          int64 `xorm:"INDEX"`
    Name            string
    Content         string `xorm:"TEXT"`
    RenderedContent string `xorm:"-"`
    IsClosed        bool
    NumIssues       int
    NumClosedIssues int
    NumOpenIssues   int  `xorm:"-"`
    Completeness    int  // Percentage(1-100).
    IsOverdue       bool `xorm:"-"`

    DeadlineString string `xorm:"-"`
    DeadlineUnix   timeutil.TimeStamp
    ClosedDateUnix timeutil.TimeStamp

    TotalTrackedTime int64 `xorm:"-"`
}

Milestone represents a milestone of repository.

func GetMilestoneByID Uses

func GetMilestoneByID(id int64) (*Milestone, error)

GetMilestoneByID returns the milestone via id .

func GetMilestoneByRepoID Uses

func GetMilestoneByRepoID(repoID, id int64) (*Milestone, error)

GetMilestoneByRepoID returns the milestone in a repository.

func (*Milestone) APIFormat Uses

func (m *Milestone) APIFormat() *api.Milestone

APIFormat returns this Milestone in API format.

func (*Milestone) AfterLoad Uses

func (m *Milestone) AfterLoad()

AfterLoad is invoked from XORM after setting the value of a field of this object.

func (*Milestone) BeforeUpdate Uses

func (m *Milestone) BeforeUpdate()

BeforeUpdate is invoked from XORM before updating this object.

func (*Milestone) State Uses

func (m *Milestone) State() api.StateType

State returns string representation of milestone status.

type MilestoneList Uses

type MilestoneList []*Milestone

MilestoneList is a list of milestones offering additional functionality

func GetMilestones