1// Code generated by github.com/whyrusleeping/cbor-gen. DO NOT EDIT.
2
3package tangled
4
5import (
6 "fmt"
7 "io"
8 "math"
9 "sort"
10
11 cid "github.com/ipfs/go-cid"
12 cbg "github.com/whyrusleeping/cbor-gen"
13 xerrors "golang.org/x/xerrors"
14)
15
16var _ = xerrors.Errorf
17var _ = cid.Undef
18var _ = math.E
19var _ = sort.Sort
20
21func (t *PublicKey) MarshalCBOR(w io.Writer) error {
22 if t == nil {
23 _, err := w.Write(cbg.CborNull)
24 return err
25 }
26
27 cw := cbg.NewCborWriter(w)
28
29 if _, err := cw.Write([]byte{164}); err != nil {
30 return err
31 }
32
33 // t.Key (string) (string)
34 if len("key") > 1000000 {
35 return xerrors.Errorf("Value in field \"key\" was too long")
36 }
37
38 if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("key"))); err != nil {
39 return err
40 }
41 if _, err := cw.WriteString(string("key")); err != nil {
42 return err
43 }
44
45 if len(t.Key) > 1000000 {
46 return xerrors.Errorf("Value in field t.Key was too long")
47 }
48
49 if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Key))); err != nil {
50 return err
51 }
52 if _, err := cw.WriteString(string(t.Key)); err != nil {
53 return err
54 }
55
56 // t.Name (string) (string)
57 if len("name") > 1000000 {
58 return xerrors.Errorf("Value in field \"name\" was too long")
59 }
60
61 if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("name"))); err != nil {
62 return err
63 }
64 if _, err := cw.WriteString(string("name")); err != nil {
65 return err
66 }
67
68 if len(t.Name) > 1000000 {
69 return xerrors.Errorf("Value in field t.Name was too long")
70 }
71
72 if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Name))); err != nil {
73 return err
74 }
75 if _, err := cw.WriteString(string(t.Name)); err != nil {
76 return err
77 }
78
79 // t.LexiconTypeID (string) (string)
80 if len("$type") > 1000000 {
81 return xerrors.Errorf("Value in field \"$type\" was too long")
82 }
83
84 if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("$type"))); err != nil {
85 return err
86 }
87 if _, err := cw.WriteString(string("$type")); err != nil {
88 return err
89 }
90
91 if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("sh.tangled.publicKey"))); err != nil {
92 return err
93 }
94 if _, err := cw.WriteString(string("sh.tangled.publicKey")); err != nil {
95 return err
96 }
97
98 // t.Created (string) (string)
99 if len("created") > 1000000 {
100 return xerrors.Errorf("Value in field \"created\" was too long")
101 }
102
103 if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("created"))); err != nil {
104 return err
105 }
106 if _, err := cw.WriteString(string("created")); err != nil {
107 return err
108 }
109
110 if len(t.Created) > 1000000 {
111 return xerrors.Errorf("Value in field t.Created was too long")
112 }
113
114 if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Created))); err != nil {
115 return err
116 }
117 if _, err := cw.WriteString(string(t.Created)); err != nil {
118 return err
119 }
120 return nil
121}
122
123func (t *PublicKey) UnmarshalCBOR(r io.Reader) (err error) {
124 *t = PublicKey{}
125
126 cr := cbg.NewCborReader(r)
127
128 maj, extra, err := cr.ReadHeader()
129 if err != nil {
130 return err
131 }
132 defer func() {
133 if err == io.EOF {
134 err = io.ErrUnexpectedEOF
135 }
136 }()
137
138 if maj != cbg.MajMap {
139 return fmt.Errorf("cbor input should be of type map")
140 }
141
142 if extra > cbg.MaxLength {
143 return fmt.Errorf("PublicKey: map struct too large (%d)", extra)
144 }
145
146 n := extra
147
148 nameBuf := make([]byte, 7)
149 for i := uint64(0); i < n; i++ {
150 nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000)
151 if err != nil {
152 return err
153 }
154
155 if !ok {
156 // Field doesn't exist on this type, so ignore it
157 if err := cbg.ScanForLinks(cr, func(cid.Cid) {}); err != nil {
158 return err
159 }
160 continue
161 }
162
163 switch string(nameBuf[:nameLen]) {
164 // t.Key (string) (string)
165 case "key":
166
167 {
168 sval, err := cbg.ReadStringWithMax(cr, 1000000)
169 if err != nil {
170 return err
171 }
172
173 t.Key = string(sval)
174 }
175 // t.Name (string) (string)
176 case "name":
177
178 {
179 sval, err := cbg.ReadStringWithMax(cr, 1000000)
180 if err != nil {
181 return err
182 }
183
184 t.Name = string(sval)
185 }
186 // t.LexiconTypeID (string) (string)
187 case "$type":
188
189 {
190 sval, err := cbg.ReadStringWithMax(cr, 1000000)
191 if err != nil {
192 return err
193 }
194
195 t.LexiconTypeID = string(sval)
196 }
197 // t.Created (string) (string)
198 case "created":
199
200 {
201 sval, err := cbg.ReadStringWithMax(cr, 1000000)
202 if err != nil {
203 return err
204 }
205
206 t.Created = string(sval)
207 }
208
209 default:
210 // Field doesn't exist on this type, so ignore it
211 if err := cbg.ScanForLinks(r, func(cid.Cid) {}); err != nil {
212 return err
213 }
214 }
215 }
216
217 return nil
218}
219func (t *KnotMember) MarshalCBOR(w io.Writer) error {
220 if t == nil {
221 _, err := w.Write(cbg.CborNull)
222 return err
223 }
224
225 cw := cbg.NewCborWriter(w)
226 fieldCount := 4
227
228 if t.AddedAt == nil {
229 fieldCount--
230 }
231
232 if _, err := cw.Write(cbg.CborEncodeMajorType(cbg.MajMap, uint64(fieldCount))); err != nil {
233 return err
234 }
235
236 // t.LexiconTypeID (string) (string)
237 if len("$type") > 1000000 {
238 return xerrors.Errorf("Value in field \"$type\" was too long")
239 }
240
241 if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("$type"))); err != nil {
242 return err
243 }
244 if _, err := cw.WriteString(string("$type")); err != nil {
245 return err
246 }
247
248 if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("sh.tangled.knot.member"))); err != nil {
249 return err
250 }
251 if _, err := cw.WriteString(string("sh.tangled.knot.member")); err != nil {
252 return err
253 }
254
255 // t.Domain (string) (string)
256 if len("domain") > 1000000 {
257 return xerrors.Errorf("Value in field \"domain\" was too long")
258 }
259
260 if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("domain"))); err != nil {
261 return err
262 }
263 if _, err := cw.WriteString(string("domain")); err != nil {
264 return err
265 }
266
267 if len(t.Domain) > 1000000 {
268 return xerrors.Errorf("Value in field t.Domain was too long")
269 }
270
271 if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Domain))); err != nil {
272 return err
273 }
274 if _, err := cw.WriteString(string(t.Domain)); err != nil {
275 return err
276 }
277
278 // t.Member (string) (string)
279 if len("member") > 1000000 {
280 return xerrors.Errorf("Value in field \"member\" was too long")
281 }
282
283 if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("member"))); err != nil {
284 return err
285 }
286 if _, err := cw.WriteString(string("member")); err != nil {
287 return err
288 }
289
290 if len(t.Member) > 1000000 {
291 return xerrors.Errorf("Value in field t.Member was too long")
292 }
293
294 if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Member))); err != nil {
295 return err
296 }
297 if _, err := cw.WriteString(string(t.Member)); err != nil {
298 return err
299 }
300
301 // t.AddedAt (string) (string)
302 if t.AddedAt != nil {
303
304 if len("addedAt") > 1000000 {
305 return xerrors.Errorf("Value in field \"addedAt\" was too long")
306 }
307
308 if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("addedAt"))); err != nil {
309 return err
310 }
311 if _, err := cw.WriteString(string("addedAt")); err != nil {
312 return err
313 }
314
315 if t.AddedAt == nil {
316 if _, err := cw.Write(cbg.CborNull); err != nil {
317 return err
318 }
319 } else {
320 if len(*t.AddedAt) > 1000000 {
321 return xerrors.Errorf("Value in field t.AddedAt was too long")
322 }
323
324 if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.AddedAt))); err != nil {
325 return err
326 }
327 if _, err := cw.WriteString(string(*t.AddedAt)); err != nil {
328 return err
329 }
330 }
331 }
332 return nil
333}
334
335func (t *KnotMember) UnmarshalCBOR(r io.Reader) (err error) {
336 *t = KnotMember{}
337
338 cr := cbg.NewCborReader(r)
339
340 maj, extra, err := cr.ReadHeader()
341 if err != nil {
342 return err
343 }
344 defer func() {
345 if err == io.EOF {
346 err = io.ErrUnexpectedEOF
347 }
348 }()
349
350 if maj != cbg.MajMap {
351 return fmt.Errorf("cbor input should be of type map")
352 }
353
354 if extra > cbg.MaxLength {
355 return fmt.Errorf("KnotMember: map struct too large (%d)", extra)
356 }
357
358 n := extra
359
360 nameBuf := make([]byte, 7)
361 for i := uint64(0); i < n; i++ {
362 nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000)
363 if err != nil {
364 return err
365 }
366
367 if !ok {
368 // Field doesn't exist on this type, so ignore it
369 if err := cbg.ScanForLinks(cr, func(cid.Cid) {}); err != nil {
370 return err
371 }
372 continue
373 }
374
375 switch string(nameBuf[:nameLen]) {
376 // t.LexiconTypeID (string) (string)
377 case "$type":
378
379 {
380 sval, err := cbg.ReadStringWithMax(cr, 1000000)
381 if err != nil {
382 return err
383 }
384
385 t.LexiconTypeID = string(sval)
386 }
387 // t.Domain (string) (string)
388 case "domain":
389
390 {
391 sval, err := cbg.ReadStringWithMax(cr, 1000000)
392 if err != nil {
393 return err
394 }
395
396 t.Domain = string(sval)
397 }
398 // t.Member (string) (string)
399 case "member":
400
401 {
402 sval, err := cbg.ReadStringWithMax(cr, 1000000)
403 if err != nil {
404 return err
405 }
406
407 t.Member = string(sval)
408 }
409 // t.AddedAt (string) (string)
410 case "addedAt":
411
412 {
413 b, err := cr.ReadByte()
414 if err != nil {
415 return err
416 }
417 if b != cbg.CborNull[0] {
418 if err := cr.UnreadByte(); err != nil {
419 return err
420 }
421
422 sval, err := cbg.ReadStringWithMax(cr, 1000000)
423 if err != nil {
424 return err
425 }
426
427 t.AddedAt = (*string)(&sval)
428 }
429 }
430
431 default:
432 // Field doesn't exist on this type, so ignore it
433 if err := cbg.ScanForLinks(r, func(cid.Cid) {}); err != nil {
434 return err
435 }
436 }
437 }
438
439 return nil
440}
441func (t *GraphFollow) MarshalCBOR(w io.Writer) error {
442 if t == nil {
443 _, err := w.Write(cbg.CborNull)
444 return err
445 }
446
447 cw := cbg.NewCborWriter(w)
448
449 if _, err := cw.Write([]byte{163}); err != nil {
450 return err
451 }
452
453 // t.LexiconTypeID (string) (string)
454 if len("$type") > 1000000 {
455 return xerrors.Errorf("Value in field \"$type\" was too long")
456 }
457
458 if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("$type"))); err != nil {
459 return err
460 }
461 if _, err := cw.WriteString(string("$type")); err != nil {
462 return err
463 }
464
465 if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("sh.tangled.graph.follow"))); err != nil {
466 return err
467 }
468 if _, err := cw.WriteString(string("sh.tangled.graph.follow")); err != nil {
469 return err
470 }
471
472 // t.Subject (string) (string)
473 if len("subject") > 1000000 {
474 return xerrors.Errorf("Value in field \"subject\" was too long")
475 }
476
477 if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("subject"))); err != nil {
478 return err
479 }
480 if _, err := cw.WriteString(string("subject")); err != nil {
481 return err
482 }
483
484 if len(t.Subject) > 1000000 {
485 return xerrors.Errorf("Value in field t.Subject was too long")
486 }
487
488 if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Subject))); err != nil {
489 return err
490 }
491 if _, err := cw.WriteString(string(t.Subject)); err != nil {
492 return err
493 }
494
495 // t.CreatedAt (string) (string)
496 if len("createdAt") > 1000000 {
497 return xerrors.Errorf("Value in field \"createdAt\" was too long")
498 }
499
500 if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("createdAt"))); err != nil {
501 return err
502 }
503 if _, err := cw.WriteString(string("createdAt")); err != nil {
504 return err
505 }
506
507 if len(t.CreatedAt) > 1000000 {
508 return xerrors.Errorf("Value in field t.CreatedAt was too long")
509 }
510
511 if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.CreatedAt))); err != nil {
512 return err
513 }
514 if _, err := cw.WriteString(string(t.CreatedAt)); err != nil {
515 return err
516 }
517 return nil
518}
519
520func (t *GraphFollow) UnmarshalCBOR(r io.Reader) (err error) {
521 *t = GraphFollow{}
522
523 cr := cbg.NewCborReader(r)
524
525 maj, extra, err := cr.ReadHeader()
526 if err != nil {
527 return err
528 }
529 defer func() {
530 if err == io.EOF {
531 err = io.ErrUnexpectedEOF
532 }
533 }()
534
535 if maj != cbg.MajMap {
536 return fmt.Errorf("cbor input should be of type map")
537 }
538
539 if extra > cbg.MaxLength {
540 return fmt.Errorf("GraphFollow: map struct too large (%d)", extra)
541 }
542
543 n := extra
544
545 nameBuf := make([]byte, 9)
546 for i := uint64(0); i < n; i++ {
547 nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000)
548 if err != nil {
549 return err
550 }
551
552 if !ok {
553 // Field doesn't exist on this type, so ignore it
554 if err := cbg.ScanForLinks(cr, func(cid.Cid) {}); err != nil {
555 return err
556 }
557 continue
558 }
559
560 switch string(nameBuf[:nameLen]) {
561 // t.LexiconTypeID (string) (string)
562 case "$type":
563
564 {
565 sval, err := cbg.ReadStringWithMax(cr, 1000000)
566 if err != nil {
567 return err
568 }
569
570 t.LexiconTypeID = string(sval)
571 }
572 // t.Subject (string) (string)
573 case "subject":
574
575 {
576 sval, err := cbg.ReadStringWithMax(cr, 1000000)
577 if err != nil {
578 return err
579 }
580
581 t.Subject = string(sval)
582 }
583 // t.CreatedAt (string) (string)
584 case "createdAt":
585
586 {
587 sval, err := cbg.ReadStringWithMax(cr, 1000000)
588 if err != nil {
589 return err
590 }
591
592 t.CreatedAt = string(sval)
593 }
594
595 default:
596 // Field doesn't exist on this type, so ignore it
597 if err := cbg.ScanForLinks(r, func(cid.Cid) {}); err != nil {
598 return err
599 }
600 }
601 }
602
603 return nil
604}
605func (t *Repo) MarshalCBOR(w io.Writer) error {
606 if t == nil {
607 _, err := w.Write(cbg.CborNull)
608 return err
609 }
610
611 cw := cbg.NewCborWriter(w)
612 fieldCount := 5
613
614 if t.AddedAt == nil {
615 fieldCount--
616 }
617
618 if _, err := cw.Write(cbg.CborEncodeMajorType(cbg.MajMap, uint64(fieldCount))); err != nil {
619 return err
620 }
621
622 // t.Knot (string) (string)
623 if len("knot") > 1000000 {
624 return xerrors.Errorf("Value in field \"knot\" was too long")
625 }
626
627 if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("knot"))); err != nil {
628 return err
629 }
630 if _, err := cw.WriteString(string("knot")); err != nil {
631 return err
632 }
633
634 if len(t.Knot) > 1000000 {
635 return xerrors.Errorf("Value in field t.Knot was too long")
636 }
637
638 if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Knot))); err != nil {
639 return err
640 }
641 if _, err := cw.WriteString(string(t.Knot)); err != nil {
642 return err
643 }
644
645 // t.Name (string) (string)
646 if len("name") > 1000000 {
647 return xerrors.Errorf("Value in field \"name\" was too long")
648 }
649
650 if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("name"))); err != nil {
651 return err
652 }
653 if _, err := cw.WriteString(string("name")); err != nil {
654 return err
655 }
656
657 if len(t.Name) > 1000000 {
658 return xerrors.Errorf("Value in field t.Name was too long")
659 }
660
661 if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Name))); err != nil {
662 return err
663 }
664 if _, err := cw.WriteString(string(t.Name)); err != nil {
665 return err
666 }
667
668 // t.LexiconTypeID (string) (string)
669 if len("$type") > 1000000 {
670 return xerrors.Errorf("Value in field \"$type\" was too long")
671 }
672
673 if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("$type"))); err != nil {
674 return err
675 }
676 if _, err := cw.WriteString(string("$type")); err != nil {
677 return err
678 }
679
680 if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("sh.tangled.repo"))); err != nil {
681 return err
682 }
683 if _, err := cw.WriteString(string("sh.tangled.repo")); err != nil {
684 return err
685 }
686
687 // t.Owner (string) (string)
688 if len("owner") > 1000000 {
689 return xerrors.Errorf("Value in field \"owner\" was too long")
690 }
691
692 if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("owner"))); err != nil {
693 return err
694 }
695 if _, err := cw.WriteString(string("owner")); err != nil {
696 return err
697 }
698
699 if len(t.Owner) > 1000000 {
700 return xerrors.Errorf("Value in field t.Owner was too long")
701 }
702
703 if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Owner))); err != nil {
704 return err
705 }
706 if _, err := cw.WriteString(string(t.Owner)); err != nil {
707 return err
708 }
709
710 // t.AddedAt (string) (string)
711 if t.AddedAt != nil {
712
713 if len("addedAt") > 1000000 {
714 return xerrors.Errorf("Value in field \"addedAt\" was too long")
715 }
716
717 if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("addedAt"))); err != nil {
718 return err
719 }
720 if _, err := cw.WriteString(string("addedAt")); err != nil {
721 return err
722 }
723
724 if t.AddedAt == nil {
725 if _, err := cw.Write(cbg.CborNull); err != nil {
726 return err
727 }
728 } else {
729 if len(*t.AddedAt) > 1000000 {
730 return xerrors.Errorf("Value in field t.AddedAt was too long")
731 }
732
733 if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.AddedAt))); err != nil {
734 return err
735 }
736 if _, err := cw.WriteString(string(*t.AddedAt)); err != nil {
737 return err
738 }
739 }
740 }
741 return nil
742}
743
744func (t *Repo) UnmarshalCBOR(r io.Reader) (err error) {
745 *t = Repo{}
746
747 cr := cbg.NewCborReader(r)
748
749 maj, extra, err := cr.ReadHeader()
750 if err != nil {
751 return err
752 }
753 defer func() {
754 if err == io.EOF {
755 err = io.ErrUnexpectedEOF
756 }
757 }()
758
759 if maj != cbg.MajMap {
760 return fmt.Errorf("cbor input should be of type map")
761 }
762
763 if extra > cbg.MaxLength {
764 return fmt.Errorf("Repo: map struct too large (%d)", extra)
765 }
766
767 n := extra
768
769 nameBuf := make([]byte, 7)
770 for i := uint64(0); i < n; i++ {
771 nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000)
772 if err != nil {
773 return err
774 }
775
776 if !ok {
777 // Field doesn't exist on this type, so ignore it
778 if err := cbg.ScanForLinks(cr, func(cid.Cid) {}); err != nil {
779 return err
780 }
781 continue
782 }
783
784 switch string(nameBuf[:nameLen]) {
785 // t.Knot (string) (string)
786 case "knot":
787
788 {
789 sval, err := cbg.ReadStringWithMax(cr, 1000000)
790 if err != nil {
791 return err
792 }
793
794 t.Knot = string(sval)
795 }
796 // t.Name (string) (string)
797 case "name":
798
799 {
800 sval, err := cbg.ReadStringWithMax(cr, 1000000)
801 if err != nil {
802 return err
803 }
804
805 t.Name = string(sval)
806 }
807 // t.LexiconTypeID (string) (string)
808 case "$type":
809
810 {
811 sval, err := cbg.ReadStringWithMax(cr, 1000000)
812 if err != nil {
813 return err
814 }
815
816 t.LexiconTypeID = string(sval)
817 }
818 // t.Owner (string) (string)
819 case "owner":
820
821 {
822 sval, err := cbg.ReadStringWithMax(cr, 1000000)
823 if err != nil {
824 return err
825 }
826
827 t.Owner = string(sval)
828 }
829 // t.AddedAt (string) (string)
830 case "addedAt":
831
832 {
833 b, err := cr.ReadByte()
834 if err != nil {
835 return err
836 }
837 if b != cbg.CborNull[0] {
838 if err := cr.UnreadByte(); err != nil {
839 return err
840 }
841
842 sval, err := cbg.ReadStringWithMax(cr, 1000000)
843 if err != nil {
844 return err
845 }
846
847 t.AddedAt = (*string)(&sval)
848 }
849 }
850
851 default:
852 // Field doesn't exist on this type, so ignore it
853 if err := cbg.ScanForLinks(r, func(cid.Cid) {}); err != nil {
854 return err
855 }
856 }
857 }
858
859 return nil
860}
861func (t *RepoIssue) MarshalCBOR(w io.Writer) error {
862 if t == nil {
863 _, err := w.Write(cbg.CborNull)
864 return err
865 }
866
867 cw := cbg.NewCborWriter(w)
868 fieldCount := 7
869
870 if t.Body == nil {
871 fieldCount--
872 }
873
874 if t.CreatedAt == nil {
875 fieldCount--
876 }
877
878 if _, err := cw.Write(cbg.CborEncodeMajorType(cbg.MajMap, uint64(fieldCount))); err != nil {
879 return err
880 }
881
882 // t.Body (string) (string)
883 if t.Body != nil {
884
885 if len("body") > 1000000 {
886 return xerrors.Errorf("Value in field \"body\" was too long")
887 }
888
889 if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("body"))); err != nil {
890 return err
891 }
892 if _, err := cw.WriteString(string("body")); err != nil {
893 return err
894 }
895
896 if t.Body == nil {
897 if _, err := cw.Write(cbg.CborNull); err != nil {
898 return err
899 }
900 } else {
901 if len(*t.Body) > 1000000 {
902 return xerrors.Errorf("Value in field t.Body was too long")
903 }
904
905 if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Body))); err != nil {
906 return err
907 }
908 if _, err := cw.WriteString(string(*t.Body)); err != nil {
909 return err
910 }
911 }
912 }
913
914 // t.Repo (string) (string)
915 if len("repo") > 1000000 {
916 return xerrors.Errorf("Value in field \"repo\" was too long")
917 }
918
919 if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("repo"))); err != nil {
920 return err
921 }
922 if _, err := cw.WriteString(string("repo")); err != nil {
923 return err
924 }
925
926 if len(t.Repo) > 1000000 {
927 return xerrors.Errorf("Value in field t.Repo was too long")
928 }
929
930 if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Repo))); err != nil {
931 return err
932 }
933 if _, err := cw.WriteString(string(t.Repo)); err != nil {
934 return err
935 }
936
937 // t.LexiconTypeID (string) (string)
938 if len("$type") > 1000000 {
939 return xerrors.Errorf("Value in field \"$type\" was too long")
940 }
941
942 if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("$type"))); err != nil {
943 return err
944 }
945 if _, err := cw.WriteString(string("$type")); err != nil {
946 return err
947 }
948
949 if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("sh.tangled.repo.issue"))); err != nil {
950 return err
951 }
952 if _, err := cw.WriteString(string("sh.tangled.repo.issue")); err != nil {
953 return err
954 }
955
956 // t.Owner (string) (string)
957 if len("owner") > 1000000 {
958 return xerrors.Errorf("Value in field \"owner\" was too long")
959 }
960
961 if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("owner"))); err != nil {
962 return err
963 }
964 if _, err := cw.WriteString(string("owner")); err != nil {
965 return err
966 }
967
968 if len(t.Owner) > 1000000 {
969 return xerrors.Errorf("Value in field t.Owner was too long")
970 }
971
972 if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Owner))); err != nil {
973 return err
974 }
975 if _, err := cw.WriteString(string(t.Owner)); err != nil {
976 return err
977 }
978
979 // t.Title (string) (string)
980 if len("title") > 1000000 {
981 return xerrors.Errorf("Value in field \"title\" was too long")
982 }
983
984 if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("title"))); err != nil {
985 return err
986 }
987 if _, err := cw.WriteString(string("title")); err != nil {
988 return err
989 }
990
991 if len(t.Title) > 1000000 {
992 return xerrors.Errorf("Value in field t.Title was too long")
993 }
994
995 if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Title))); err != nil {
996 return err
997 }
998 if _, err := cw.WriteString(string(t.Title)); err != nil {
999 return err
1000 }
1001
1002 // t.IssueId (int64) (int64)
1003 if len("issueId") > 1000000 {
1004 return xerrors.Errorf("Value in field \"issueId\" was too long")
1005 }
1006
1007 if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("issueId"))); err != nil {
1008 return err
1009 }
1010 if _, err := cw.WriteString(string("issueId")); err != nil {
1011 return err
1012 }
1013
1014 if t.IssueId >= 0 {
1015 if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.IssueId)); err != nil {
1016 return err
1017 }
1018 } else {
1019 if err := cw.WriteMajorTypeHeader(cbg.MajNegativeInt, uint64(-t.IssueId-1)); err != nil {
1020 return err
1021 }
1022 }
1023
1024 // t.CreatedAt (string) (string)
1025 if t.CreatedAt != nil {
1026
1027 if len("createdAt") > 1000000 {
1028 return xerrors.Errorf("Value in field \"createdAt\" was too long")
1029 }
1030
1031 if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("createdAt"))); err != nil {
1032 return err
1033 }
1034 if _, err := cw.WriteString(string("createdAt")); err != nil {
1035 return err
1036 }
1037
1038 if t.CreatedAt == nil {
1039 if _, err := cw.Write(cbg.CborNull); err != nil {
1040 return err
1041 }
1042 } else {
1043 if len(*t.CreatedAt) > 1000000 {
1044 return xerrors.Errorf("Value in field t.CreatedAt was too long")
1045 }
1046
1047 if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.CreatedAt))); err != nil {
1048 return err
1049 }
1050 if _, err := cw.WriteString(string(*t.CreatedAt)); err != nil {
1051 return err
1052 }
1053 }
1054 }
1055 return nil
1056}
1057
1058func (t *RepoIssue) UnmarshalCBOR(r io.Reader) (err error) {
1059 *t = RepoIssue{}
1060
1061 cr := cbg.NewCborReader(r)
1062
1063 maj, extra, err := cr.ReadHeader()
1064 if err != nil {
1065 return err
1066 }
1067 defer func() {
1068 if err == io.EOF {
1069 err = io.ErrUnexpectedEOF
1070 }
1071 }()
1072
1073 if maj != cbg.MajMap {
1074 return fmt.Errorf("cbor input should be of type map")
1075 }
1076
1077 if extra > cbg.MaxLength {
1078 return fmt.Errorf("RepoIssue: map struct too large (%d)", extra)
1079 }
1080
1081 n := extra
1082
1083 nameBuf := make([]byte, 9)
1084 for i := uint64(0); i < n; i++ {
1085 nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000)
1086 if err != nil {
1087 return err
1088 }
1089
1090 if !ok {
1091 // Field doesn't exist on this type, so ignore it
1092 if err := cbg.ScanForLinks(cr, func(cid.Cid) {}); err != nil {
1093 return err
1094 }
1095 continue
1096 }
1097
1098 switch string(nameBuf[:nameLen]) {
1099 // t.Body (string) (string)
1100 case "body":
1101
1102 {
1103 b, err := cr.ReadByte()
1104 if err != nil {
1105 return err
1106 }
1107 if b != cbg.CborNull[0] {
1108 if err := cr.UnreadByte(); err != nil {
1109 return err
1110 }
1111
1112 sval, err := cbg.ReadStringWithMax(cr, 1000000)
1113 if err != nil {
1114 return err
1115 }
1116
1117 t.Body = (*string)(&sval)
1118 }
1119 }
1120 // t.Repo (string) (string)
1121 case "repo":
1122
1123 {
1124 sval, err := cbg.ReadStringWithMax(cr, 1000000)
1125 if err != nil {
1126 return err
1127 }
1128
1129 t.Repo = string(sval)
1130 }
1131 // t.LexiconTypeID (string) (string)
1132 case "$type":
1133
1134 {
1135 sval, err := cbg.ReadStringWithMax(cr, 1000000)
1136 if err != nil {
1137 return err
1138 }
1139
1140 t.LexiconTypeID = string(sval)
1141 }
1142 // t.Owner (string) (string)
1143 case "owner":
1144
1145 {
1146 sval, err := cbg.ReadStringWithMax(cr, 1000000)
1147 if err != nil {
1148 return err
1149 }
1150
1151 t.Owner = string(sval)
1152 }
1153 // t.Title (string) (string)
1154 case "title":
1155
1156 {
1157 sval, err := cbg.ReadStringWithMax(cr, 1000000)
1158 if err != nil {
1159 return err
1160 }
1161
1162 t.Title = string(sval)
1163 }
1164 // t.IssueId (int64) (int64)
1165 case "issueId":
1166 {
1167 maj, extra, err := cr.ReadHeader()
1168 if err != nil {
1169 return err
1170 }
1171 var extraI int64
1172 switch maj {
1173 case cbg.MajUnsignedInt:
1174 extraI = int64(extra)
1175 if extraI < 0 {
1176 return fmt.Errorf("int64 positive overflow")
1177 }
1178 case cbg.MajNegativeInt:
1179 extraI = int64(extra)
1180 if extraI < 0 {
1181 return fmt.Errorf("int64 negative overflow")
1182 }
1183 extraI = -1 - extraI
1184 default:
1185 return fmt.Errorf("wrong type for int64 field: %d", maj)
1186 }
1187
1188 t.IssueId = int64(extraI)
1189 }
1190 // t.CreatedAt (string) (string)
1191 case "createdAt":
1192
1193 {
1194 b, err := cr.ReadByte()
1195 if err != nil {
1196 return err
1197 }
1198 if b != cbg.CborNull[0] {
1199 if err := cr.UnreadByte(); err != nil {
1200 return err
1201 }
1202
1203 sval, err := cbg.ReadStringWithMax(cr, 1000000)
1204 if err != nil {
1205 return err
1206 }
1207
1208 t.CreatedAt = (*string)(&sval)
1209 }
1210 }
1211
1212 default:
1213 // Field doesn't exist on this type, so ignore it
1214 if err := cbg.ScanForLinks(r, func(cid.Cid) {}); err != nil {
1215 return err
1216 }
1217 }
1218 }
1219
1220 return nil
1221}
1222func (t *RepoIssueState) MarshalCBOR(w io.Writer) error {
1223 if t == nil {
1224 _, err := w.Write(cbg.CborNull)
1225 return err
1226 }
1227
1228 cw := cbg.NewCborWriter(w)
1229 fieldCount := 3
1230
1231 if t.State == nil {
1232 fieldCount--
1233 }
1234
1235 if _, err := cw.Write(cbg.CborEncodeMajorType(cbg.MajMap, uint64(fieldCount))); err != nil {
1236 return err
1237 }
1238
1239 // t.LexiconTypeID (string) (string)
1240 if len("$type") > 1000000 {
1241 return xerrors.Errorf("Value in field \"$type\" was too long")
1242 }
1243
1244 if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("$type"))); err != nil {
1245 return err
1246 }
1247 if _, err := cw.WriteString(string("$type")); err != nil {
1248 return err
1249 }
1250
1251 if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("sh.tangled.repo.issue.state"))); err != nil {
1252 return err
1253 }
1254 if _, err := cw.WriteString(string("sh.tangled.repo.issue.state")); err != nil {
1255 return err
1256 }
1257
1258 // t.Issue (string) (string)
1259 if len("issue") > 1000000 {
1260 return xerrors.Errorf("Value in field \"issue\" was too long")
1261 }
1262
1263 if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("issue"))); err != nil {
1264 return err
1265 }
1266 if _, err := cw.WriteString(string("issue")); err != nil {
1267 return err
1268 }
1269
1270 if len(t.Issue) > 1000000 {
1271 return xerrors.Errorf("Value in field t.Issue was too long")
1272 }
1273
1274 if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Issue))); err != nil {
1275 return err
1276 }
1277 if _, err := cw.WriteString(string(t.Issue)); err != nil {
1278 return err
1279 }
1280
1281 // t.State (string) (string)
1282 if t.State != nil {
1283
1284 if len("state") > 1000000 {
1285 return xerrors.Errorf("Value in field \"state\" was too long")
1286 }
1287
1288 if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("state"))); err != nil {
1289 return err
1290 }
1291 if _, err := cw.WriteString(string("state")); err != nil {
1292 return err
1293 }
1294
1295 if t.State == nil {
1296 if _, err := cw.Write(cbg.CborNull); err != nil {
1297 return err
1298 }
1299 } else {
1300 if len(*t.State) > 1000000 {
1301 return xerrors.Errorf("Value in field t.State was too long")
1302 }
1303
1304 if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.State))); err != nil {
1305 return err
1306 }
1307 if _, err := cw.WriteString(string(*t.State)); err != nil {
1308 return err
1309 }
1310 }
1311 }
1312 return nil
1313}
1314
1315func (t *RepoIssueState) UnmarshalCBOR(r io.Reader) (err error) {
1316 *t = RepoIssueState{}
1317
1318 cr := cbg.NewCborReader(r)
1319
1320 maj, extra, err := cr.ReadHeader()
1321 if err != nil {
1322 return err
1323 }
1324 defer func() {
1325 if err == io.EOF {
1326 err = io.ErrUnexpectedEOF
1327 }
1328 }()
1329
1330 if maj != cbg.MajMap {
1331 return fmt.Errorf("cbor input should be of type map")
1332 }
1333
1334 if extra > cbg.MaxLength {
1335 return fmt.Errorf("RepoIssueState: map struct too large (%d)", extra)
1336 }
1337
1338 n := extra
1339
1340 nameBuf := make([]byte, 5)
1341 for i := uint64(0); i < n; i++ {
1342 nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000)
1343 if err != nil {
1344 return err
1345 }
1346
1347 if !ok {
1348 // Field doesn't exist on this type, so ignore it
1349 if err := cbg.ScanForLinks(cr, func(cid.Cid) {}); err != nil {
1350 return err
1351 }
1352 continue
1353 }
1354
1355 switch string(nameBuf[:nameLen]) {
1356 // t.LexiconTypeID (string) (string)
1357 case "$type":
1358
1359 {
1360 sval, err := cbg.ReadStringWithMax(cr, 1000000)
1361 if err != nil {
1362 return err
1363 }
1364
1365 t.LexiconTypeID = string(sval)
1366 }
1367 // t.Issue (string) (string)
1368 case "issue":
1369
1370 {
1371 sval, err := cbg.ReadStringWithMax(cr, 1000000)
1372 if err != nil {
1373 return err
1374 }
1375
1376 t.Issue = string(sval)
1377 }
1378 // t.State (string) (string)
1379 case "state":
1380
1381 {
1382 b, err := cr.ReadByte()
1383 if err != nil {
1384 return err
1385 }
1386 if b != cbg.CborNull[0] {
1387 if err := cr.UnreadByte(); err != nil {
1388 return err
1389 }
1390
1391 sval, err := cbg.ReadStringWithMax(cr, 1000000)
1392 if err != nil {
1393 return err
1394 }
1395
1396 t.State = (*string)(&sval)
1397 }
1398 }
1399
1400 default:
1401 // Field doesn't exist on this type, so ignore it
1402 if err := cbg.ScanForLinks(r, func(cid.Cid) {}); err != nil {
1403 return err
1404 }
1405 }
1406 }
1407
1408 return nil
1409}
1410func (t *RepoIssueComment) MarshalCBOR(w io.Writer) error {
1411 if t == nil {
1412 _, err := w.Write(cbg.CborNull)
1413 return err
1414 }
1415
1416 cw := cbg.NewCborWriter(w)
1417 fieldCount := 7
1418
1419 if t.Body == nil {
1420 fieldCount--
1421 }
1422
1423 if t.CommentId == nil {
1424 fieldCount--
1425 }
1426
1427 if t.CreatedAt == nil {
1428 fieldCount--
1429 }
1430
1431 if t.Owner == nil {
1432 fieldCount--
1433 }
1434
1435 if t.Repo == nil {
1436 fieldCount--
1437 }
1438
1439 if _, err := cw.Write(cbg.CborEncodeMajorType(cbg.MajMap, uint64(fieldCount))); err != nil {
1440 return err
1441 }
1442
1443 // t.Body (string) (string)
1444 if t.Body != nil {
1445
1446 if len("body") > 1000000 {
1447 return xerrors.Errorf("Value in field \"body\" was too long")
1448 }
1449
1450 if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("body"))); err != nil {
1451 return err
1452 }
1453 if _, err := cw.WriteString(string("body")); err != nil {
1454 return err
1455 }
1456
1457 if t.Body == nil {
1458 if _, err := cw.Write(cbg.CborNull); err != nil {
1459 return err
1460 }
1461 } else {
1462 if len(*t.Body) > 1000000 {
1463 return xerrors.Errorf("Value in field t.Body was too long")
1464 }
1465
1466 if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Body))); err != nil {
1467 return err
1468 }
1469 if _, err := cw.WriteString(string(*t.Body)); err != nil {
1470 return err
1471 }
1472 }
1473 }
1474
1475 // t.Repo (string) (string)
1476 if t.Repo != nil {
1477
1478 if len("repo") > 1000000 {
1479 return xerrors.Errorf("Value in field \"repo\" was too long")
1480 }
1481
1482 if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("repo"))); err != nil {
1483 return err
1484 }
1485 if _, err := cw.WriteString(string("repo")); err != nil {
1486 return err
1487 }
1488
1489 if t.Repo == nil {
1490 if _, err := cw.Write(cbg.CborNull); err != nil {
1491 return err
1492 }
1493 } else {
1494 if len(*t.Repo) > 1000000 {
1495 return xerrors.Errorf("Value in field t.Repo was too long")
1496 }
1497
1498 if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Repo))); err != nil {
1499 return err
1500 }
1501 if _, err := cw.WriteString(string(*t.Repo)); err != nil {
1502 return err
1503 }
1504 }
1505 }
1506
1507 // t.LexiconTypeID (string) (string)
1508 if len("$type") > 1000000 {
1509 return xerrors.Errorf("Value in field \"$type\" was too long")
1510 }
1511
1512 if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("$type"))); err != nil {
1513 return err
1514 }
1515 if _, err := cw.WriteString(string("$type")); err != nil {
1516 return err
1517 }
1518
1519 if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("sh.tangled.repo.issue.comment"))); err != nil {
1520 return err
1521 }
1522 if _, err := cw.WriteString(string("sh.tangled.repo.issue.comment")); err != nil {
1523 return err
1524 }
1525
1526 // t.Issue (string) (string)
1527 if len("issue") > 1000000 {
1528 return xerrors.Errorf("Value in field \"issue\" was too long")
1529 }
1530
1531 if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("issue"))); err != nil {
1532 return err
1533 }
1534 if _, err := cw.WriteString(string("issue")); err != nil {
1535 return err
1536 }
1537
1538 if len(t.Issue) > 1000000 {
1539 return xerrors.Errorf("Value in field t.Issue was too long")
1540 }
1541
1542 if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Issue))); err != nil {
1543 return err
1544 }
1545 if _, err := cw.WriteString(string(t.Issue)); err != nil {
1546 return err
1547 }
1548
1549 // t.Owner (string) (string)
1550 if t.Owner != nil {
1551
1552 if len("owner") > 1000000 {
1553 return xerrors.Errorf("Value in field \"owner\" was too long")
1554 }
1555
1556 if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("owner"))); err != nil {
1557 return err
1558 }
1559 if _, err := cw.WriteString(string("owner")); err != nil {
1560 return err
1561 }
1562
1563 if t.Owner == nil {
1564 if _, err := cw.Write(cbg.CborNull); err != nil {
1565 return err
1566 }
1567 } else {
1568 if len(*t.Owner) > 1000000 {
1569 return xerrors.Errorf("Value in field t.Owner was too long")
1570 }
1571
1572 if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Owner))); err != nil {
1573 return err
1574 }
1575 if _, err := cw.WriteString(string(*t.Owner)); err != nil {
1576 return err
1577 }
1578 }
1579 }
1580
1581 // t.CommentId (int64) (int64)
1582 if t.CommentId != nil {
1583
1584 if len("commentId") > 1000000 {
1585 return xerrors.Errorf("Value in field \"commentId\" was too long")
1586 }
1587
1588 if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("commentId"))); err != nil {
1589 return err
1590 }
1591 if _, err := cw.WriteString(string("commentId")); err != nil {
1592 return err
1593 }
1594
1595 if t.CommentId == nil {
1596 if _, err := cw.Write(cbg.CborNull); err != nil {
1597 return err
1598 }
1599 } else {
1600 if *t.CommentId >= 0 {
1601 if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(*t.CommentId)); err != nil {
1602 return err
1603 }
1604 } else {
1605 if err := cw.WriteMajorTypeHeader(cbg.MajNegativeInt, uint64(-*t.CommentId-1)); err != nil {
1606 return err
1607 }
1608 }
1609 }
1610
1611 }
1612
1613 // t.CreatedAt (string) (string)
1614 if t.CreatedAt != nil {
1615
1616 if len("createdAt") > 1000000 {
1617 return xerrors.Errorf("Value in field \"createdAt\" was too long")
1618 }
1619
1620 if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("createdAt"))); err != nil {
1621 return err
1622 }
1623 if _, err := cw.WriteString(string("createdAt")); err != nil {
1624 return err
1625 }
1626
1627 if t.CreatedAt == nil {
1628 if _, err := cw.Write(cbg.CborNull); err != nil {
1629 return err
1630 }
1631 } else {
1632 if len(*t.CreatedAt) > 1000000 {
1633 return xerrors.Errorf("Value in field t.CreatedAt was too long")
1634 }
1635
1636 if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.CreatedAt))); err != nil {
1637 return err
1638 }
1639 if _, err := cw.WriteString(string(*t.CreatedAt)); err != nil {
1640 return err
1641 }
1642 }
1643 }
1644 return nil
1645}
1646
1647func (t *RepoIssueComment) UnmarshalCBOR(r io.Reader) (err error) {
1648 *t = RepoIssueComment{}
1649
1650 cr := cbg.NewCborReader(r)
1651
1652 maj, extra, err := cr.ReadHeader()
1653 if err != nil {
1654 return err
1655 }
1656 defer func() {
1657 if err == io.EOF {
1658 err = io.ErrUnexpectedEOF
1659 }
1660 }()
1661
1662 if maj != cbg.MajMap {
1663 return fmt.Errorf("cbor input should be of type map")
1664 }
1665
1666 if extra > cbg.MaxLength {
1667 return fmt.Errorf("RepoIssueComment: map struct too large (%d)", extra)
1668 }
1669
1670 n := extra
1671
1672 nameBuf := make([]byte, 9)
1673 for i := uint64(0); i < n; i++ {
1674 nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000)
1675 if err != nil {
1676 return err
1677 }
1678
1679 if !ok {
1680 // Field doesn't exist on this type, so ignore it
1681 if err := cbg.ScanForLinks(cr, func(cid.Cid) {}); err != nil {
1682 return err
1683 }
1684 continue
1685 }
1686
1687 switch string(nameBuf[:nameLen]) {
1688 // t.Body (string) (string)
1689 case "body":
1690
1691 {
1692 b, err := cr.ReadByte()
1693 if err != nil {
1694 return err
1695 }
1696 if b != cbg.CborNull[0] {
1697 if err := cr.UnreadByte(); err != nil {
1698 return err
1699 }
1700
1701 sval, err := cbg.ReadStringWithMax(cr, 1000000)
1702 if err != nil {
1703 return err
1704 }
1705
1706 t.Body = (*string)(&sval)
1707 }
1708 }
1709 // t.Repo (string) (string)
1710 case "repo":
1711
1712 {
1713 b, err := cr.ReadByte()
1714 if err != nil {
1715 return err
1716 }
1717 if b != cbg.CborNull[0] {
1718 if err := cr.UnreadByte(); err != nil {
1719 return err
1720 }
1721
1722 sval, err := cbg.ReadStringWithMax(cr, 1000000)
1723 if err != nil {
1724 return err
1725 }
1726
1727 t.Repo = (*string)(&sval)
1728 }
1729 }
1730 // t.LexiconTypeID (string) (string)
1731 case "$type":
1732
1733 {
1734 sval, err := cbg.ReadStringWithMax(cr, 1000000)
1735 if err != nil {
1736 return err
1737 }
1738
1739 t.LexiconTypeID = string(sval)
1740 }
1741 // t.Issue (string) (string)
1742 case "issue":
1743
1744 {
1745 sval, err := cbg.ReadStringWithMax(cr, 1000000)
1746 if err != nil {
1747 return err
1748 }
1749
1750 t.Issue = string(sval)
1751 }
1752 // t.Owner (string) (string)
1753 case "owner":
1754
1755 {
1756 b, err := cr.ReadByte()
1757 if err != nil {
1758 return err
1759 }
1760 if b != cbg.CborNull[0] {
1761 if err := cr.UnreadByte(); err != nil {
1762 return err
1763 }
1764
1765 sval, err := cbg.ReadStringWithMax(cr, 1000000)
1766 if err != nil {
1767 return err
1768 }
1769
1770 t.Owner = (*string)(&sval)
1771 }
1772 }
1773 // t.CommentId (int64) (int64)
1774 case "commentId":
1775 {
1776
1777 b, err := cr.ReadByte()
1778 if err != nil {
1779 return err
1780 }
1781 if b != cbg.CborNull[0] {
1782 if err := cr.UnreadByte(); err != nil {
1783 return err
1784 }
1785 maj, extra, err := cr.ReadHeader()
1786 if err != nil {
1787 return err
1788 }
1789 var extraI int64
1790 switch maj {
1791 case cbg.MajUnsignedInt:
1792 extraI = int64(extra)
1793 if extraI < 0 {
1794 return fmt.Errorf("int64 positive overflow")
1795 }
1796 case cbg.MajNegativeInt:
1797 extraI = int64(extra)
1798 if extraI < 0 {
1799 return fmt.Errorf("int64 negative overflow")
1800 }
1801 extraI = -1 - extraI
1802 default:
1803 return fmt.Errorf("wrong type for int64 field: %d", maj)
1804 }
1805
1806 t.CommentId = (*int64)(&extraI)
1807 }
1808 }
1809 // t.CreatedAt (string) (string)
1810 case "createdAt":
1811
1812 {
1813 b, err := cr.ReadByte()
1814 if err != nil {
1815 return err
1816 }
1817 if b != cbg.CborNull[0] {
1818 if err := cr.UnreadByte(); err != nil {
1819 return err
1820 }
1821
1822 sval, err := cbg.ReadStringWithMax(cr, 1000000)
1823 if err != nil {
1824 return err
1825 }
1826
1827 t.CreatedAt = (*string)(&sval)
1828 }
1829 }
1830
1831 default:
1832 // Field doesn't exist on this type, so ignore it
1833 if err := cbg.ScanForLinks(r, func(cid.Cid) {}); err != nil {
1834 return err
1835 }
1836 }
1837 }
1838
1839 return nil
1840}