···
cw := cbg.NewCborWriter(w)
6890
+
if t.Mentions == nil {
6894
+
if t.References == nil {
if _, err := cw.Write(cbg.CborEncodeMajorType(cbg.MajMap, uint64(fieldCount))); err != nil {
···
6999
+
// t.Mentions ([]string) (slice)
7000
+
if t.Mentions != nil {
7002
+
if len("mentions") > 1000000 {
7003
+
return xerrors.Errorf("Value in field \"mentions\" was too long")
7006
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("mentions"))); err != nil {
7009
+
if _, err := cw.WriteString(string("mentions")); err != nil {
7013
+
if len(t.Mentions) > 8192 {
7014
+
return xerrors.Errorf("Slice value in field t.Mentions was too long")
7017
+
if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.Mentions))); err != nil {
7020
+
for _, v := range t.Mentions {
7021
+
if len(v) > 1000000 {
7022
+
return xerrors.Errorf("Value in field v was too long")
7025
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(v))); err != nil {
7028
+
if _, err := cw.WriteString(string(v)); err != nil {
// t.CreatedAt (string) (string)
if len("createdAt") > 1000000 {
return xerrors.Errorf("Value in field \"createdAt\" was too long")
···
if _, err := cw.WriteString(string(t.CreatedAt)); err != nil {
7058
+
// t.References ([]string) (slice)
7059
+
if t.References != nil {
7061
+
if len("references") > 1000000 {
7062
+
return xerrors.Errorf("Value in field \"references\" was too long")
7065
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("references"))); err != nil {
7068
+
if _, err := cw.WriteString(string("references")); err != nil {
7072
+
if len(t.References) > 8192 {
7073
+
return xerrors.Errorf("Slice value in field t.References was too long")
7076
+
if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.References))); err != nil {
7079
+
for _, v := range t.References {
7080
+
if len(v) > 1000000 {
7081
+
return xerrors.Errorf("Value in field v was too long")
7084
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(v))); err != nil {
7087
+
if _, err := cw.WriteString(string(v)); err != nil {
···
7041
-
nameBuf := make([]byte, 9)
7121
+
nameBuf := make([]byte, 10)
for i := uint64(0); i < n; i++ {
nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000)
···
7191
+
// t.Mentions ([]string) (slice)
7194
+
maj, extra, err = cr.ReadHeader()
7200
+
return fmt.Errorf("t.Mentions: array too large (%d)", extra)
7203
+
if maj != cbg.MajArray {
7204
+
return fmt.Errorf("expected cbor array")
7208
+
t.Mentions = make([]string, extra)
7211
+
for i := 0; i < int(extra); i++ {
7221
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
7226
+
t.Mentions[i] = string(sval)
// t.CreatedAt (string) (string)
···
t.CreatedAt = string(sval)
7242
+
// t.References ([]string) (slice)
7243
+
case "references":
7245
+
maj, extra, err = cr.ReadHeader()
7251
+
return fmt.Errorf("t.References: array too large (%d)", extra)
7254
+
if maj != cbg.MajArray {
7255
+
return fmt.Errorf("expected cbor array")
7259
+
t.References = make([]string, extra)
7262
+
for i := 0; i < int(extra); i++ {
7272
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
7277
+
t.References[i] = string(sval)
// Field doesn't exist on this type, so ignore it
···
cw := cbg.NewCborWriter(w)
7302
+
if t.Mentions == nil {
7306
+
if t.References == nil {
···
7415
+
// t.Mentions ([]string) (slice)
7416
+
if t.Mentions != nil {
7418
+
if len("mentions") > 1000000 {
7419
+
return xerrors.Errorf("Value in field \"mentions\" was too long")
7422
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("mentions"))); err != nil {
7425
+
if _, err := cw.WriteString(string("mentions")); err != nil {
7429
+
if len(t.Mentions) > 8192 {
7430
+
return xerrors.Errorf("Slice value in field t.Mentions was too long")
7433
+
if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.Mentions))); err != nil {
7436
+
for _, v := range t.Mentions {
7437
+
if len(v) > 1000000 {
7438
+
return xerrors.Errorf("Value in field v was too long")
7441
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(v))); err != nil {
7444
+
if _, err := cw.WriteString(string(v)); err != nil {
// t.CreatedAt (string) (string)
if len("createdAt") > 1000000 {
return xerrors.Errorf("Value in field \"createdAt\" was too long")
···
if _, err := cw.WriteString(string(t.CreatedAt)); err != nil {
7474
+
// t.References ([]string) (slice)
7475
+
if t.References != nil {
7477
+
if len("references") > 1000000 {
7478
+
return xerrors.Errorf("Value in field \"references\" was too long")
7481
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("references"))); err != nil {
7484
+
if _, err := cw.WriteString(string("references")); err != nil {
7488
+
if len(t.References) > 8192 {
7489
+
return xerrors.Errorf("Slice value in field t.References was too long")
7492
+
if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.References))); err != nil {
7495
+
for _, v := range t.References {
7496
+
if len(v) > 1000000 {
7497
+
return xerrors.Errorf("Value in field v was too long")
7500
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(v))); err != nil {
7503
+
if _, err := cw.WriteString(string(v)); err != nil {
···
7297
-
nameBuf := make([]byte, 9)
7537
+
nameBuf := make([]byte, 10)
for i := uint64(0); i < n; i++ {
nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000)
···
t.ReplyTo = (*string)(&sval)
7607
+
// t.Mentions ([]string) (slice)
7610
+
maj, extra, err = cr.ReadHeader()
7616
+
return fmt.Errorf("t.Mentions: array too large (%d)", extra)
7619
+
if maj != cbg.MajArray {
7620
+
return fmt.Errorf("expected cbor array")
7624
+
t.Mentions = make([]string, extra)
7627
+
for i := 0; i < int(extra); i++ {
7637
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
7642
+
t.Mentions[i] = string(sval)
// t.CreatedAt (string) (string)
···
t.CreatedAt = string(sval)
7658
+
// t.References ([]string) (slice)
7659
+
case "references":
7661
+
maj, extra, err = cr.ReadHeader()
7667
+
return fmt.Errorf("t.References: array too large (%d)", extra)
7670
+
if maj != cbg.MajArray {
7671
+
return fmt.Errorf("expected cbor array")
7675
+
t.References = make([]string, extra)
7678
+
for i := 0; i < int(extra); i++ {
7688
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
7693
+
t.References[i] = string(sval)
// Field doesn't exist on this type, so ignore it
···
cw := cbg.NewCborWriter(w)
7896
-
if _, err := cw.Write([]byte{164}); err != nil {
8217
+
if t.Mentions == nil {
8221
+
if t.References == nil {
8225
+
if _, err := cw.Write(cbg.CborEncodeMajorType(cbg.MajMap, uint64(fieldCount))); err != nil {
···
8294
+
// t.Mentions ([]string) (slice)
8295
+
if t.Mentions != nil {
8297
+
if len("mentions") > 1000000 {
8298
+
return xerrors.Errorf("Value in field \"mentions\" was too long")
8301
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("mentions"))); err != nil {
8304
+
if _, err := cw.WriteString(string("mentions")); err != nil {
8308
+
if len(t.Mentions) > 8192 {
8309
+
return xerrors.Errorf("Slice value in field t.Mentions was too long")
8312
+
if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.Mentions))); err != nil {
8315
+
for _, v := range t.Mentions {
8316
+
if len(v) > 1000000 {
8317
+
return xerrors.Errorf("Value in field v was too long")
8320
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(v))); err != nil {
8323
+
if _, err := cw.WriteString(string(v)); err != nil {
// t.CreatedAt (string) (string)
if len("createdAt") > 1000000 {
return xerrors.Errorf("Value in field \"createdAt\" was too long")
···
if _, err := cw.WriteString(string(t.CreatedAt)); err != nil {
8353
+
// t.References ([]string) (slice)
8354
+
if t.References != nil {
8356
+
if len("references") > 1000000 {
8357
+
return xerrors.Errorf("Value in field \"references\" was too long")
8360
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("references"))); err != nil {
8363
+
if _, err := cw.WriteString(string("references")); err != nil {
8367
+
if len(t.References) > 8192 {
8368
+
return xerrors.Errorf("Slice value in field t.References was too long")
8371
+
if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.References))); err != nil {
8374
+
for _, v := range t.References {
8375
+
if len(v) > 1000000 {
8376
+
return xerrors.Errorf("Value in field v was too long")
8379
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(v))); err != nil {
8382
+
if _, err := cw.WriteString(string(v)); err != nil {
···
8015
-
nameBuf := make([]byte, 9)
8416
+
nameBuf := make([]byte, 10)
for i := uint64(0); i < n; i++ {
nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000)
···
t.LexiconTypeID = string(sval)
8465
+
// t.Mentions ([]string) (slice)
8468
+
maj, extra, err = cr.ReadHeader()
8474
+
return fmt.Errorf("t.Mentions: array too large (%d)", extra)
8477
+
if maj != cbg.MajArray {
8478
+
return fmt.Errorf("expected cbor array")
8482
+
t.Mentions = make([]string, extra)
8485
+
for i := 0; i < int(extra); i++ {
8495
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
8500
+
t.Mentions[i] = string(sval)
// t.CreatedAt (string) (string)
···
t.CreatedAt = string(sval)
8516
+
// t.References ([]string) (slice)
8517
+
case "references":
8519
+
maj, extra, err = cr.ReadHeader()
8525
+
return fmt.Errorf("t.References: array too large (%d)", extra)
8528
+
if maj != cbg.MajArray {
8529
+
return fmt.Errorf("expected cbor array")
8533
+
t.References = make([]string, extra)
8536
+
for i := 0; i < int(extra); i++ {
8546
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
8551
+
t.References[i] = string(sval)
// Field doesn't exist on this type, so ignore it