···
cw := cbg.NewCborWriter(w)
6753
+
if t.Mentions == nil {
6757
+
if t.References == nil {
if _, err := cw.Write(cbg.CborEncodeMajorType(cbg.MajMap, uint64(fieldCount))); err != nil {
···
6862
+
// t.Mentions ([]string) (slice)
6863
+
if t.Mentions != nil {
6865
+
if len("mentions") > 1000000 {
6866
+
return xerrors.Errorf("Value in field \"mentions\" was too long")
6869
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("mentions"))); err != nil {
6872
+
if _, err := cw.WriteString(string("mentions")); err != nil {
6876
+
if len(t.Mentions) > 8192 {
6877
+
return xerrors.Errorf("Slice value in field t.Mentions was too long")
6880
+
if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.Mentions))); err != nil {
6883
+
for _, v := range t.Mentions {
6884
+
if len(v) > 1000000 {
6885
+
return xerrors.Errorf("Value in field v was too long")
6888
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(v))); err != nil {
6891
+
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 {
6921
+
// t.References ([]string) (slice)
6922
+
if t.References != nil {
6924
+
if len("references") > 1000000 {
6925
+
return xerrors.Errorf("Value in field \"references\" was too long")
6928
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("references"))); err != nil {
6931
+
if _, err := cw.WriteString(string("references")); err != nil {
6935
+
if len(t.References) > 8192 {
6936
+
return xerrors.Errorf("Slice value in field t.References was too long")
6939
+
if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.References))); err != nil {
6942
+
for _, v := range t.References {
6943
+
if len(v) > 1000000 {
6944
+
return xerrors.Errorf("Value in field v was too long")
6947
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(v))); err != nil {
6950
+
if _, err := cw.WriteString(string(v)); err != nil {
···
6904
-
nameBuf := make([]byte, 9)
6984
+
nameBuf := make([]byte, 10)
for i := uint64(0); i < n; i++ {
nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000)
···
7054
+
// t.Mentions ([]string) (slice)
7057
+
maj, extra, err = cr.ReadHeader()
7063
+
return fmt.Errorf("t.Mentions: array too large (%d)", extra)
7066
+
if maj != cbg.MajArray {
7067
+
return fmt.Errorf("expected cbor array")
7071
+
t.Mentions = make([]string, extra)
7074
+
for i := 0; i < int(extra); i++ {
7084
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
7089
+
t.Mentions[i] = string(sval)
// t.CreatedAt (string) (string)
···
t.CreatedAt = string(sval)
7105
+
// t.References ([]string) (slice)
7106
+
case "references":
7108
+
maj, extra, err = cr.ReadHeader()
7114
+
return fmt.Errorf("t.References: array too large (%d)", extra)
7117
+
if maj != cbg.MajArray {
7118
+
return fmt.Errorf("expected cbor array")
7122
+
t.References = make([]string, extra)
7125
+
for i := 0; i < int(extra); i++ {
7135
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
7140
+
t.References[i] = string(sval)
// Field doesn't exist on this type, so ignore it
···
cw := cbg.NewCborWriter(w)
7165
+
if t.Mentions == nil {
7169
+
if t.References == nil {
···
7278
+
// t.Mentions ([]string) (slice)
7279
+
if t.Mentions != nil {
7281
+
if len("mentions") > 1000000 {
7282
+
return xerrors.Errorf("Value in field \"mentions\" was too long")
7285
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("mentions"))); err != nil {
7288
+
if _, err := cw.WriteString(string("mentions")); err != nil {
7292
+
if len(t.Mentions) > 8192 {
7293
+
return xerrors.Errorf("Slice value in field t.Mentions was too long")
7296
+
if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.Mentions))); err != nil {
7299
+
for _, v := range t.Mentions {
7300
+
if len(v) > 1000000 {
7301
+
return xerrors.Errorf("Value in field v was too long")
7304
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(v))); err != nil {
7307
+
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 {
7337
+
// t.References ([]string) (slice)
7338
+
if t.References != nil {
7340
+
if len("references") > 1000000 {
7341
+
return xerrors.Errorf("Value in field \"references\" was too long")
7344
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("references"))); err != nil {
7347
+
if _, err := cw.WriteString(string("references")); err != nil {
7351
+
if len(t.References) > 8192 {
7352
+
return xerrors.Errorf("Slice value in field t.References was too long")
7355
+
if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.References))); err != nil {
7358
+
for _, v := range t.References {
7359
+
if len(v) > 1000000 {
7360
+
return xerrors.Errorf("Value in field v was too long")
7363
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(v))); err != nil {
7366
+
if _, err := cw.WriteString(string(v)); err != nil {
···
7160
-
nameBuf := make([]byte, 9)
7400
+
nameBuf := make([]byte, 10)
for i := uint64(0); i < n; i++ {
nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000)
···
t.ReplyTo = (*string)(&sval)
7470
+
// t.Mentions ([]string) (slice)
7473
+
maj, extra, err = cr.ReadHeader()
7479
+
return fmt.Errorf("t.Mentions: array too large (%d)", extra)
7482
+
if maj != cbg.MajArray {
7483
+
return fmt.Errorf("expected cbor array")
7487
+
t.Mentions = make([]string, extra)
7490
+
for i := 0; i < int(extra); i++ {
7500
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
7505
+
t.Mentions[i] = string(sval)
// t.CreatedAt (string) (string)
···
t.CreatedAt = string(sval)
7521
+
// t.References ([]string) (slice)
7522
+
case "references":
7524
+
maj, extra, err = cr.ReadHeader()
7530
+
return fmt.Errorf("t.References: array too large (%d)", extra)
7533
+
if maj != cbg.MajArray {
7534
+
return fmt.Errorf("expected cbor array")
7538
+
t.References = make([]string, extra)
7541
+
for i := 0; i < int(extra); i++ {
7551
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
7556
+
t.References[i] = string(sval)
// Field doesn't exist on this type, so ignore it
···
cw := cbg.NewCborWriter(w)
7759
-
if _, err := cw.Write([]byte{164}); err != nil {
8080
+
if t.Mentions == nil {
8084
+
if t.References == nil {
8088
+
if _, err := cw.Write(cbg.CborEncodeMajorType(cbg.MajMap, uint64(fieldCount))); err != nil {
···
8157
+
// t.Mentions ([]string) (slice)
8158
+
if t.Mentions != nil {
8160
+
if len("mentions") > 1000000 {
8161
+
return xerrors.Errorf("Value in field \"mentions\" was too long")
8164
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("mentions"))); err != nil {
8167
+
if _, err := cw.WriteString(string("mentions")); err != nil {
8171
+
if len(t.Mentions) > 8192 {
8172
+
return xerrors.Errorf("Slice value in field t.Mentions was too long")
8175
+
if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.Mentions))); err != nil {
8178
+
for _, v := range t.Mentions {
8179
+
if len(v) > 1000000 {
8180
+
return xerrors.Errorf("Value in field v was too long")
8183
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(v))); err != nil {
8186
+
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 {
8216
+
// t.References ([]string) (slice)
8217
+
if t.References != nil {
8219
+
if len("references") > 1000000 {
8220
+
return xerrors.Errorf("Value in field \"references\" was too long")
8223
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("references"))); err != nil {
8226
+
if _, err := cw.WriteString(string("references")); err != nil {
8230
+
if len(t.References) > 8192 {
8231
+
return xerrors.Errorf("Slice value in field t.References was too long")
8234
+
if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.References))); err != nil {
8237
+
for _, v := range t.References {
8238
+
if len(v) > 1000000 {
8239
+
return xerrors.Errorf("Value in field v was too long")
8242
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(v))); err != nil {
8245
+
if _, err := cw.WriteString(string(v)); err != nil {
···
7878
-
nameBuf := make([]byte, 9)
8279
+
nameBuf := make([]byte, 10)
for i := uint64(0); i < n; i++ {
nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000)
···
t.LexiconTypeID = string(sval)
8328
+
// t.Mentions ([]string) (slice)
8331
+
maj, extra, err = cr.ReadHeader()
8337
+
return fmt.Errorf("t.Mentions: array too large (%d)", extra)
8340
+
if maj != cbg.MajArray {
8341
+
return fmt.Errorf("expected cbor array")
8345
+
t.Mentions = make([]string, extra)
8348
+
for i := 0; i < int(extra); i++ {
8358
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
8363
+
t.Mentions[i] = string(sval)
// t.CreatedAt (string) (string)
···
t.CreatedAt = string(sval)
8379
+
// t.References ([]string) (slice)
8380
+
case "references":
8382
+
maj, extra, err = cr.ReadHeader()
8388
+
return fmt.Errorf("t.References: array too large (%d)", extra)
8391
+
if maj != cbg.MajArray {
8392
+
return fmt.Errorf("expected cbor array")
8396
+
t.References = make([]string, extra)
8399
+
for i := 0; i < int(extra); i++ {
8409
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
8414
+
t.References[i] = string(sval)
// Field doesn't exist on this type, so ignore it