Documentation ¶
Index ¶
- func ToAPIIssue(issue *models.Issue) *api.Issue
- func ToAPIIssueList(il models.IssueList) []*api.Issue
- func ToAPIMilestone(m *models.Milestone) *api.Milestone
- func ToAPIPullRequest(pr *models.PullRequest) *api.PullRequest
- func ToAnnotatedTag(repo *models.Repository, t *git.Tag, c *git.Commit) *api.AnnotatedTag
- func ToAnnotatedTagObject(repo *models.Repository, commit *git.Commit) *api.AnnotatedTagObject
- func ToBranch(repo *models.Repository, b *git.Branch, c *git.Commit, ...) (*api.Branch, error)
- func ToBranchProtection(bp *models.ProtectedBranch) *api.BranchProtection
- func ToCombinedStatus(statuses []*models.CommitStatus, repo *api.Repository) *api.CombinedStatus
- func ToComment(c *models.Comment) *api.Comment
- func ToCommit(repo *models.Repository, commit *git.Commit, userCache map[string]*models.User) (*api.Commit, error)
- func ToCommitMeta(repo *models.Repository, tag *git.Tag) *api.CommitMeta
- func ToCommitStatus(status *models.CommitStatus) *api.CommitStatus
- func ToCommitUser(sig *git.Signature) *api.CommitUser
- func ToCorrectPageSize(size int) int
- func ToDeployKey(apiLink string, key *models.DeployKey) *api.DeployKey
- func ToEmail(email *models.EmailAddress) *api.Email
- func ToGPGKey(key *models.GPGKey) *api.GPGKey
- func ToGPGKeyEmail(email *models.EmailAddress) *api.GPGKeyEmail
- func ToGitHook(h *git.Hook) *api.GitHook
- func ToGitServiceType(value string) structs.GitServiceType
- func ToHook(repoLink string, w *models.Webhook) *api.Hook
- func ToLFSLock(l *models.LFSLock) *api.LFSLock
- func ToLabel(label *models.Label) *api.Label
- func ToLabelList(labels []*models.Label) []*api.Label
- func ToNotificationThread(n *models.Notification) *api.NotificationThread
- func ToNotifications(nl models.NotificationList) []*api.NotificationThread
- func ToOAuth2Application(app *models.OAuth2Application) *api.OAuth2Application
- func ToOrganization(org *models.User) *api.Organization
- func ToPayloadCommit(repo *models.Repository, c *git.Commit) *api.PayloadCommit
- func ToPublicKey(apiLink string, key *models.PublicKey) *api.PublicKey
- func ToPullReview(r *models.Review, doer *models.User) (*api.PullReview, error)
- func ToPullReviewCommentList(review *models.Review, doer *models.User) ([]*api.PullReviewComment, error)
- func ToPullReviewList(rl []*models.Review, doer *models.User) ([]*api.PullReview, error)
- func ToRelease(r *models.Release) *api.Release
- func ToReleaseAttachment(a *models.Attachment) *api.Attachment
- func ToRepo(repo *models.Repository, mode models.AccessMode) *api.Repository
- func ToStopWatches(sws []*models.Stopwatch) (api.StopWatches, error)
- func ToTag(repo *models.Repository, t *git.Tag) *api.Tag
- func ToTeam(team *models.Team) *api.Team
- func ToTopicResponse(topic *models.Topic) *api.TopicResponse
- func ToTrackedTime(t *models.TrackedTime) (apiT *api.TrackedTime)
- func ToTrackedTimeList(tl models.TrackedTimeList) api.TrackedTimeList
- func ToUser(user, doer *models.User) *api.User
- func ToUserWithAccessMode(user *models.User, accessMode models.AccessMode) *api.User
- func ToUsers(doer *models.User, users []*models.User) []*api.User
- func ToVerification(c *git.Commit) *api.PayloadCommitVerification
- func User2UserSettings(user *models.User) api.UserSettings
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ToAPIIssue ¶ added in v1.12.0
ToAPIIssue converts an Issue to API format it assumes some fields assigned with values: Required - Poster, Labels, Optional - Milestone, Assignee, PullRequest
func ToAPIIssueList ¶ added in v1.12.0
ToAPIIssueList converts an IssueList to API format
func ToAPIMilestone ¶ added in v1.12.0
ToAPIMilestone converts Milestone into API Format
func ToAPIPullRequest ¶ added in v1.12.0
func ToAPIPullRequest(pr *models.PullRequest) *api.PullRequest
ToAPIPullRequest assumes following fields have been assigned with valid values: Required - Issue Optional - Merger
func ToAnnotatedTag ¶
func ToAnnotatedTag(repo *models.Repository, t *git.Tag, c *git.Commit) *api.AnnotatedTag
ToAnnotatedTag convert git.Tag to api.AnnotatedTag
func ToAnnotatedTagObject ¶
func ToAnnotatedTagObject(repo *models.Repository, commit *git.Commit) *api.AnnotatedTagObject
ToAnnotatedTagObject convert a git.Commit to an api.AnnotatedTagObject
func ToBranch ¶
func ToBranch(repo *models.Repository, b *git.Branch, c *git.Commit, bp *models.ProtectedBranch, user *models.User, isRepoAdmin bool) (*api.Branch, error)
ToBranch convert a git.Commit and git.Branch to an api.Branch
func ToBranchProtection ¶ added in v1.12.0
func ToBranchProtection(bp *models.ProtectedBranch) *api.BranchProtection
ToBranchProtection convert a ProtectedBranch to api.BranchProtection
func ToCombinedStatus ¶ added in v1.14.0
func ToCombinedStatus(statuses []*models.CommitStatus, repo *api.Repository) *api.CombinedStatus
ToCombinedStatus converts List of CommitStatus to a CombinedStatus
func ToCommit ¶
func ToCommit(repo *models.Repository, commit *git.Commit, userCache map[string]*models.User) (*api.Commit, error)
ToCommit convert a git.Commit to api.Commit
func ToCommitMeta ¶
func ToCommitMeta(repo *models.Repository, tag *git.Tag) *api.CommitMeta
ToCommitMeta convert a git.Tag to an api.CommitMeta
func ToCommitStatus ¶ added in v1.14.0
func ToCommitStatus(status *models.CommitStatus) *api.CommitStatus
ToCommitStatus converts models.CommitStatus to api.CommitStatus
func ToCommitUser ¶
func ToCommitUser(sig *git.Signature) *api.CommitUser
ToCommitUser convert a git.Signature to an api.CommitUser
func ToCorrectPageSize ¶
ToCorrectPageSize makes sure page size is in allowed range.
func ToDeployKey ¶
ToDeployKey convert models.DeployKey to api.DeployKey
func ToEmail ¶
func ToEmail(email *models.EmailAddress) *api.Email
ToEmail convert models.EmailAddress to api.Email
func ToGPGKeyEmail ¶
func ToGPGKeyEmail(email *models.EmailAddress) *api.GPGKeyEmail
ToGPGKeyEmail convert models.EmailAddress to api.GPGKeyEmail
func ToGitServiceType ¶ added in v1.13.0
func ToGitServiceType(value string) structs.GitServiceType
ToGitServiceType return GitServiceType based on string
func ToLabelList ¶ added in v1.12.0
ToLabelList converts list of Label to API format
func ToNotificationThread ¶ added in v1.14.0
func ToNotificationThread(n *models.Notification) *api.NotificationThread
ToNotificationThread convert a Notification to api.NotificationThread
func ToNotifications ¶ added in v1.14.0
func ToNotifications(nl models.NotificationList) []*api.NotificationThread
ToNotifications convert list of Notification to api.NotificationThread list
func ToOAuth2Application ¶ added in v1.12.0
func ToOAuth2Application(app *models.OAuth2Application) *api.OAuth2Application
ToOAuth2Application convert from models.OAuth2Application to api.OAuth2Application
func ToOrganization ¶
func ToOrganization(org *models.User) *api.Organization
ToOrganization convert models.User to api.Organization
func ToPayloadCommit ¶ added in v1.13.0
func ToPayloadCommit(repo *models.Repository, c *git.Commit) *api.PayloadCommit
ToPayloadCommit convert a git.Commit to api.PayloadCommit
func ToPublicKey ¶
ToPublicKey convert models.PublicKey to api.PublicKey
func ToPullReview ¶ added in v1.12.0
ToPullReview convert a review to api format
func ToPullReviewCommentList ¶ added in v1.12.0
func ToPullReviewCommentList(review *models.Review, doer *models.User) ([]*api.PullReviewComment, error)
ToPullReviewCommentList convert the CodeComments of an review to it's api format
func ToPullReviewList ¶ added in v1.12.0
ToPullReviewList convert a list of review to it's api format
func ToReleaseAttachment ¶ added in v1.14.0
func ToReleaseAttachment(a *models.Attachment) *api.Attachment
ToReleaseAttachment converts models.Attachment to api.Attachment
func ToRepo ¶ added in v1.14.0
func ToRepo(repo *models.Repository, mode models.AccessMode) *api.Repository
ToRepo converts a Repository to api.Repository
func ToStopWatches ¶ added in v1.13.0
func ToStopWatches(sws []*models.Stopwatch) (api.StopWatches, error)
ToStopWatches convert Stopwatch list to api.StopWatches
func ToTopicResponse ¶
func ToTopicResponse(topic *models.Topic) *api.TopicResponse
ToTopicResponse convert from models.Topic to api.TopicResponse
func ToTrackedTime ¶ added in v1.12.0
func ToTrackedTime(t *models.TrackedTime) (apiT *api.TrackedTime)
ToTrackedTime converts TrackedTime to API format
func ToTrackedTimeList ¶ added in v1.12.0
func ToTrackedTimeList(tl models.TrackedTimeList) api.TrackedTimeList
ToTrackedTimeList converts TrackedTimeList to API format
func ToUser ¶
ToUser convert models.User to api.User if doer is set, private information is added if the doer has the permission to see it
func ToUserWithAccessMode ¶ added in v1.15.0
ToUserWithAccessMode convert models.User to api.User AccessMode is not none show add some more information
func ToVerification ¶
func ToVerification(c *git.Commit) *api.PayloadCommitVerification
ToVerification convert a git.Commit.Signature to an api.PayloadCommitVerification
func User2UserSettings ¶ added in v1.15.0
func User2UserSettings(user *models.User) api.UserSettings
User2UserSettings return UserSettings based on a user
Types ¶
This section is empty.