{"modulePath":"github.com/RedAFD/code-core","version":"v1.14.0-rc8","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package convert\n\n## Functions\n\n```go\nfunc ToAPIIssue(issue *models.Issue) *api.Issue\n```\nToAPIIssue converts an Issue to API format it assumes some fields assigned with values: Required - Poster, Labels, Optional - Milestone, Assignee, PullRequest\n\n```go\nfunc ToAPIIssueList(il models.IssueList) []*api.Issue\n```\nToAPIIssueList converts an IssueList to API format\n\n```go\nfunc ToAPIMilestone(m *models.Milestone) *api.Milestone\n```\nToAPIMilestone converts Milestone into API Format\n\n```go\nfunc ToAPIPullRequest(pr *models.PullRequest) *api.PullRequest\n```\nToAPIPullRequest assumes following fields have been assigned with valid values: Required - Issue Optional - Merger\n\n```go\nfunc ToAnnotatedTag(repo *models.Repository, t *git.Tag, c *git.Commit) *api.AnnotatedTag\n```\nToAnnotatedTag convert git.Tag to api.AnnotatedTag\n\n```go\nfunc ToAnnotatedTagObject(repo *models.Repository, commit *git.Commit) *api.AnnotatedTagObject\n```\nToAnnotatedTagObject convert a git.Commit to an api.AnnotatedTagObject\n\n```go\nfunc ToBranch(repo *models.Repository, b *git.Branch, c *git.Commit, bp *models.ProtectedBranch, user *models.User, isRepoAdmin bool) (*api.Branch, error)\n```\nToBranch convert a git.Commit and git.Branch to an api.Branch\n\n```go\nfunc ToBranchProtection(bp *models.ProtectedBranch) *api.BranchProtection\n```\nToBranchProtection convert a ProtectedBranch to api.BranchProtection\n\n```go\nfunc ToCombinedStatus(statuses []*models.CommitStatus, repo *api.Repository) *api.CombinedStatus\n```\nToCombinedStatus converts List of CommitStatus to a CombinedStatus\n\n```go\nfunc ToComment(c *models.Comment) *api.Comment\n```\nToComment converts a models.Comment to the api.Comment format\n\n```go\nfunc ToCommit(repo *models.Repository, commit *git.Commit, userCache map[string]*models.User) (*api.Commit, error)\n```\nToCommit convert a git.Commit to api.Commit\n\n```go\nfunc ToCommitMeta(repo *models.Repository, tag *git.Tag) *api.CommitMeta\n```\nToCommitMeta convert a git.Tag to an api.CommitMeta\n\n```go\nfunc ToCommitStatus(status *models.CommitStatus) *api.CommitStatus\n```\nToCommitStatus converts models.CommitStatus to api.CommitStatus\n\n```go\nfunc ToCommitUser(sig *git.Signature) *api.CommitUser\n```\nToCommitUser convert a git.Signature to an api.CommitUser\n\n```go\nfunc ToCorrectPageSize(size int) int\n```\nToCorrectPageSize makes sure page size is in allowed range.\n\n```go\nfunc ToDeployKey(apiLink string, key *models.DeployKey) *api.DeployKey\n```\nToDeployKey convert models.DeployKey to api.DeployKey\n\n```go\nfunc ToEmail(email *models.EmailAddress) *api.Email\n```\nToEmail convert models.EmailAddress to api.Email\n\n```go\nfunc ToGPGKey(key *models.GPGKey) *api.GPGKey\n```\nToGPGKey converts models.GPGKey to api.GPGKey\n\n```go\nfunc ToGPGKeyEmail(email *models.EmailAddress) *api.GPGKeyEmail\n```\nToGPGKeyEmail convert models.EmailAddress to api.GPGKeyEmail\n\n```go\nfunc ToGitHook(h *git.Hook) *api.GitHook\n```\nToGitHook convert git.Hook to api.GitHook\n\n```go\nfunc ToGitServiceType(value string) structs.GitServiceType\n```\nToGitServiceType return GitServiceType based on string\n\n```go\nfunc ToHook(repoLink string, w *models.Webhook) *api.Hook\n```\nToHook convert models.Webhook to api.Hook\n\n```go\nfunc ToLFSLock(l *models.LFSLock) *api.LFSLock\n```\nToLFSLock convert a LFSLock to api.LFSLock\n\n```go\nfunc ToLabel(label *models.Label) *api.Label\n```\nToLabel converts Label to API format\n\n```go\nfunc ToLabelList(labels []*models.Label) []*api.Label\n```\nToLabelList converts list of Label to API format\n\n```go\nfunc ToNotificationThread(n *models.Notification) *api.NotificationThread\n```\nToNotificationThread convert a Notification to api.NotificationThread\n\n```go\nfunc ToNotifications(nl models.NotificationList) []*api.NotificationThread\n```\nToNotifications convert list of Notification to api.NotificationThread list\n\n```go\nfunc ToOAuth2Application(app *models.OAuth2Application) *api.OAuth2Application\n```\nToOAuth2Application convert from models.OAuth2Application to api.OAuth2Application\n\n```go\nfunc ToOrganization(org *models.User) *api.Organization\n```\nToOrganization convert models.User to api.Organization\n\n```go\nfunc ToPayloadCommit(repo *models.Repository, c *git.Commit) *api.PayloadCommit\n```\nToPayloadCommit convert a git.Commit to api.PayloadCommit\n\n```go\nfunc ToPublicKey(apiLink string, key *models.PublicKey) *api.PublicKey\n```\nToPublicKey convert models.PublicKey to api.PublicKey\n\n```go\nfunc ToPullReview(r *models.Review, doer *models.User) (*api.PullReview, error)\n```\nToPullReview convert a review to api format\n\n```go\nfunc ToPullReviewCommentList(review *models.Review, doer *models.User) ([]*api.PullReviewComment, error)\n```\nToPullReviewCommentList convert the CodeComments of an review to it's api format\n\n```go\nfunc ToPullReviewList(rl []*models.Review, doer *models.User) ([]*api.PullReview, error)\n```\nToPullReviewList convert a list of review to it's api format\n\n```go\nfunc ToRelease(r *models.Release) *api.Release\n```\nToRelease convert a models.Release to api.Release\n\n```go\nfunc ToReleaseAttachment(a *models.Attachment) *api.Attachment\n```\nToReleaseAttachment converts models.Attachment to api.Attachment\n\n```go\nfunc ToRepo(repo *models.Repository, mode models.AccessMode) *api.Repository\n```\nToRepo converts a Repository to api.Repository\n\n```go\nfunc ToStopWatches(sws []*models.Stopwatch) (api.StopWatches, error)\n```\nToStopWatches convert Stopwatch list to api.StopWatches\n\n```go\nfunc ToTag(repo *models.Repository, t *git.Tag) *api.Tag\n```\nToTag convert a git.Tag to an api.Tag\n\n```go\nfunc ToTeam(team *models.Team) *api.Team\n```\nToTeam convert models.Team to api.Team\n\n```go\nfunc ToTopicResponse(topic *models.Topic) *api.TopicResponse\n```\nToTopicResponse convert from models.Topic to api.TopicResponse\n\n```go\nfunc ToTrackedTime(t *models.TrackedTime) (apiT *api.TrackedTime)\n```\nToTrackedTime converts TrackedTime to API format\n\n```go\nfunc ToTrackedTimeList(tl models.TrackedTimeList) api.TrackedTimeList\n```\nToTrackedTimeList converts TrackedTimeList to API format\n\n```go\nfunc ToUser(user *models.User, signed, authed bool) *api.User\n```\nToUser 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\n\n```go\nfunc ToVerification(c *git.Commit) *api.PayloadCommitVerification\n```\nToVerification convert a git.Commit.Signature to an api.PayloadCommitVerification\n\n","path":"github.com/RedAFD/code-core/modules/convert","name":"convert","synopsis":"","isRedistributable":true}
