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