You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

null.go 9.1KB

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