Documentation ¶
Index ¶
- func APIAssetDownloadURL(repo *repo_model.Repository, attach *repo_model.Attachment) string
- func ToAPIAttachment(repo *repo_model.Repository, a *repo_model.Attachment) *api.Attachment
- func ToAPIAttachments(repo *repo_model.Repository, attachments []*repo_model.Attachment) []*api.Attachment
- func ToAPIComment(ctx context.Context, repo *repo_model.Repository, c *issues_model.Comment) *api.Comment
- func ToAPIIssue(ctx context.Context, issue *issues_model.Issue) *api.Issue
- func ToAPIIssueList(ctx context.Context, il issues_model.IssueList) []*api.Issue
- func ToAPIMilestone(m *issues_model.Milestone) *api.Milestone
- func ToAPIPullRequest(ctx context.Context, pr *issues_model.PullRequest, doer *user_model.User) *api.PullRequest
- func ToAPIRelease(ctx context.Context, repo *repo_model.Repository, r *repo_model.Release) *api.Release
- func ToActivities(ctx context.Context, al activities_model.ActionList, doer *user_model.User) []*api.Activity
- func ToActivity(ctx context.Context, ac *activities_model.Action, doer *user_model.User) *api.Activity
- func ToAnnotatedTag(ctx context.Context, repo *repo_model.Repository, t *git.Tag, c *git.Commit) *api.AnnotatedTag
- func ToAnnotatedTagObject(repo *repo_model.Repository, commit *git.Commit) *api.AnnotatedTagObject
- func ToAttachment(repo *repo_model.Repository, a *repo_model.Attachment) *api.Attachment
- func ToBranch(ctx context.Context, repo *repo_model.Repository, branchName string, ...) (*api.Branch, error)
- func ToBranchProtection(ctx context.Context, bp *git_model.ProtectedBranch) *api.BranchProtection
- func ToChangedFile(f *gitdiff.DiffFile, repo *repo_model.Repository, commit string) *api.ChangedFile
- func ToCombinedStatus(ctx context.Context, statuses []*git_model.CommitStatus, repo *api.Repository) *api.CombinedStatus
- func ToCommit(ctx context.Context, repo *repo_model.Repository, gitRepo *git.Repository, ...) (*api.Commit, error)
- func ToCommitMeta(repo *repo_model.Repository, tag *git.Tag) *api.CommitMeta
- func ToCommitStatus(ctx context.Context, status *git_model.CommitStatus) *api.CommitStatus
- func ToCommitUser(sig *git.Signature) *api.CommitUser
- func ToCorrectPageSize(size int) int
- func ToDeployKey(apiLink string, key *asymkey_model.DeployKey) *api.DeployKey
- func ToEmail(email *user_model.EmailAddress) *api.Email
- func ToEmailSearch(email *user_model.SearchEmailResult) *api.Email
- func ToGPGKey(key *asymkey_model.GPGKey) *api.GPGKey
- func ToGPGKeyEmail(email *user_model.EmailAddress) *api.GPGKeyEmail
- func ToGitHook(h *git.Hook) *api.GitHook
- func ToGitServiceType(value string) structs.GitServiceType
- func ToIssue(ctx context.Context, issue *issues_model.Issue) *api.Issue
- func ToIssueList(ctx context.Context, il issues_model.IssueList) []*api.Issue
- func ToLFSLock(ctx context.Context, l *git_model.LFSLock) *api.LFSLock
- func ToLabel(label *issues_model.Label, repo *repo_model.Repository, org *user_model.User) *api.Label
- func ToLabelList(labels []*issues_model.Label, repo *repo_model.Repository, ...) []*api.Label
- func ToLabelTemplate(label *label.Label) *api.LabelTemplate
- func ToLabelTemplateList(labels []*label.Label) []*api.LabelTemplate
- func ToNotificationThread(n *activities_model.Notification) *api.NotificationThread
- func ToNotifications(nl activities_model.NotificationList) []*api.NotificationThread
- func ToOAuth2Application(app *auth.OAuth2Application) *api.OAuth2Application
- func ToOrganization(ctx context.Context, org *organization.Organization) *api.Organization
- func ToPackage(ctx context.Context, pd *packages.PackageDescriptor, doer *user_model.User) (*api.Package, error)
- func ToPackageFile(pfd *packages.PackageFileDescriptor) *api.PackageFile
- func ToPayloadCommit(ctx context.Context, repo *repo_model.Repository, c *git.Commit) *api.PayloadCommit
- func ToPublicKey(apiLink string, key *asymkey_model.PublicKey) *api.PublicKey
- func ToPullReview(ctx context.Context, r *issues_model.Review, doer *user_model.User) (*api.PullReview, error)
- func ToPullReviewCommentList(ctx context.Context, review *issues_model.Review, doer *user_model.User) ([]*api.PullReviewComment, error)
- func ToPullReviewList(ctx context.Context, rl []*issues_model.Review, doer *user_model.User) ([]*api.PullReview, error)
- func ToPushMirror(pm *repo_model.PushMirror) (*api.PushMirror, error)
- func ToRepo(ctx context.Context, repo *repo_model.Repository, ...) *api.Repository
- func ToRepoTransfer(ctx context.Context, t *models.RepoTransfer) *api.RepoTransfer
- func ToSecret(secret *secret_model.Secret) *api.Secret
- func ToStopWatches(sws []*issues_model.Stopwatch) (api.StopWatches, error)
- func ToTag(repo *repo_model.Repository, t *git.Tag) *api.Tag
- func ToTeam(ctx context.Context, team *organization.Team, loadOrg ...bool) (*api.Team, error)
- func ToTeams(ctx context.Context, teams []*organization.Team, loadOrgs bool) ([]*api.Team, error)
- func ToTimelineComment(ctx context.Context, repo *repo_model.Repository, c *issues_model.Comment, ...) *api.TimelineComment
- func ToTopicResponse(topic *repo_model.Topic) *api.TopicResponse
- func ToTrackedTime(ctx context.Context, t *issues_model.TrackedTime) (apiT *api.TrackedTime)
- func ToTrackedTimeList(ctx context.Context, tl issues_model.TrackedTimeList) api.TrackedTimeList
- func ToUser(ctx context.Context, user, doer *user_model.User) *api.User
- func ToUserAndPermission(ctx context.Context, user, doer *user_model.User, accessMode perm.AccessMode) api.RepoCollaboratorPermission
- func ToUserWithAccessMode(ctx context.Context, user *user_model.User, accessMode perm.AccessMode) *api.User
- func ToUsers(ctx context.Context, doer *user_model.User, users []*user_model.User) []*api.User
- func ToVerification(ctx context.Context, c *git.Commit) *api.PayloadCommitVerification
- func ToWikiCommit(commit *git.Commit) *api.WikiCommit
- func ToWikiCommitList(commits []*git.Commit, total int64) *api.WikiCommitList
- func ToWikiPageMetaData(wikiName wiki_service.WebPath, lastCommit *git.Commit, ...) *api.WikiPageMetaData
- func User2UserSettings(user *user_model.User) api.UserSettings
- func WebAssetDownloadURL(repo *repo_model.Repository, attach *repo_model.Attachment) string
- type ToCommitOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func APIAssetDownloadURL ¶ added in v1.20.0
func APIAssetDownloadURL(repo *repo_model.Repository, attach *repo_model.Attachment) string
func ToAPIAttachment ¶ added in v1.20.0
func ToAPIAttachment(repo *repo_model.Repository, a *repo_model.Attachment) *api.Attachment
ToAPIAttachment converts models.Attachment to api.Attachment for API usage
func ToAPIAttachments ¶ added in v1.20.0
func ToAPIAttachments(repo *repo_model.Repository, attachments []*repo_model.Attachment) []*api.Attachment
func ToAPIComment ¶ added in v1.20.0
func ToAPIComment(ctx context.Context, repo *repo_model.Repository, c *issues_model.Comment) *api.Comment
ToAPIComment converts a issues_model.Comment to the api.Comment format for API usage
func ToAPIIssue ¶
ToAPIIssue converts an Issue to API format it assumes some fields assigned with values: Required - Poster, Labels, Optional - Milestone, Assignee, PullRequest
func ToAPIIssueList ¶
ToAPIIssueList converts an IssueList to API format
func ToAPIMilestone ¶
func ToAPIMilestone(m *issues_model.Milestone) *api.Milestone
ToAPIMilestone converts Milestone into API Format
func ToAPIPullRequest ¶
func ToAPIPullRequest(ctx context.Context, pr *issues_model.PullRequest, doer *user_model.User) *api.PullRequest
ToAPIPullRequest assumes following fields have been assigned with valid values: Required - Issue Optional - Merger
func ToAPIRelease ¶ added in v1.20.0
func ToAPIRelease(ctx context.Context, repo *repo_model.Repository, r *repo_model.Release) *api.Release
ToAPIRelease convert a repo_model.Release to api.Release
func ToActivities ¶ added in v1.20.0
func ToActivities(ctx context.Context, al activities_model.ActionList, doer *user_model.User) []*api.Activity
func ToActivity ¶ added in v1.20.0
func ToActivity(ctx context.Context, ac *activities_model.Action, doer *user_model.User) *api.Activity
func ToAnnotatedTag ¶
func ToAnnotatedTag(ctx context.Context, repo *repo_model.Repository, t *git.Tag, c *git.Commit) *api.AnnotatedTag
ToAnnotatedTag convert git.Tag to api.AnnotatedTag
func ToAnnotatedTagObject ¶
func ToAnnotatedTagObject(repo *repo_model.Repository, commit *git.Commit) *api.AnnotatedTagObject
ToAnnotatedTagObject convert a git.Commit to an api.AnnotatedTagObject
func ToAttachment ¶
func ToAttachment(repo *repo_model.Repository, a *repo_model.Attachment) *api.Attachment
ToAttachment converts models.Attachment to api.Attachment for API usage
func ToBranch ¶
func ToBranch(ctx context.Context, repo *repo_model.Repository, branchName string, c *git.Commit, bp *git_model.ProtectedBranch, user *user_model.User, isRepoAdmin bool) (*api.Branch, error)
ToBranch convert a git.Commit and git.Branch to an api.Branch
func ToBranchProtection ¶
func ToBranchProtection(ctx context.Context, bp *git_model.ProtectedBranch) *api.BranchProtection
ToBranchProtection convert a ProtectedBranch to api.BranchProtection
func ToChangedFile ¶
func ToChangedFile(f *gitdiff.DiffFile, repo *repo_model.Repository, commit string) *api.ChangedFile
ToChangedFile convert a gitdiff.DiffFile to api.ChangedFile
func ToCombinedStatus ¶
func ToCombinedStatus(ctx context.Context, statuses []*git_model.CommitStatus, repo *api.Repository) *api.CombinedStatus
ToCombinedStatus converts List of CommitStatus to a CombinedStatus
func ToCommit ¶
func ToCommit(ctx context.Context, repo *repo_model.Repository, gitRepo *git.Repository, commit *git.Commit, userCache map[string]*user_model.User, opts ToCommitOptions) (*api.Commit, error)
ToCommit convert a git.Commit to api.Commit
func ToCommitMeta ¶
func ToCommitMeta(repo *repo_model.Repository, tag *git.Tag) *api.CommitMeta
ToCommitMeta convert a git.Tag to an api.CommitMeta
func ToCommitStatus ¶
func ToCommitStatus(ctx context.Context, status *git_model.CommitStatus) *api.CommitStatus
ToCommitStatus converts git_model.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 ¶
func ToDeployKey(apiLink string, key *asymkey_model.DeployKey) *api.DeployKey
ToDeployKey convert asymkey_model.DeployKey to api.DeployKey
func ToEmail ¶
func ToEmail(email *user_model.EmailAddress) *api.Email
ToEmail convert models.EmailAddress to api.Email
func ToEmailSearch ¶ added in v1.20.0
func ToEmailSearch(email *user_model.SearchEmailResult) *api.Email
ToEmail convert models.EmailAddress to api.Email
func ToGPGKey ¶
func ToGPGKey(key *asymkey_model.GPGKey) *api.GPGKey
ToGPGKey converts models.GPGKey to api.GPGKey
func ToGPGKeyEmail ¶
func ToGPGKeyEmail(email *user_model.EmailAddress) *api.GPGKeyEmail
ToGPGKeyEmail convert models.EmailAddress to api.GPGKeyEmail
func ToGitServiceType ¶
func ToGitServiceType(value string) structs.GitServiceType
ToGitServiceType return GitServiceType based on string
func ToIssueList ¶ added in v1.20.0
ToIssueList converts an IssueList to API format
func ToLabel ¶
func ToLabel(label *issues_model.Label, repo *repo_model.Repository, org *user_model.User) *api.Label
ToLabel converts Label to API format
func ToLabelList ¶
func ToLabelList(labels []*issues_model.Label, repo *repo_model.Repository, org *user_model.User) []*api.Label
ToLabelList converts list of Label to API format
func ToLabelTemplate ¶ added in v1.20.0
func ToLabelTemplate(label *label.Label) *api.LabelTemplate
ToLabelTemplate converts Label to API format
func ToLabelTemplateList ¶ added in v1.20.0
func ToLabelTemplateList(labels []*label.Label) []*api.LabelTemplate
ToLabelTemplateList converts list of Label to API format
func ToNotificationThread ¶
func ToNotificationThread(n *activities_model.Notification) *api.NotificationThread
ToNotificationThread convert a Notification to api.NotificationThread
func ToNotifications ¶
func ToNotifications(nl activities_model.NotificationList) []*api.NotificationThread
ToNotifications convert list of Notification to api.NotificationThread list
func ToOAuth2Application ¶
func ToOAuth2Application(app *auth.OAuth2Application) *api.OAuth2Application
ToOAuth2Application convert from auth.OAuth2Application to api.OAuth2Application
func ToOrganization ¶
func ToOrganization(ctx context.Context, org *organization.Organization) *api.Organization
ToOrganization convert user_model.User to api.Organization
func ToPackage ¶
func ToPackage(ctx context.Context, pd *packages.PackageDescriptor, doer *user_model.User) (*api.Package, error)
ToPackage convert a packages.PackageDescriptor to api.Package
func ToPackageFile ¶
func ToPackageFile(pfd *packages.PackageFileDescriptor) *api.PackageFile
ToPackageFile converts packages.PackageFileDescriptor to api.PackageFile
func ToPayloadCommit ¶
func ToPayloadCommit(ctx context.Context, repo *repo_model.Repository, c *git.Commit) *api.PayloadCommit
ToPayloadCommit convert a git.Commit to api.PayloadCommit
func ToPublicKey ¶
func ToPublicKey(apiLink string, key *asymkey_model.PublicKey) *api.PublicKey
ToPublicKey convert asymkey_model.PublicKey to api.PublicKey
func ToPullReview ¶
func ToPullReview(ctx context.Context, r *issues_model.Review, doer *user_model.User) (*api.PullReview, error)
ToPullReview convert a review to api format
func ToPullReviewCommentList ¶
func ToPullReviewCommentList(ctx context.Context, review *issues_model.Review, doer *user_model.User) ([]*api.PullReviewComment, error)
ToPullReviewCommentList convert the CodeComments of an review to it's api format
func ToPullReviewList ¶
func ToPullReviewList(ctx context.Context, rl []*issues_model.Review, doer *user_model.User) ([]*api.PullReview, error)
ToPullReviewList convert a list of review to it's api format
func ToPushMirror ¶
func ToPushMirror(pm *repo_model.PushMirror) (*api.PushMirror, error)
ToPushMirror convert from repo_model.PushMirror and remoteAddress to api.TopicResponse
func ToRepo ¶
func ToRepo(ctx context.Context, repo *repo_model.Repository, permissionInRepo access_model.Permission) *api.Repository
ToRepo converts a Repository to api.Repository
func ToRepoTransfer ¶
func ToRepoTransfer(ctx context.Context, t *models.RepoTransfer) *api.RepoTransfer
ToRepoTransfer convert a models.RepoTransfer to a structs.RepeTransfer
func ToSecret ¶ added in v1.21.0
func ToSecret(secret *secret_model.Secret) *api.Secret
ToSecret converts Secret to API format
func ToStopWatches ¶
func ToStopWatches(sws []*issues_model.Stopwatch) (api.StopWatches, error)
ToStopWatches convert Stopwatch list to api.StopWatches
func ToTag ¶
func ToTag(repo *repo_model.Repository, t *git.Tag) *api.Tag
ToTag convert a git.Tag to an api.Tag
func ToTimelineComment ¶
func ToTimelineComment(ctx context.Context, repo *repo_model.Repository, c *issues_model.Comment, doer *user_model.User) *api.TimelineComment
ToTimelineComment converts a issues_model.Comment to the api.TimelineComment format
func ToTopicResponse ¶
func ToTopicResponse(topic *repo_model.Topic) *api.TopicResponse
ToTopicResponse convert from models.Topic to api.TopicResponse
func ToTrackedTime ¶
func ToTrackedTime(ctx context.Context, t *issues_model.TrackedTime) (apiT *api.TrackedTime)
ToTrackedTime converts TrackedTime to API format
func ToTrackedTimeList ¶
func ToTrackedTimeList(ctx context.Context, tl issues_model.TrackedTimeList) api.TrackedTimeList
ToTrackedTimeList converts TrackedTimeList to API format
func ToUser ¶
ToUser convert user_model.User to api.User if doer is set, private information is added if the doer has the permission to see it
func ToUserAndPermission ¶
func ToUserAndPermission(ctx context.Context, user, doer *user_model.User, accessMode perm.AccessMode) api.RepoCollaboratorPermission
ToUserAndPermission return User and its collaboration permission for a repository
func ToUserWithAccessMode ¶
func ToUserWithAccessMode(ctx context.Context, user *user_model.User, accessMode perm.AccessMode) *api.User
ToUserWithAccessMode convert user_model.User to api.User AccessMode is not none show add some more information
func ToUsers ¶
func ToUsers(ctx context.Context, doer *user_model.User, users []*user_model.User) []*api.User
ToUsers convert list of user_model.User to list of api.User
func ToVerification ¶
ToVerification convert a git.Commit.Signature to an api.PayloadCommitVerification
func ToWikiCommit ¶
func ToWikiCommit(commit *git.Commit) *api.WikiCommit
ToWikiCommit convert a git commit into a WikiCommit
func ToWikiCommitList ¶
func ToWikiCommitList(commits []*git.Commit, total int64) *api.WikiCommitList
ToWikiCommitList convert a list of git commits into a WikiCommitList
func ToWikiPageMetaData ¶
func ToWikiPageMetaData(wikiName wiki_service.WebPath, lastCommit *git.Commit, repo *repo_model.Repository) *api.WikiPageMetaData
ToWikiPageMetaData converts meta information to a WikiPageMetaData
func User2UserSettings ¶
func User2UserSettings(user *user_model.User) api.UserSettings
User2UserSettings return UserSettings based on a user
func WebAssetDownloadURL ¶ added in v1.20.0
func WebAssetDownloadURL(repo *repo_model.Repository, attach *repo_model.Attachment) string
Types ¶
type ToCommitOptions ¶ added in v1.20.0
func ParseCommitOptions ¶ added in v1.20.0
func ParseCommitOptions(ctx *ctx.APIContext) ToCommitOptions