forked from tangled.org/core
Monorepo for Tangled — https://tangled.org
1package notify 2 3import ( 4 "context" 5 6 "tangled.org/core/appview/db" 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 *db.Star) 14 DeleteStar(ctx context.Context, star *db.Star) 15 16 NewIssue(ctx context.Context, issue *models.Issue) 17 18 NewFollow(ctx context.Context, follow *models.Follow) 19 DeleteFollow(ctx context.Context, follow *models.Follow) 20 21 NewPull(ctx context.Context, pull *models.Pull) 22 NewPullComment(ctx context.Context, comment *models.PullComment) 23 24 UpdateProfile(ctx context.Context, profile *models.Profile) 25 26 NewString(ctx context.Context, s *db.String) 27 EditString(ctx context.Context, s *db.String) 28 DeleteString(ctx context.Context, did, rkey string) 29} 30 31// BaseNotifier is a listener that does nothing 32type BaseNotifier struct{} 33 34var _ Notifier = &BaseNotifier{} 35 36func (m *BaseNotifier) NewRepo(ctx context.Context, repo *models.Repo) {} 37 38func (m *BaseNotifier) NewStar(ctx context.Context, star *db.Star) {} 39func (m *BaseNotifier) DeleteStar(ctx context.Context, star *db.Star) {} 40 41func (m *BaseNotifier) NewIssue(ctx context.Context, issue *models.Issue) {} 42 43func (m *BaseNotifier) NewFollow(ctx context.Context, follow *models.Follow) {} 44func (m *BaseNotifier) DeleteFollow(ctx context.Context, follow *models.Follow) {} 45 46func (m *BaseNotifier) NewPull(ctx context.Context, pull *models.Pull) {} 47func (m *BaseNotifier) NewPullComment(ctx context.Context, models *models.PullComment) {} 48 49func (m *BaseNotifier) UpdateProfile(ctx context.Context, profile *models.Profile) {} 50 51func (m *BaseNotifier) NewString(ctx context.Context, s *db.String) {} 52func (m *BaseNotifier) EditString(ctx context.Context, s *db.String) {} 53func (m *BaseNotifier) DeleteString(ctx context.Context, did, rkey string) {}