this repo has no description
1package indexer 2 3import ( 4 "context" 5 6 "tangled.org/core/appview/models" 7 "tangled.org/core/appview/notify" 8 "tangled.org/core/log" 9) 10 11var _ notify.Notifier = &Indexer{} 12 13func (ix *Indexer) NewIssue(ctx context.Context, issue *models.Issue) { 14 l := log.FromContext(ctx).With("notifier", "indexer", "issue", issue) 15 l.Debug("indexing new issue") 16 err := ix.Issues.Index(ctx, *issue) 17 if err != nil { 18 l.Error("failed to index an issue", "err", err) 19 } 20} 21 22func (ix *Indexer) NewIssueState(ctx context.Context, issue *models.Issue) { 23 l := log.FromContext(ctx).With("notifier", "indexer", "issue", issue) 24 l.Debug("updating an issue") 25 err := ix.Issues.Index(ctx, *issue) 26 if err != nil { 27 l.Error("failed to index an issue", "err", err) 28 } 29} 30 31func (ix *Indexer) DeleteIssue(ctx context.Context, issue *models.Issue) { 32 l := log.FromContext(ctx).With("notifier", "indexer", "issue", issue) 33 l.Debug("deleting an issue") 34 err := ix.Issues.Delete(ctx, issue.Id) 35 if err != nil { 36 l.Error("failed to delete an issue", "err", err) 37 } 38}