Monorepo for Tangled
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

at master 78 lines 3.3 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 Clone(ctx context.Context, repo *models.Repo) 40} 41 42// BaseNotifier is a listener that does nothing 43type BaseNotifier struct{} 44 45var _ Notifier = &BaseNotifier{} 46 47func (m *BaseNotifier) NewRepo(ctx context.Context, repo *models.Repo) {} 48 49func (m *BaseNotifier) NewStar(ctx context.Context, star *models.Star) {} 50func (m *BaseNotifier) DeleteStar(ctx context.Context, star *models.Star) {} 51 52func (m *BaseNotifier) NewIssue(ctx context.Context, issue *models.Issue, mentions []syntax.DID) {} 53func (m *BaseNotifier) NewIssueComment(ctx context.Context, comment *models.IssueComment, mentions []syntax.DID) { 54} 55func (m *BaseNotifier) NewIssueState(ctx context.Context, actor syntax.DID, issue *models.Issue) {} 56func (m *BaseNotifier) DeleteIssue(ctx context.Context, issue *models.Issue) {} 57 58func (m *BaseNotifier) NewIssueLabelOp(ctx context.Context, issue *models.Issue) {} 59func (m *BaseNotifier) NewPullLabelOp(ctx context.Context, pull *models.Pull) {} 60 61func (m *BaseNotifier) NewFollow(ctx context.Context, follow *models.Follow) {} 62func (m *BaseNotifier) DeleteFollow(ctx context.Context, follow *models.Follow) {} 63 64func (m *BaseNotifier) NewPull(ctx context.Context, pull *models.Pull) {} 65func (m *BaseNotifier) NewPullComment(ctx context.Context, models *models.PullComment, mentions []syntax.DID) { 66} 67func (m *BaseNotifier) NewPullState(ctx context.Context, actor syntax.DID, pull *models.Pull) {} 68 69func (m *BaseNotifier) UpdateProfile(ctx context.Context, profile *models.Profile) {} 70 71func (m *BaseNotifier) NewString(ctx context.Context, s *models.String) {} 72func (m *BaseNotifier) EditString(ctx context.Context, s *models.String) {} 73func (m *BaseNotifier) DeleteString(ctx context.Context, did, rkey string) {} 74 75func (m *BaseNotifier) Push(ctx context.Context, repo *models.Repo, ref, oldSha, newSha, committerDid string) { 76} 77 78func (m *BaseNotifier) Clone(ctx context.Context, repo *models.Repo) {}