···5812 fieldCount--
5813 }
581400005815 if t.Source == nil {
5816 fieldCount--
5817 }
···5889 return err
5890 }
58915892- // t.Owner (string) (string)
5893- if len("owner") > 1000000 {
5894- return xerrors.Errorf("Value in field \"owner\" was too long")
5895- }
00000000058965897- if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("owner"))); err != nil {
5898- return err
5899- }
5900- if _, err := cw.WriteString(string("owner")); err != nil {
5901- return err
5902- }
0000059035904- if len(t.Owner) > 1000000 {
5905- return xerrors.Errorf("Value in field t.Owner was too long")
5906- }
00059075908- if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Owner))); err != nil {
5909- return err
5910- }
5911- if _, err := cw.WriteString(string(t.Owner)); err != nil {
5912- return err
5913 }
59145915 // t.Source (string) (string)
···61076108 t.LexiconTypeID = string(sval)
6109 }
6110- // t.Owner (string) (string)
6111- case "owner":
0000000000000000000000000061126113- {
6114- sval, err := cbg.ReadStringWithMax(cr, 1000000)
6115- if err != nil {
6116- return err
000006117 }
6118-6119- t.Owner = string(sval)
6120 }
6121 // t.Source (string) (string)
6122 case "source":
···5812 fieldCount--
5813 }
58145815+ if t.Labels == nil {
5816+ fieldCount--
5817+ }
5818+5819 if t.Source == nil {
5820 fieldCount--
5821 }
···5893 return err
5894 }
58955896+ // t.Labels ([]string) (slice)
5897+ if t.Labels != nil {
5898+5899+ if len("labels") > 1000000 {
5900+ return xerrors.Errorf("Value in field \"labels\" was too long")
5901+ }
5902+5903+ if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("labels"))); err != nil {
5904+ return err
5905+ }
5906+ if _, err := cw.WriteString(string("labels")); err != nil {
5907+ return err
5908+ }
59095910+ if len(t.Labels) > 8192 {
5911+ return xerrors.Errorf("Slice value in field t.Labels was too long")
5912+ }
5913+5914+ if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.Labels))); err != nil {
5915+ return err
5916+ }
5917+ for _, v := range t.Labels {
5918+ if len(v) > 1000000 {
5919+ return xerrors.Errorf("Value in field v was too long")
5920+ }
59215922+ if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(v))); err != nil {
5923+ return err
5924+ }
5925+ if _, err := cw.WriteString(string(v)); err != nil {
5926+ return err
5927+ }
59285929+ }
00005930 }
59315932 // t.Source (string) (string)
···61246125 t.LexiconTypeID = string(sval)
6126 }
6127+ // t.Labels ([]string) (slice)
6128+ case "labels":
6129+6130+ maj, extra, err = cr.ReadHeader()
6131+ if err != nil {
6132+ return err
6133+ }
6134+6135+ if extra > 8192 {
6136+ return fmt.Errorf("t.Labels: array too large (%d)", extra)
6137+ }
6138+6139+ if maj != cbg.MajArray {
6140+ return fmt.Errorf("expected cbor array")
6141+ }
6142+6143+ if extra > 0 {
6144+ t.Labels = make([]string, extra)
6145+ }
6146+6147+ for i := 0; i < int(extra); i++ {
6148+ {
6149+ var maj byte
6150+ var extra uint64
6151+ var err error
6152+ _ = maj
6153+ _ = extra
6154+ _ = err
61556156+ {
6157+ sval, err := cbg.ReadStringWithMax(cr, 1000000)
6158+ if err != nil {
6159+ return err
6160+ }
6161+6162+ t.Labels[i] = string(sval)
6163+ }
6164+6165 }
006166 }
6167 // t.Source (string) (string)
6168 case "source":
+3-2
api/tangled/tangledrepo.go
···22 Description *string `json:"description,omitempty" cborgen:"description,omitempty"`
23 // knot: knot where the repo was created
24 Knot string `json:"knot" cborgen:"knot"`
0025 // name: name of the repo
26- Name string `json:"name" cborgen:"name"`
27- Owner string `json:"owner" cborgen:"owner"`
28 // source: source of the repo
29 Source *string `json:"source,omitempty" cborgen:"source,omitempty"`
30 // spindle: CI runner to send jobs to and receive results from
···22 Description *string `json:"description,omitempty" cborgen:"description,omitempty"`
23 // knot: knot where the repo was created
24 Knot string `json:"knot" cborgen:"knot"`
25+ // labels: List of labels that this repo subscribes to
26+ Labels []string `json:"labels,omitempty" cborgen:"labels,omitempty"`
27 // name: name of the repo
28+ Name string `json:"name" cborgen:"name"`
029 // source: source of the repo
30 Source *string `json:"source,omitempty" cborgen:"source,omitempty"`
31 // spindle: CI runner to send jobs to and receive results from