an app.bsky.* indexer
1package main 2 3import ( 4 "context" 5 "errors" 6 "fmt" 7 "strconv" 8 9 comatproto "github.com/bluesky-social/indigo/api/atproto" 10 "github.com/bluesky-social/indigo/backfill" 11 "github.com/ipfs/go-cid" 12) 13 14func (b *Backend) RepoCommitHandler(ctx context.Context, evt *comatproto.SyncSubscribeRepos_Commit) error { 15 select { 16 case <-ctx.Done(): 17 return nil 18 default: 19 // 20 } 21 22 b.firehoseLk.Lock() 23 b.firehoseSeq = strconv.Itoa(int(evt.Seq)) 24 b.firehoseLk.Unlock() 25 26 job, err := b.bf.Store.GetJob(ctx, evt.Repo) 27 if job == nil { 28 if errors.Is(err, backfill.ErrJobNotFound) { 29 return nil 30 } else { 31 return fmt.Errorf("error getting job: %w", err) 32 } 33 } else { 34 return b.bf.HandleEvent(ctx, evt) 35 } 36} 37 38func handleCreate(ctx context.Context, repo, rev, path string, rec *[]byte, cid *cid.Cid) error { 39 return nil 40} 41 42func handleUpdate(ctx context.Context, repo, rev, path string, rec *[]byte, cid *cid.Cid) error { 43 return nil 44} 45 46func handleDelete(ctx context.Context, repo, rev, path string) error { 47 return nil 48}