gitea源码

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. // Copyright 2019 The Gitea Authors. All rights reserved.
  2. // SPDX-License-Identifier: MIT
  3. package notify
  4. import (
  5. "context"
  6. actions_model "code.gitea.io/gitea/models/actions"
  7. git_model "code.gitea.io/gitea/models/git"
  8. issues_model "code.gitea.io/gitea/models/issues"
  9. packages_model "code.gitea.io/gitea/models/packages"
  10. repo_model "code.gitea.io/gitea/models/repo"
  11. user_model "code.gitea.io/gitea/models/user"
  12. "code.gitea.io/gitea/modules/git"
  13. "code.gitea.io/gitea/modules/repository"
  14. )
  15. // NullNotifier implements a blank notifier
  16. type NullNotifier struct{}
  17. var _ Notifier = &NullNotifier{}
  18. // Run places a place holder function
  19. func (*NullNotifier) Run() {
  20. }
  21. // CreateIssueComment places a place holder function
  22. func (*NullNotifier) CreateIssueComment(ctx context.Context, doer *user_model.User, repo *repo_model.Repository,
  23. issue *issues_model.Issue, comment *issues_model.Comment, mentions []*user_model.User) {
  24. }
  25. // NewIssue places a place holder function
  26. func (*NullNotifier) NewIssue(ctx context.Context, issue *issues_model.Issue, mentions []*user_model.User) {
  27. }
  28. // IssueChangeStatus places a place holder function
  29. func (*NullNotifier) IssueChangeStatus(ctx context.Context, doer *user_model.User, commitID string, issue *issues_model.Issue, actionComment *issues_model.Comment, isClosed bool) {
  30. }
  31. // DeleteIssue notify when some issue deleted
  32. func (*NullNotifier) DeleteIssue(ctx context.Context, doer *user_model.User, issue *issues_model.Issue) {
  33. }
  34. // NewPullRequest places a place holder function
  35. func (*NullNotifier) NewPullRequest(ctx context.Context, pr *issues_model.PullRequest, mentions []*user_model.User) {
  36. }
  37. // PullRequestReview places a place holder function
  38. func (*NullNotifier) PullRequestReview(ctx context.Context, pr *issues_model.PullRequest, r *issues_model.Review, comment *issues_model.Comment, mentions []*user_model.User) {
  39. }
  40. // PullRequestCodeComment places a place holder function
  41. func (*NullNotifier) PullRequestCodeComment(ctx context.Context, pr *issues_model.PullRequest, comment *issues_model.Comment, mentions []*user_model.User) {
  42. }
  43. // MergePullRequest places a place holder function
  44. func (*NullNotifier) MergePullRequest(ctx context.Context, doer *user_model.User, pr *issues_model.PullRequest) {
  45. }
  46. // AutoMergePullRequest places a place holder function
  47. func (*NullNotifier) AutoMergePullRequest(ctx context.Context, doer *user_model.User, pr *issues_model.PullRequest) {
  48. }
  49. // PullRequestSynchronized places a place holder function
  50. func (*NullNotifier) PullRequestSynchronized(ctx context.Context, doer *user_model.User, pr *issues_model.PullRequest) {
  51. }
  52. // PullRequestChangeTargetBranch places a place holder function
  53. func (*NullNotifier) PullRequestChangeTargetBranch(ctx context.Context, doer *user_model.User, pr *issues_model.PullRequest, oldBranch string) {
  54. }
  55. // PullRequestPushCommits notifies when push commits to pull request's head branch
  56. func (*NullNotifier) PullRequestPushCommits(ctx context.Context, doer *user_model.User, pr *issues_model.PullRequest, comment *issues_model.Comment) {
  57. }
  58. // PullReviewDismiss notifies when a review was dismissed by repo admin
  59. func (*NullNotifier) PullReviewDismiss(ctx context.Context, doer *user_model.User, review *issues_model.Review, comment *issues_model.Comment) {
  60. }
  61. // UpdateComment places a place holder function
  62. func (*NullNotifier) UpdateComment(ctx context.Context, doer *user_model.User, c *issues_model.Comment, oldContent string) {
  63. }
  64. // DeleteComment places a place holder function
  65. func (*NullNotifier) DeleteComment(ctx context.Context, doer *user_model.User, c *issues_model.Comment) {
  66. }
  67. // NewWikiPage places a place holder function
  68. func (*NullNotifier) NewWikiPage(ctx context.Context, doer *user_model.User, repo *repo_model.Repository, page, comment string) {
  69. }
  70. // EditWikiPage places a place holder function
  71. func (*NullNotifier) EditWikiPage(ctx context.Context, doer *user_model.User, repo *repo_model.Repository, page, comment string) {
  72. }
  73. // DeleteWikiPage places a place holder function
  74. func (*NullNotifier) DeleteWikiPage(ctx context.Context, doer *user_model.User, repo *repo_model.Repository, page string) {
  75. }
  76. // NewRelease places a place holder function
  77. func (*NullNotifier) NewRelease(ctx context.Context, rel *repo_model.Release) {
  78. }
  79. // UpdateRelease places a place holder function
  80. func (*NullNotifier) UpdateRelease(ctx context.Context, doer *user_model.User, rel *repo_model.Release) {
  81. }
  82. // DeleteRelease places a place holder function
  83. func (*NullNotifier) DeleteRelease(ctx context.Context, doer *user_model.User, rel *repo_model.Release) {
  84. }
  85. // IssueChangeMilestone places a place holder function
  86. func (*NullNotifier) IssueChangeMilestone(ctx context.Context, doer *user_model.User, issue *issues_model.Issue, oldMilestoneID int64) {
  87. }
  88. // IssueChangeContent places a place holder function
  89. func (*NullNotifier) IssueChangeContent(ctx context.Context, doer *user_model.User, issue *issues_model.Issue, oldContent string) {
  90. }
  91. // IssueChangeAssignee places a place holder function
  92. func (*NullNotifier) IssueChangeAssignee(ctx context.Context, doer *user_model.User, issue *issues_model.Issue, assignee *user_model.User, removed bool, comment *issues_model.Comment) {
  93. }
  94. // PullRequestReviewRequest places a place holder function
  95. func (*NullNotifier) PullRequestReviewRequest(ctx context.Context, doer *user_model.User, issue *issues_model.Issue, reviewer *user_model.User, isRequest bool, comment *issues_model.Comment) {
  96. }
  97. // IssueClearLabels places a place holder function
  98. func (*NullNotifier) IssueClearLabels(ctx context.Context, doer *user_model.User, issue *issues_model.Issue) {
  99. }
  100. // IssueChangeTitle places a place holder function
  101. func (*NullNotifier) IssueChangeTitle(ctx context.Context, doer *user_model.User, issue *issues_model.Issue, oldTitle string) {
  102. }
  103. // IssueChangeRef places a place holder function
  104. func (*NullNotifier) IssueChangeRef(ctx context.Context, doer *user_model.User, issue *issues_model.Issue, oldTitle string) {
  105. }
  106. // IssueChangeLabels places a place holder function
  107. func (*NullNotifier) IssueChangeLabels(ctx context.Context, doer *user_model.User, issue *issues_model.Issue,
  108. addedLabels, removedLabels []*issues_model.Label) {
  109. }
  110. // CreateRepository places a place holder function
  111. func (*NullNotifier) CreateRepository(ctx context.Context, doer, u *user_model.User, repo *repo_model.Repository) {
  112. }
  113. // AdoptRepository places a place holder function
  114. func (*NullNotifier) AdoptRepository(ctx context.Context, doer, u *user_model.User, repo *repo_model.Repository) {
  115. }
  116. // DeleteRepository places a place holder function
  117. func (*NullNotifier) DeleteRepository(ctx context.Context, doer *user_model.User, repo *repo_model.Repository) {
  118. }
  119. // ForkRepository places a place holder function
  120. func (*NullNotifier) ForkRepository(ctx context.Context, doer *user_model.User, oldRepo, repo *repo_model.Repository) {
  121. }
  122. // MigrateRepository places a place holder function
  123. func (*NullNotifier) MigrateRepository(ctx context.Context, doer, u *user_model.User, repo *repo_model.Repository) {
  124. }
  125. // PushCommits notifies commits pushed to notifiers
  126. func (*NullNotifier) PushCommits(ctx context.Context, pusher *user_model.User, repo *repo_model.Repository, opts *repository.PushUpdateOptions, commits *repository.PushCommits) {
  127. }
  128. // CreateRef notifies branch or tag creation to notifiers
  129. func (*NullNotifier) CreateRef(ctx context.Context, doer *user_model.User, repo *repo_model.Repository, refFullName git.RefName, refID string) {
  130. }
  131. // DeleteRef notifies branch or tag deletion to notifiers
  132. func (*NullNotifier) DeleteRef(ctx context.Context, doer *user_model.User, repo *repo_model.Repository, refFullName git.RefName) {
  133. }
  134. // RenameRepository places a place holder function
  135. func (*NullNotifier) RenameRepository(ctx context.Context, doer *user_model.User, repo *repo_model.Repository, oldRepoName string) {
  136. }
  137. // TransferRepository places a place holder function
  138. func (*NullNotifier) TransferRepository(ctx context.Context, doer *user_model.User, repo *repo_model.Repository, oldOwnerName string) {
  139. }
  140. // SyncPushCommits places a place holder function
  141. func (*NullNotifier) SyncPushCommits(ctx context.Context, pusher *user_model.User, repo *repo_model.Repository, opts *repository.PushUpdateOptions, commits *repository.PushCommits) {
  142. }
  143. // SyncCreateRef places a place holder function
  144. func (*NullNotifier) SyncCreateRef(ctx context.Context, doer *user_model.User, repo *repo_model.Repository, refFullName git.RefName, refID string) {
  145. }
  146. // SyncDeleteRef places a place holder function
  147. func (*NullNotifier) SyncDeleteRef(ctx context.Context, doer *user_model.User, repo *repo_model.Repository, refFullName git.RefName) {
  148. }
  149. // RepoPendingTransfer places a place holder function
  150. func (*NullNotifier) RepoPendingTransfer(ctx context.Context, doer, newOwner *user_model.User, repo *repo_model.Repository) {
  151. }
  152. // PackageCreate places a place holder function
  153. func (*NullNotifier) PackageCreate(ctx context.Context, doer *user_model.User, pd *packages_model.PackageDescriptor) {
  154. }
  155. // PackageDelete places a place holder function
  156. func (*NullNotifier) PackageDelete(ctx context.Context, doer *user_model.User, pd *packages_model.PackageDescriptor) {
  157. }
  158. // ChangeDefaultBranch places a place holder function
  159. func (*NullNotifier) ChangeDefaultBranch(ctx context.Context, repo *repo_model.Repository) {
  160. }
  161. func (*NullNotifier) CreateCommitStatus(ctx context.Context, repo *repo_model.Repository, commit *repository.PushCommit, sender *user_model.User, status *git_model.CommitStatus) {
  162. }
  163. func (*NullNotifier) WorkflowRunStatusUpdate(ctx context.Context, repo *repo_model.Repository, sender *user_model.User, run *actions_model.ActionRun) {
  164. }
  165. func (*NullNotifier) WorkflowJobStatusUpdate(ctx context.Context, repo *repo_model.Repository, sender *user_model.User, job *actions_model.ActionRunJob, task *actions_model.ActionTask) {
  166. }