an app.bsky.* indexer
1package main
2
3import (
4 "bytes"
5 "log/slog"
6
7 appbsky "github.com/bluesky-social/indigo/api/bsky"
8)
9
10type Account struct{}
11
12// func NewAccount
13
14type Profile struct {
15 ID uint `gorm:"primaryKey"`
16 AtUri string
17 DisplayName *string
18}
19
20func NewProfile(rec []byte) *Profile {
21 var out appbsky.ActorProfile
22 if err := out.UnmarshalCBOR(bytes.NewReader(rec)); err != nil {
23 slog.Error("could not unmarshal profile CBOR", "err", err)
24 return nil
25 }
26 return &Profile{
27 DisplayName: out.DisplayName,
28 }
29}
30
31type List struct{}
32
33// func NewList
34
35type Labeler struct{}
36
37// func NewFeedGenerator
38
39type FeedGenerator struct {
40 ID uint `gorm:"primaryKey"`
41 AtUri string
42 DisplayName string
43}
44
45func NewFeedGenerator(rec []byte) *FeedGenerator {
46 var out appbsky.FeedGenerator
47 if err := out.UnmarshalCBOR(bytes.NewReader(rec)); err != nil {
48 slog.Error("could not unmarshal feedgen CBOR", "err", err)
49 return nil
50 }
51 return &FeedGenerator{
52 DisplayName: out.DisplayName,
53 }
54}
55
56type Post struct {
57 ID uint `gorm:"primaryKey"`
58 AtUri string
59 Text string
60}
61
62func NewPost(rec []byte) *Post {
63 return nil
64}
65
66type Like struct{}
67
68// func NewLike
69
70type StarterPack struct{}
71
72// func NewStarterPack
73
74type Verification struct{}
75
76// func NewVerification
77
78type Lexicon struct{}
79
80// func NewLexicon