gitea: code.gitea.io/gitea/modules/convert Index | Files

package convert

import "code.gitea.io/gitea/modules/convert"

Index

Package Files

convert.go git_commit.go issue.go issue_comment.go notification.go pull.go pull_review.go release.go repository.go status.go user.go utils.go

func ToAPIIssue Uses

func ToAPIIssue(issue *models.Issue) *api.Issue

ToAPIIssue converts an Issue to API format it assumes some fields assigned with values: Required - Poster, Labels, Optional - Milestone, Assignee, PullRequest

func ToAPIIssueList Uses

func ToAPIIssueList(il models.IssueList) []*api.Issue

ToAPIIssueList converts an IssueList to API format

func ToAPIMilestone Uses

func ToAPIMilestone(m *models.Milestone) *api.Milestone

ToAPIMilestone converts Milestone into API Format

func ToAPIPullRequest Uses

func ToAPIPullRequest(pr *models.PullRequest) *api.PullRequest

ToAPIPullRequest assumes following fields have been assigned with valid values: Required - Issue Optional - Merger

func ToAnnotatedTag Uses

func ToAnnotatedTag(repo *models.Repository, t *git.Tag, c *git.Commit) *api.AnnotatedTag

ToAnnotatedTag convert git.Tag to api.AnnotatedTag

func ToAnnotatedTagObject Uses

func ToAnnotatedTagObject(repo *models.Repository, commit *git.Commit) *api.AnnotatedTagObject

ToAnnotatedTagObject convert a git.Commit to an api.AnnotatedTagObject

func ToBranch Uses

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 Uses

func ToBranchProtection(bp *models.ProtectedBranch) *api.BranchProtection

ToBranchProtection convert a ProtectedBranch to api.BranchProtection

func ToCombinedStatus Uses

func ToCombinedStatus(statuses []*models.CommitStatus, repo *api.Repository) *api.CombinedStatus

ToCombinedStatus converts List of CommitStatus to a CombinedStatus

func ToComment Uses

func ToComment(c *models.Comment) *api.Comment

ToComment converts a models.Comment to the api.Comment format

func ToCommit Uses

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 Uses

func ToCommitMeta(repo *models.Repository, tag *git.Tag) *api.CommitMeta

ToCommitMeta convert a git.Tag to an api.CommitMeta

func ToCommitStatus Uses

func ToCommitStatus(status *models.CommitStatus) *api.CommitStatus

ToCommitStatus converts models.CommitStatus to api.CommitStatus

func ToCommitUser Uses

func ToCommitUser(sig *git.Signature) *api.CommitUser

ToCommitUser convert a git.Signature to an api.CommitUser

func ToCorrectPageSize Uses

func ToCorrectPageSize(size int) int

ToCorrectPageSize makes sure page size is in allowed range.

func ToDeployKey Uses

func ToDeployKey(apiLink string, key *models.DeployKey) *api.DeployKey

ToDeployKey convert models.DeployKey to api.DeployKey

func ToEmail Uses

func ToEmail(email *models.EmailAddress) *api.Email

ToEmail convert models.EmailAddress to api.Email

func ToGPGKey Uses

func ToGPGKey(key *models.GPGKey) *api.GPGKey

ToGPGKey converts models.GPGKey to api.GPGKey

func ToGPGKeyEmail Uses

func ToGPGKeyEmail(email *models.EmailAddress) *api.GPGKeyEmail

ToGPGKeyEmail convert models.EmailAddress to api.GPGKeyEmail

func ToGitHook Uses

func ToGitHook(h *git.Hook) *api.GitHook

ToGitHook convert git.Hook to api.GitHook

func ToGitServiceType Uses

func ToGitServiceType(value string) structs.GitServiceType

ToGitServiceType return GitServiceType based on string

func ToHook Uses

func ToHook(repoLink string, w *models.Webhook) *api.Hook

ToHook convert models.Webhook to api.Hook

func ToLFSLock Uses

func ToLFSLock(l *models.LFSLock) *api.LFSLock

ToLFSLock convert a LFSLock to api.LFSLock

func ToLabel Uses

func ToLabel(label *models.Label) *api.Label

ToLabel converts Label to API format

func ToLabelList Uses

func ToLabelList(labels []*models.Label) []*api.Label

ToLabelList converts list of Label to API format

func ToNotificationThread Uses

func ToNotificationThread(n *models.Notification) *api.NotificationThread

ToNotificationThread convert a Notification to api.NotificationThread

func ToNotifications Uses

func ToNotifications(nl models.NotificationList) []*api.NotificationThread

ToNotifications convert list of Notification to api.NotificationThread list

func ToOAuth2Application Uses

func ToOAuth2Application(app *models.OAuth2Application) *api.OAuth2Application

ToOAuth2Application convert from models.OAuth2Application to api.OAuth2Application

func ToOrganization Uses

func ToOrganization(org *models.User) *api.Organization

ToOrganization convert models.User to api.Organization

func ToPayloadCommit Uses

func ToPayloadCommit(repo *models.Repository, c *git.Commit) *api.PayloadCommit

ToPayloadCommit convert a git.Commit to api.PayloadCommit

func ToPublicKey Uses

func ToPublicKey(apiLink string, key *models.PublicKey) *api.PublicKey

ToPublicKey convert models.PublicKey to api.PublicKey

func ToPullReview Uses

func ToPullReview(r *models.Review, doer *models.User) (*api.PullReview, error)

ToPullReview convert a review to api format

func ToPullReviewCommentList Uses

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 Uses

func ToPullReviewList(rl []*models.Review, doer *models.User) ([]*api.PullReview, error)

ToPullReviewList convert a list of review to it's api format

func ToRelease Uses

func ToRelease(r *models.Release) *api.Release

ToRelease convert a models.Release to api.Release

func ToReleaseAttachment Uses

func ToReleaseAttachment(a *models.Attachment) *api.Attachment

ToReleaseAttachment converts models.Attachment to api.Attachment

func ToRepo Uses

func ToRepo(repo *models.Repository, mode models.AccessMode) *api.Repository

ToRepo converts a Repository to api.Repository

func ToStopWatches Uses

func ToStopWatches(sws []*models.Stopwatch) (api.StopWatches, error)

ToStopWatches convert Stopwatch list to api.StopWatches

func ToTag Uses

func ToTag(repo *models.Repository, t *git.Tag) *api.Tag

ToTag convert a git.Tag to an api.Tag

func ToTeam Uses

func ToTeam(team *models.Team) *api.Team

ToTeam convert models.Team to api.Team

func ToTopicResponse Uses

func ToTopicResponse(topic *models.Topic) *api.TopicResponse

ToTopicResponse convert from models.Topic to api.TopicResponse

func ToTrackedTime Uses

func ToTrackedTime(t *models.TrackedTime) (apiT *api.TrackedTime)

ToTrackedTime converts TrackedTime to API format

func ToTrackedTimeList Uses

func ToTrackedTimeList(tl models.TrackedTimeList) api.TrackedTimeList

ToTrackedTimeList converts TrackedTimeList to API format

func ToUser Uses

func ToUser(user *models.User, signed, authed bool) *api.User

ToUser convert models.User to api.User signed shall only be set if requester is logged in. authed shall only be set if user is site admin or user himself

func ToVerification Uses

func ToVerification(c *git.Commit) *api.PayloadCommitVerification

ToVerification convert a git.Commit.Signature to an api.PayloadCommitVerification

Package convert imports 13 packages (graph) and is imported by 20 packages. Updated 2021-01-22. Refresh now. Tools for package owners.