Monorepo for Tangled
at push-ntmmpnmptnvp 74 lines 3.2 kB view raw
1package notify 2 3import ( 4 "context" 5 6 "github.com/bluesky-social/indigo/atproto/syntax" 7 "tangled.org/core/appview/models" 8) 9 10type Notifier interface { 11 NewRepo(ctx context.Context, repo *models.Repo) 12 13 NewStar(ctx context.Context, star *models.Star) 14 DeleteStar(ctx context.Context, star *models.Star) 15 16 NewIssue(ctx context.Context, issue *models.Issue, mentions []syntax.DID) 17 NewIssueComment(ctx context.Context, comment *models.IssueComment, mentions []syntax.DID) 18 NewIssueState(ctx context.Context, actor syntax.DID, issue *models.Issue) 19 DeleteIssue(ctx context.Context, issue *models.Issue) 20 21 NewFollow(ctx context.Context, follow *models.Follow) 22 DeleteFollow(ctx context.Context, follow *models.Follow) 23 24 NewPull(ctx context.Context, pull *models.Pull) 25 NewPullComment(ctx context.Context, comment *models.PullComment, mentions []syntax.DID) 26 NewPullState(ctx context.Context, actor syntax.DID, pull *models.Pull) 27 28 NewIssueLabelOp(ctx context.Context, issue *models.Issue) 29 NewPullLabelOp(ctx context.Context, pull *models.Pull) 30 31 UpdateProfile(ctx context.Context, profile *models.Profile) 32 33 NewString(ctx context.Context, s *models.String) 34 EditString(ctx context.Context, s *models.String) 35 DeleteString(ctx context.Context, did, rkey string) 36 37 Push(ctx context.Context, repo *models.Repo, ref, oldSha, newSha, committerDid string) 38} 39 40// BaseNotifier is a listener that does nothing 41type BaseNotifier struct{} 42 43var _ Notifier = &BaseNotifier{} 44 45func (m *BaseNotifier) NewRepo(ctx context.Context, repo *models.Repo) {} 46 47func (m *BaseNotifier) NewStar(ctx context.Context, star *models.Star) {} 48func (m *BaseNotifier) DeleteStar(ctx context.Context, star *models.Star) {} 49 50func (m *BaseNotifier) NewIssue(ctx context.Context, issue *models.Issue, mentions []syntax.DID) {} 51func (m *BaseNotifier) NewIssueComment(ctx context.Context, comment *models.IssueComment, mentions []syntax.DID) { 52} 53func (m *BaseNotifier) NewIssueState(ctx context.Context, actor syntax.DID, issue *models.Issue) {} 54func (m *BaseNotifier) DeleteIssue(ctx context.Context, issue *models.Issue) {} 55 56func (m *BaseNotifier) NewIssueLabelOp(ctx context.Context, issue *models.Issue) {} 57func (m *BaseNotifier) NewPullLabelOp(ctx context.Context, pull *models.Pull) {} 58 59func (m *BaseNotifier) NewFollow(ctx context.Context, follow *models.Follow) {} 60func (m *BaseNotifier) DeleteFollow(ctx context.Context, follow *models.Follow) {} 61 62func (m *BaseNotifier) NewPull(ctx context.Context, pull *models.Pull) {} 63func (m *BaseNotifier) NewPullComment(ctx context.Context, models *models.PullComment, mentions []syntax.DID) { 64} 65func (m *BaseNotifier) NewPullState(ctx context.Context, actor syntax.DID, pull *models.Pull) {} 66 67func (m *BaseNotifier) UpdateProfile(ctx context.Context, profile *models.Profile) {} 68 69func (m *BaseNotifier) NewString(ctx context.Context, s *models.String) {} 70func (m *BaseNotifier) EditString(ctx context.Context, s *models.String) {} 71func (m *BaseNotifier) DeleteString(ctx context.Context, did, rkey string) {} 72 73func (m *BaseNotifier) Push(ctx context.Context, repo *models.Repo, ref, oldSha, newSha, committerDid string) { 74}