···11+// CBOR encoder generation for the lexgen'd api/community types.
22+// Mirrors indigo's gen tool (https://github.com/bluesky-social/indigo/blob/main/gen/main.go).
33+// Run via `just cborgen`.
44+package main
55+66+import (
77+ community "CommunityEventsICS/api/community"
88+99+ cbg "github.com/whyrusleeping/cbor-gen"
1010+)
1111+1212+func main() {
1313+ genCfg := cbg.Gen{
1414+ MaxStringLength: 1_000_000,
1515+ }
1616+1717+ // CalendarEvent_Locations_Elem is a union with hand-generated CBOR methods,
1818+ // so it is omitted here; we only generate encoders for the concrete structs
1919+ // it dispatches to.
2020+ if err := genCfg.WriteMapEncodersToFile("api/community/cbor_gen.go", "community",
2121+ community.CalendarEvent{},
2222+ community.CalendarEvent_Uri{},
2323+ community.CalendarRsvp{},
2424+ community.LocationAddress{},
2525+ community.LocationFsq{},
2626+ community.LocationGeo{},
2727+ community.LocationHthree{},
2828+ ); err != nil {
2929+ panic(err)
3030+ }
3131+}