Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

notifier.go 3.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. // Copyright 2018 The Gitea Authors. All rights reserved.
  2. // Use of this source code is governed by a MIT-style
  3. // license that can be found in the LICENSE file.
  4. package base
  5. import (
  6. "code.gitea.io/gitea/models"
  7. "code.gitea.io/gitea/modules/repository"
  8. )
  9. // Notifier defines an interface to notify receiver
  10. type Notifier interface {
  11. Run()
  12. NotifyCreateRepository(doer *models.User, u *models.User, repo *models.Repository)
  13. NotifyMigrateRepository(doer *models.User, u *models.User, repo *models.Repository)
  14. NotifyDeleteRepository(doer *models.User, repo *models.Repository)
  15. NotifyForkRepository(doer *models.User, oldRepo, repo *models.Repository)
  16. NotifyRenameRepository(doer *models.User, repo *models.Repository, oldRepoName string)
  17. NotifyTransferRepository(doer *models.User, repo *models.Repository, oldOwnerName string)
  18. NotifyNewIssue(*models.Issue)
  19. NotifyIssueChangeStatus(*models.User, *models.Issue, *models.Comment, bool)
  20. NotifyIssueChangeMilestone(doer *models.User, issue *models.Issue, oldMilestoneID int64)
  21. NotifyIssueChangeAssignee(doer *models.User, issue *models.Issue, assignee *models.User, removed bool, comment *models.Comment)
  22. NotifyPullReviewRequest(doer *models.User, issue *models.Issue, reviewer *models.User, isRequest bool, comment *models.Comment)
  23. NotifyIssueChangeContent(doer *models.User, issue *models.Issue, oldContent string)
  24. NotifyIssueClearLabels(doer *models.User, issue *models.Issue)
  25. NotifyIssueChangeTitle(doer *models.User, issue *models.Issue, oldTitle string)
  26. NotifyIssueChangeLabels(doer *models.User, issue *models.Issue,
  27. addedLabels []*models.Label, removedLabels []*models.Label)
  28. NotifyNewPullRequest(*models.PullRequest)
  29. NotifyMergePullRequest(*models.PullRequest, *models.User)
  30. NotifyPullRequestSynchronized(doer *models.User, pr *models.PullRequest)
  31. NotifyPullRequestReview(*models.PullRequest, *models.Review, *models.Comment)
  32. NotifyPullRequestChangeTargetBranch(doer *models.User, pr *models.PullRequest, oldBranch string)
  33. NotifyPullRequestPushCommits(doer *models.User, pr *models.PullRequest, comment *models.Comment)
  34. NotifyCreateIssueComment(*models.User, *models.Repository,
  35. *models.Issue, *models.Comment)
  36. NotifyUpdateComment(*models.User, *models.Comment, string)
  37. NotifyDeleteComment(*models.User, *models.Comment)
  38. NotifyNewRelease(rel *models.Release)
  39. NotifyUpdateRelease(doer *models.User, rel *models.Release)
  40. NotifyDeleteRelease(doer *models.User, rel *models.Release)
  41. NotifyPushCommits(pusher *models.User, repo *models.Repository, refName, oldCommitID, newCommitID string, commits *repository.PushCommits)
  42. NotifyCreateRef(doer *models.User, repo *models.Repository, refType, refFullName string)
  43. NotifyDeleteRef(doer *models.User, repo *models.Repository, refType, refFullName string)
  44. NotifySyncPushCommits(pusher *models.User, repo *models.Repository, refName, oldCommitID, newCommitID string, commits *repository.PushCommits)
  45. NotifySyncCreateRef(doer *models.User, repo *models.Repository, refType, refFullName string)
  46. NotifySyncDeleteRef(doer *models.User, repo *models.Repository, refType, refFullName string)
  47. }