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 b.firehoseLk.Lock()
16 b.firehoseSeq = strconv.Itoa(int(evt.Seq))
17 b.firehoseLk.Unlock()
18
19 job, err := b.bf.Store.GetJob(ctx, evt.Repo)
20 if job == nil {
21 if errors.Is(err, backfill.ErrJobNotFound) {
22 return nil
23 } else {
24 return fmt.Errorf("error getting job: %w", err)
25 }
26 } else {
27 return b.bf.HandleEvent(ctx, evt)
28 }
29}
30
31func handleCreate(ctx context.Context, repo, rev, path string, rec *[]byte, cid *cid.Cid) error {
32 return nil
33}
34
35func handleUpdate(ctx context.Context, repo, rev, path string, rec *[]byte, cid *cid.Cid) error {
36 return nil
37}
38
39func handleDelete(ctx context.Context, repo, rev, path string) error {
40 return nil
41}