···
cw := cbg.NewCborWriter(w)
+
if t.References == nil {
if _, err := cw.Write(cbg.CborEncodeMajorType(cbg.MajMap, uint64(fieldCount))); err != nil {
···
+
// t.Mentions ([]string) (slice)
+
if len("mentions") > 1000000 {
+
return xerrors.Errorf("Value in field \"mentions\" was too long")
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("mentions"))); err != nil {
+
if _, err := cw.WriteString(string("mentions")); err != nil {
+
if len(t.Mentions) > 8192 {
+
return xerrors.Errorf("Slice value in field t.Mentions was too long")
+
if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.Mentions))); err != nil {
+
for _, v := range t.Mentions {
+
return xerrors.Errorf("Value in field v was too long")
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(v))); err != nil {
+
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 {
+
// t.References ([]string) (slice)
+
if t.References != nil {
+
if len("references") > 1000000 {
+
return xerrors.Errorf("Value in field \"references\" was too long")
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("references"))); err != nil {
+
if _, err := cw.WriteString(string("references")); err != nil {
+
if len(t.References) > 8192 {
+
return xerrors.Errorf("Slice value in field t.References was too long")
+
if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.References))); err != nil {
+
for _, v := range t.References {
+
return xerrors.Errorf("Value in field v was too long")
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(v))); err != nil {
+
if _, err := cw.WriteString(string(v)); err != nil {
···
+
nameBuf := make([]byte, 10)
for i := uint64(0); i < n; i++ {
nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000)
···
+
// t.Mentions ([]string) (slice)
+
maj, extra, err = cr.ReadHeader()
+
return fmt.Errorf("t.Mentions: array too large (%d)", extra)
+
if maj != cbg.MajArray {
+
return fmt.Errorf("expected cbor array")
+
t.Mentions = make([]string, extra)
+
for i := 0; i < int(extra); i++ {
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
+
t.Mentions[i] = string(sval)
// t.CreatedAt (string) (string)
···
t.CreatedAt = string(sval)
+
// t.References ([]string) (slice)
+
maj, extra, err = cr.ReadHeader()
+
return fmt.Errorf("t.References: array too large (%d)", extra)
+
if maj != cbg.MajArray {
+
return fmt.Errorf("expected cbor array")
+
t.References = make([]string, extra)
+
for i := 0; i < int(extra); i++ {
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
+
t.References[i] = string(sval)
// Field doesn't exist on this type, so ignore it
···
cw := cbg.NewCborWriter(w)
+
if t.References == nil {
···
+
// t.Mentions ([]string) (slice)
+
if len("mentions") > 1000000 {
+
return xerrors.Errorf("Value in field \"mentions\" was too long")
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("mentions"))); err != nil {
+
if _, err := cw.WriteString(string("mentions")); err != nil {
+
if len(t.Mentions) > 8192 {
+
return xerrors.Errorf("Slice value in field t.Mentions was too long")
+
if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.Mentions))); err != nil {
+
for _, v := range t.Mentions {
+
return xerrors.Errorf("Value in field v was too long")
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(v))); err != nil {
+
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 {
+
// t.References ([]string) (slice)
+
if t.References != nil {
+
if len("references") > 1000000 {
+
return xerrors.Errorf("Value in field \"references\" was too long")
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("references"))); err != nil {
+
if _, err := cw.WriteString(string("references")); err != nil {
+
if len(t.References) > 8192 {
+
return xerrors.Errorf("Slice value in field t.References was too long")
+
if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.References))); err != nil {
+
for _, v := range t.References {
+
return xerrors.Errorf("Value in field v was too long")
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(v))); err != nil {
+
if _, err := cw.WriteString(string(v)); err != nil {
···
+
nameBuf := make([]byte, 10)
for i := uint64(0); i < n; i++ {
nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000)
···
t.ReplyTo = (*string)(&sval)
+
// t.Mentions ([]string) (slice)
+
maj, extra, err = cr.ReadHeader()
+
return fmt.Errorf("t.Mentions: array too large (%d)", extra)
+
if maj != cbg.MajArray {
+
return fmt.Errorf("expected cbor array")
+
t.Mentions = make([]string, extra)
+
for i := 0; i < int(extra); i++ {
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
+
t.Mentions[i] = string(sval)
// t.CreatedAt (string) (string)
···
t.CreatedAt = string(sval)
+
// t.References ([]string) (slice)
+
maj, extra, err = cr.ReadHeader()
+
return fmt.Errorf("t.References: array too large (%d)", extra)
+
if maj != cbg.MajArray {
+
return fmt.Errorf("expected cbor array")
+
t.References = make([]string, extra)
+
for i := 0; i < int(extra); i++ {
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
+
t.References[i] = string(sval)
// Field doesn't exist on this type, so ignore it
···
cw := cbg.NewCborWriter(w)
+
if t.References == nil {
+
if _, err := cw.Write(cbg.CborEncodeMajorType(cbg.MajMap, uint64(fieldCount))); err != nil {
···
+
// t.Mentions ([]string) (slice)
+
if len("mentions") > 1000000 {
+
return xerrors.Errorf("Value in field \"mentions\" was too long")
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("mentions"))); err != nil {
+
if _, err := cw.WriteString(string("mentions")); err != nil {
+
if len(t.Mentions) > 8192 {
+
return xerrors.Errorf("Slice value in field t.Mentions was too long")
+
if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.Mentions))); err != nil {
+
for _, v := range t.Mentions {
+
return xerrors.Errorf("Value in field v was too long")
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(v))); err != nil {
+
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 {
+
// t.References ([]string) (slice)
+
if t.References != nil {
+
if len("references") > 1000000 {
+
return xerrors.Errorf("Value in field \"references\" was too long")
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("references"))); err != nil {
+
if _, err := cw.WriteString(string("references")); err != nil {
+
if len(t.References) > 8192 {
+
return xerrors.Errorf("Slice value in field t.References was too long")
+
if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.References))); err != nil {
+
for _, v := range t.References {
+
return xerrors.Errorf("Value in field v was too long")
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(v))); err != nil {
+
if _, err := cw.WriteString(string(v)); err != nil {
···
+
nameBuf := make([]byte, 10)
for i := uint64(0); i < n; i++ {
nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000)
···
t.LexiconTypeID = string(sval)
+
// t.Mentions ([]string) (slice)
+
maj, extra, err = cr.ReadHeader()
+
return fmt.Errorf("t.Mentions: array too large (%d)", extra)
+
if maj != cbg.MajArray {
+
return fmt.Errorf("expected cbor array")
+
t.Mentions = make([]string, extra)
+
for i := 0; i < int(extra); i++ {
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
+
t.Mentions[i] = string(sval)
// t.CreatedAt (string) (string)
···
t.CreatedAt = string(sval)
+
// t.References ([]string) (slice)
+
maj, extra, err = cr.ReadHeader()
+
return fmt.Errorf("t.References: array too large (%d)", extra)
+
if maj != cbg.MajArray {
+
return fmt.Errorf("expected cbor array")
+
t.References = make([]string, extra)
+
for i := 0; i < int(extra); i++ {
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
+
t.References[i] = string(sval)
// Field doesn't exist on this type, so ignore it