Live video on the AT Protocol
1package main
2
3import (
4 "reflect"
5
6 "github.com/bluesky-social/indigo/mst"
7 "stream.place/streamplace/pkg/streamplace"
8
9 cbg "github.com/whyrusleeping/cbor-gen"
10)
11
12func main() {
13 var typVals []any
14 for _, typ := range mst.CBORTypes() {
15 typVals = append(typVals, reflect.New(typ).Elem().Interface())
16 }
17
18 genCfg := cbg.Gen{
19 MaxStringLength: 1_000_000,
20 }
21
22 if err := genCfg.WriteMapEncodersToFile("pkg/streamplace/cbor_gen.go", "streamplace",
23 streamplace.Key{},
24 streamplace.Livestream{},
25 streamplace.Segment{},
26 streamplace.Segment_Audio{},
27 streamplace.Segment_Video{},
28 streamplace.Segment_Framerate{},
29 streamplace.ChatMessage{},
30 streamplace.RichtextFacet{},
31 streamplace.ChatProfile{},
32 streamplace.ChatProfile_Color{},
33 streamplace.ChatMessage_ReplyRef{},
34 ); err != nil {
35 panic(err)
36 }
37}