Feed generator written in Golang
1package main
2
3type DatabasePost struct {
4 Uri string
5 Cid string
6 Topic string
7 IndexedAt string
8}
9
10type MessageFrameHeaderCBOR struct {
11 Op int64 `cbor:"op"`
12 Kind string `cbor:"t"`
13}
14
15type MessageFrameCommitCBOR struct {
16 Did string `cbor:"repo"`
17 Ops []struct {
18 Action string `cbor:"action"`
19 Path string `cbor:"path"`
20 RawCID []byte `cbor:"cid"`
21 } `cbor:"ops"`
22 Blocks []byte `cbor:"blocks"`
23 Blobs []byte `cbor:"blobs"`
24}
25
26type MessageFrameCBOR struct {
27 Header MessageFrameHeaderCBOR
28 Commit MessageFrameCommitCBOR
29}
30
31type BlockCBOR struct {
32 Text string `cbor:"text"`
33 Embed struct {
34 Kind string `cbor:"$type"`
35 Images []struct {
36 Alt string `cbor:"alt"`
37 Image struct {
38 Kind string `cbor:"$type"`
39 Ref []byte `cbor:"ref"`
40 // Ref struct {
41 // LinkRawCid []byte `cbor:"$link"`
42 // } `cbor:"ref"`
43 MimeType string `cbor:"mimeType"`
44 Size int `cbor:"size"`
45 } `cbor:"image"`
46 AspectRatio struct {
47 Width int
48 Height int
49 } `cbor:"aspectRatio"`
50 } `cbor:"images,omitempty"`
51 } `cbor:"embed,omitempty"`
52}
53
54type ComBskyFeedPost struct {
55 Did string
56 Kind string
57 Commit struct {
58 Rev string
59 Operation string
60 Collection string
61 Cid string
62 Record struct {
63 Type string `json:"$type"`
64 Text string
65 Reply struct {
66 Parent struct {
67 Cid string
68 Uri string
69 } `json:"parent,omitempty"`
70 Root struct {
71 Cid string
72 Uri string
73 } `json:"root,omitempty"`
74 } `json:"reply,omitempty"`
75 }
76 }
77}