···
869
-
func (t *GitRefUpdate) MarshalCBOR(w io.Writer) error {
869
+
func (t *GitRefUpdate_Meta_CommitCount_ByEmail_Elem) MarshalCBOR(w io.Writer) error {
_, err := w.Write(cbg.CborNull)
···
cw := cbg.NewCborWriter(w)
877
-
if _, err := cw.Write([]byte{168}); err != nil {
881
-
// t.Ref (string) (string)
882
-
if len("ref") > 1000000 {
883
-
return xerrors.Errorf("Value in field \"ref\" was too long")
886
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("ref"))); err != nil {
889
-
if _, err := cw.WriteString(string("ref")); err != nil {
893
-
if len(t.Ref) > 1000000 {
894
-
return xerrors.Errorf("Value in field t.Ref was too long")
897
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Ref))); err != nil {
900
-
if _, err := cw.WriteString(string(t.Ref)); err != nil {
904
-
// t.Meta (tangled.GitRefUpdate_Meta) (struct)
905
-
if len("meta") > 1000000 {
906
-
return xerrors.Errorf("Value in field \"meta\" was too long")
909
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("meta"))); err != nil {
912
-
if _, err := cw.WriteString(string("meta")); err != nil {
916
-
if err := t.Meta.MarshalCBOR(cw); err != nil {
920
-
// t.LexiconTypeID (string) (string)
921
-
if len("$type") > 1000000 {
922
-
return xerrors.Errorf("Value in field \"$type\" was too long")
925
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("$type"))); err != nil {
928
-
if _, err := cw.WriteString(string("$type")); err != nil {
932
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("sh.tangled.git.refUpdate"))); err != nil {
935
-
if _, err := cw.WriteString(string("sh.tangled.git.refUpdate")); err != nil {
939
-
// t.NewSha (string) (string)
940
-
if len("newSha") > 1000000 {
941
-
return xerrors.Errorf("Value in field \"newSha\" was too long")
944
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("newSha"))); err != nil {
947
-
if _, err := cw.WriteString(string("newSha")); err != nil {
951
-
if len(t.NewSha) > 1000000 {
952
-
return xerrors.Errorf("Value in field t.NewSha was too long")
955
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.NewSha))); err != nil {
958
-
if _, err := cw.WriteString(string(t.NewSha)); err != nil {
962
-
// t.OldSha (string) (string)
963
-
if len("oldSha") > 1000000 {
964
-
return xerrors.Errorf("Value in field \"oldSha\" was too long")
967
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("oldSha"))); err != nil {
970
-
if _, err := cw.WriteString(string("oldSha")); err != nil {
974
-
if len(t.OldSha) > 1000000 {
975
-
return xerrors.Errorf("Value in field t.OldSha was too long")
978
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.OldSha))); err != nil {
981
-
if _, err := cw.WriteString(string(t.OldSha)); err != nil {
985
-
// t.RepoDid (string) (string)
986
-
if len("repoDid") > 1000000 {
987
-
return xerrors.Errorf("Value in field \"repoDid\" was too long")
990
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("repoDid"))); err != nil {
993
-
if _, err := cw.WriteString(string("repoDid")); err != nil {
877
+
if _, err := cw.Write([]byte{162}); err != nil {
997
-
if len(t.RepoDid) > 1000000 {
998
-
return xerrors.Errorf("Value in field t.RepoDid was too long")
881
+
// t.Count (int64) (int64)
882
+
if len("count") > 1000000 {
883
+
return xerrors.Errorf("Value in field \"count\" was too long")
1001
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.RepoDid))); err != nil {
886
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("count"))); err != nil {
1004
-
if _, err := cw.WriteString(string(t.RepoDid)); err != nil {
889
+
if _, err := cw.WriteString(string("count")); err != nil {
1008
-
// t.RepoName (string) (string)
1009
-
if len("repoName") > 1000000 {
1010
-
return xerrors.Errorf("Value in field \"repoName\" was too long")
1013
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("repoName"))); err != nil {
1016
-
if _, err := cw.WriteString(string("repoName")); err != nil {
1020
-
if len(t.RepoName) > 1000000 {
1021
-
return xerrors.Errorf("Value in field t.RepoName was too long")
1024
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.RepoName))); err != nil {
1027
-
if _, err := cw.WriteString(string(t.RepoName)); err != nil {
894
+
if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.Count)); err != nil {
898
+
if err := cw.WriteMajorTypeHeader(cbg.MajNegativeInt, uint64(-t.Count-1)); err != nil {
1031
-
// t.CommitterDid (string) (string)
1032
-
if len("committerDid") > 1000000 {
1033
-
return xerrors.Errorf("Value in field \"committerDid\" was too long")
903
+
// t.Email (string) (string)
904
+
if len("email") > 1000000 {
905
+
return xerrors.Errorf("Value in field \"email\" was too long")
1036
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("committerDid"))); err != nil {
908
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("email"))); err != nil {
1039
-
if _, err := cw.WriteString(string("committerDid")); err != nil {
911
+
if _, err := cw.WriteString(string("email")); err != nil {
1043
-
if len(t.CommitterDid) > 1000000 {
1044
-
return xerrors.Errorf("Value in field t.CommitterDid was too long")
915
+
if len(t.Email) > 1000000 {
916
+
return xerrors.Errorf("Value in field t.Email was too long")
1047
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.CommitterDid))); err != nil {
919
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Email))); err != nil {
1050
-
if _, err := cw.WriteString(string(t.CommitterDid)); err != nil {
922
+
if _, err := cw.WriteString(string(t.Email)); err != nil {
1056
-
func (t *GitRefUpdate) UnmarshalCBOR(r io.Reader) (err error) {
1057
-
*t = GitRefUpdate{}
928
+
func (t *GitRefUpdate_Meta_CommitCount_ByEmail_Elem) UnmarshalCBOR(r io.Reader) (err error) {
929
+
*t = GitRefUpdate_Meta_CommitCount_ByEmail_Elem{}
cr := cbg.NewCborReader(r)
···
if extra > cbg.MaxLength {
1076
-
return fmt.Errorf("GitRefUpdate: map struct too large (%d)", extra)
948
+
return fmt.Errorf("GitRefUpdate_Meta_CommitCount_ByEmail_Elem: map struct too large (%d)", extra)
1081
-
nameBuf := make([]byte, 12)
953
+
nameBuf := make([]byte, 5)
for i := uint64(0); i < n; i++ {
nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000)
···
switch string(nameBuf[:nameLen]) {
1097
-
// t.Ref (string) (string)
969
+
// t.Count (int64) (int64)
1101
-
sval, err := cbg.ReadStringWithMax(cr, 1000000)
1106
-
t.Ref = string(sval)
1108
-
// t.Meta (tangled.GitRefUpdate_Meta) (struct)
1113
-
b, err := cr.ReadByte()
972
+
maj, extra, err := cr.ReadHeader()
1117
-
if b != cbg.CborNull[0] {
1118
-
if err := cr.UnreadByte(); err != nil {
978
+
case cbg.MajUnsignedInt:
979
+
extraI = int64(extra)
981
+
return fmt.Errorf("int64 positive overflow")
1121
-
t.Meta = new(GitRefUpdate_Meta)
1122
-
if err := t.Meta.UnmarshalCBOR(cr); err != nil {
1123
-
return xerrors.Errorf("unmarshaling t.Meta pointer: %w", err)
983
+
case cbg.MajNegativeInt:
984
+
extraI = int64(extra)
986
+
return fmt.Errorf("int64 negative overflow")
1128
-
// t.LexiconTypeID (string) (string)
1132
-
sval, err := cbg.ReadStringWithMax(cr, 1000000)
1137
-
t.LexiconTypeID = string(sval)
1139
-
// t.NewSha (string) (string)
1143
-
sval, err := cbg.ReadStringWithMax(cr, 1000000)
1148
-
t.NewSha = string(sval)
1150
-
// t.OldSha (string) (string)
1154
-
sval, err := cbg.ReadStringWithMax(cr, 1000000)
1159
-
t.OldSha = string(sval)
1161
-
// t.RepoDid (string) (string)
1165
-
sval, err := cbg.ReadStringWithMax(cr, 1000000)
988
+
extraI = -1 - extraI
990
+
return fmt.Errorf("wrong type for int64 field: %d", maj)
1170
-
t.RepoDid = string(sval)
993
+
t.Count = int64(extraI)
1172
-
// t.RepoName (string) (string)
995
+
// t.Email (string) (string)
sval, err := cbg.ReadStringWithMax(cr, 1000000)
···
1181
-
t.RepoName = string(sval)
1183
-
// t.CommitterDid (string) (string)
1184
-
case "committerDid":
1187
-
sval, err := cbg.ReadStringWithMax(cr, 1000000)
1192
-
t.CommitterDid = string(sval)
1004
+
t.Email = string(sval)
···
1205
-
func (t *GitRefUpdate_Meta) MarshalCBOR(w io.Writer) error {
1017
+
func (t *GitRefUpdate_Meta_CommitCount) MarshalCBOR(w io.Writer) error {
_, err := w.Write(cbg.CborNull)
cw := cbg.NewCborWriter(w)
1214
-
if t.LangBreakdown == nil {
1026
+
if t.ByEmail == nil {
···
1222
-
// t.CommitCount (tangled.GitRefUpdate_Meta_CommitCount) (struct)
1223
-
if len("commitCount") > 1000000 {
1224
-
return xerrors.Errorf("Value in field \"commitCount\" was too long")
1227
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("commitCount"))); err != nil {
1230
-
if _, err := cw.WriteString(string("commitCount")); err != nil {
1234
-
if err := t.CommitCount.MarshalCBOR(cw); err != nil {
1238
-
// t.IsDefaultRef (bool) (bool)
1239
-
if len("isDefaultRef") > 1000000 {
1240
-
return xerrors.Errorf("Value in field \"isDefaultRef\" was too long")
1243
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("isDefaultRef"))); err != nil {
1246
-
if _, err := cw.WriteString(string("isDefaultRef")); err != nil {
1250
-
if err := cbg.WriteBool(w, t.IsDefaultRef); err != nil {
1034
+
// t.ByEmail ([]*tangled.GitRefUpdate_Meta_CommitCount_ByEmail_Elem) (slice)
1035
+
if t.ByEmail != nil {
1254
-
// t.LangBreakdown (tangled.GitRefUpdate_Meta_LangBreakdown) (struct)
1255
-
if t.LangBreakdown != nil {
1257
-
if len("langBreakdown") > 1000000 {
1258
-
return xerrors.Errorf("Value in field \"langBreakdown\" was too long")
1037
+
if len("byEmail") > 1000000 {
1038
+
return xerrors.Errorf("Value in field \"byEmail\" was too long")
1261
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("langBreakdown"))); err != nil {
1041
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("byEmail"))); err != nil {
1264
-
if _, err := cw.WriteString(string("langBreakdown")); err != nil {
1044
+
if _, err := cw.WriteString(string("byEmail")); err != nil {
1268
-
if err := t.LangBreakdown.MarshalCBOR(cw); err != nil {
1048
+
if len(t.ByEmail) > 8192 {
1049
+
return xerrors.Errorf("Slice value in field t.ByEmail was too long")
1052
+
if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.ByEmail))); err != nil {
1055
+
for _, v := range t.ByEmail {
1056
+
if err := v.MarshalCBOR(cw); err != nil {
1275
-
func (t *GitRefUpdate_Meta) UnmarshalCBOR(r io.Reader) (err error) {
1276
-
*t = GitRefUpdate_Meta{}
1065
+
func (t *GitRefUpdate_Meta_CommitCount) UnmarshalCBOR(r io.Reader) (err error) {
1066
+
*t = GitRefUpdate_Meta_CommitCount{}
cr := cbg.NewCborReader(r)
···
if extra > cbg.MaxLength {
1295
-
return fmt.Errorf("GitRefUpdate_Meta: map struct too large (%d)", extra)
1085
+
return fmt.Errorf("GitRefUpdate_Meta_CommitCount: map struct too large (%d)", extra)
1300
-
nameBuf := make([]byte, 13)
1090
+
nameBuf := make([]byte, 7)
for i := uint64(0); i < n; i++ {
nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000)
···
switch string(nameBuf[:nameLen]) {
1316
-
// t.CommitCount (tangled.GitRefUpdate_Meta_CommitCount) (struct)
1317
-
case "commitCount":
1321
-
b, err := cr.ReadByte()
1325
-
if b != cbg.CborNull[0] {
1326
-
if err := cr.UnreadByte(); err != nil {
1329
-
t.CommitCount = new(GitRefUpdate_Meta_CommitCount)
1330
-
if err := t.CommitCount.UnmarshalCBOR(cr); err != nil {
1331
-
return xerrors.Errorf("unmarshaling t.CommitCount pointer: %w", err)
1336
-
// t.IsDefaultRef (bool) (bool)
1337
-
case "isDefaultRef":
1106
+
// t.ByEmail ([]*tangled.GitRefUpdate_Meta_CommitCount_ByEmail_Elem) (slice)
maj, extra, err = cr.ReadHeader()
1343
-
if maj != cbg.MajOther {
1344
-
return fmt.Errorf("booleans must be major type 7")
1115
+
return fmt.Errorf("t.ByEmail: array too large (%d)", extra)
1348
-
t.IsDefaultRef = false
1350
-
t.IsDefaultRef = true
1352
-
return fmt.Errorf("booleans are either major type 7, value 20 or 21 (got %d)", extra)
1118
+
if maj != cbg.MajArray {
1119
+
return fmt.Errorf("expected cbor array")
1354
-
// t.LangBreakdown (tangled.GitRefUpdate_Meta_LangBreakdown) (struct)
1355
-
case "langBreakdown":
1123
+
t.ByEmail = make([]*GitRefUpdate_Meta_CommitCount_ByEmail_Elem, extra)
1359
-
b, err := cr.ReadByte()
1363
-
if b != cbg.CborNull[0] {
1364
-
if err := cr.UnreadByte(); err != nil {
1367
-
t.LangBreakdown = new(GitRefUpdate_Meta_LangBreakdown)
1368
-
if err := t.LangBreakdown.UnmarshalCBOR(cr); err != nil {
1369
-
return xerrors.Errorf("unmarshaling t.LangBreakdown pointer: %w", err)
1126
+
for i := 0; i < int(extra); i++ {
1137
+
b, err := cr.ReadByte()
1141
+
if b != cbg.CborNull[0] {
1142
+
if err := cr.UnreadByte(); err != nil {
1145
+
t.ByEmail[i] = new(GitRefUpdate_Meta_CommitCount_ByEmail_Elem)
1146
+
if err := t.ByEmail[i].UnmarshalCBOR(cr); err != nil {
1147
+
return xerrors.Errorf("unmarshaling t.ByEmail[i] pointer: %w", err)
···
1385
-
func (t *GitRefUpdate_Meta_CommitCount) MarshalCBOR(w io.Writer) error {
1166
+
func (t *GitRefUpdate_Meta_LangBreakdown) MarshalCBOR(w io.Writer) error {
_, err := w.Write(cbg.CborNull)
···
cw := cbg.NewCborWriter(w)
1394
-
if t.ByEmail == nil {
1175
+
if t.Inputs == nil {
···
1402
-
// t.ByEmail ([]*tangled.GitRefUpdate_Meta_CommitCount_ByEmail_Elem) (slice)
1403
-
if t.ByEmail != nil {
1183
+
// t.Inputs ([]*tangled.GitRefUpdate_Pair) (slice)
1184
+
if t.Inputs != nil {
1405
-
if len("byEmail") > 1000000 {
1406
-
return xerrors.Errorf("Value in field \"byEmail\" was too long")
1186
+
if len("inputs") > 1000000 {
1187
+
return xerrors.Errorf("Value in field \"inputs\" was too long")
1409
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("byEmail"))); err != nil {
1190
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("inputs"))); err != nil {
1412
-
if _, err := cw.WriteString(string("byEmail")); err != nil {
1193
+
if _, err := cw.WriteString(string("inputs")); err != nil {
1416
-
if len(t.ByEmail) > 8192 {
1417
-
return xerrors.Errorf("Slice value in field t.ByEmail was too long")
1197
+
if len(t.Inputs) > 8192 {
1198
+
return xerrors.Errorf("Slice value in field t.Inputs was too long")
1420
-
if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.ByEmail))); err != nil {
1201
+
if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.Inputs))); err != nil {
1423
-
for _, v := range t.ByEmail {
1204
+
for _, v := range t.Inputs {
if err := v.MarshalCBOR(cw); err != nil {
···
1433
-
func (t *GitRefUpdate_Meta_CommitCount) UnmarshalCBOR(r io.Reader) (err error) {
1434
-
*t = GitRefUpdate_Meta_CommitCount{}
1214
+
func (t *GitRefUpdate_Meta_LangBreakdown) UnmarshalCBOR(r io.Reader) (err error) {
1215
+
*t = GitRefUpdate_Meta_LangBreakdown{}
cr := cbg.NewCborReader(r)
···
if extra > cbg.MaxLength {
1453
-
return fmt.Errorf("GitRefUpdate_Meta_CommitCount: map struct too large (%d)", extra)
1234
+
return fmt.Errorf("GitRefUpdate_Meta_LangBreakdown: map struct too large (%d)", extra)
1458
-
nameBuf := make([]byte, 7)
1239
+
nameBuf := make([]byte, 6)
for i := uint64(0); i < n; i++ {
nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000)
···
switch string(nameBuf[:nameLen]) {
1474
-
// t.ByEmail ([]*tangled.GitRefUpdate_Meta_CommitCount_ByEmail_Elem) (slice)
1255
+
// t.Inputs ([]*tangled.GitRefUpdate_Pair) (slice)
maj, extra, err = cr.ReadHeader()
···
1483
-
return fmt.Errorf("t.ByEmail: array too large (%d)", extra)
1264
+
return fmt.Errorf("t.Inputs: array too large (%d)", extra)
···
1491
-
t.ByEmail = make([]*GitRefUpdate_Meta_CommitCount_ByEmail_Elem, extra)
1272
+
t.Inputs = make([]*GitRefUpdate_Pair, extra)
for i := 0; i < int(extra); i++ {
···
if err := cr.UnreadByte(); err != nil {
1513
-
t.ByEmail[i] = new(GitRefUpdate_Meta_CommitCount_ByEmail_Elem)
1514
-
if err := t.ByEmail[i].UnmarshalCBOR(cr); err != nil {
1515
-
return xerrors.Errorf("unmarshaling t.ByEmail[i] pointer: %w", err)
1294
+
t.Inputs[i] = new(GitRefUpdate_Pair)
1295
+
if err := t.Inputs[i].UnmarshalCBOR(cr); err != nil {
1296
+
return xerrors.Errorf("unmarshaling t.Inputs[i] pointer: %w", err)
···
1534
-
func (t *GitRefUpdate_Meta_CommitCount_ByEmail_Elem) MarshalCBOR(w io.Writer) error {
1315
+
func (t *GitRefUpdate_Meta) MarshalCBOR(w io.Writer) error {
_, err := w.Write(cbg.CborNull)
cw := cbg.NewCborWriter(w)
1542
-
if _, err := cw.Write([]byte{162}); err != nil {
1324
+
if t.LangBreakdown == nil {
1328
+
if _, err := cw.Write(cbg.CborEncodeMajorType(cbg.MajMap, uint64(fieldCount))); err != nil {
1546
-
// t.Count (int64) (int64)
1547
-
if len("count") > 1000000 {
1548
-
return xerrors.Errorf("Value in field \"count\" was too long")
1332
+
// t.CommitCount (tangled.GitRefUpdate_Meta_CommitCount) (struct)
1333
+
if len("commitCount") > 1000000 {
1334
+
return xerrors.Errorf("Value in field \"commitCount\" was too long")
1551
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("count"))); err != nil {
1337
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("commitCount"))); err != nil {
1554
-
if _, err := cw.WriteString(string("count")); err != nil {
1340
+
if _, err := cw.WriteString(string("commitCount")); err != nil {
1559
-
if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.Count)); err != nil {
1563
-
if err := cw.WriteMajorTypeHeader(cbg.MajNegativeInt, uint64(-t.Count-1)); err != nil {
1344
+
if err := t.CommitCount.MarshalCBOR(cw); err != nil {
1568
-
// t.Email (string) (string)
1569
-
if len("email") > 1000000 {
1570
-
return xerrors.Errorf("Value in field \"email\" was too long")
1348
+
// t.IsDefaultRef (bool) (bool)
1349
+
if len("isDefaultRef") > 1000000 {
1350
+
return xerrors.Errorf("Value in field \"isDefaultRef\" was too long")
1573
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("email"))); err != nil {
1353
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("isDefaultRef"))); err != nil {
1576
-
if _, err := cw.WriteString(string("email")); err != nil {
1356
+
if _, err := cw.WriteString(string("isDefaultRef")); err != nil {
1580
-
if len(t.Email) > 1000000 {
1581
-
return xerrors.Errorf("Value in field t.Email was too long")
1360
+
if err := cbg.WriteBool(w, t.IsDefaultRef); err != nil {
1584
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Email))); err != nil {
1587
-
if _, err := cw.WriteString(string(t.Email)); err != nil {
1364
+
// t.LangBreakdown (tangled.GitRefUpdate_Meta_LangBreakdown) (struct)
1365
+
if t.LangBreakdown != nil {
1367
+
if len("langBreakdown") > 1000000 {
1368
+
return xerrors.Errorf("Value in field \"langBreakdown\" was too long")
1371
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("langBreakdown"))); err != nil {
1374
+
if _, err := cw.WriteString(string("langBreakdown")); err != nil {
1378
+
if err := t.LangBreakdown.MarshalCBOR(cw); err != nil {
1593
-
func (t *GitRefUpdate_Meta_CommitCount_ByEmail_Elem) UnmarshalCBOR(r io.Reader) (err error) {
1594
-
*t = GitRefUpdate_Meta_CommitCount_ByEmail_Elem{}
1385
+
func (t *GitRefUpdate_Meta) UnmarshalCBOR(r io.Reader) (err error) {
1386
+
*t = GitRefUpdate_Meta{}
cr := cbg.NewCborReader(r)
···
if extra > cbg.MaxLength {
1613
-
return fmt.Errorf("GitRefUpdate_Meta_CommitCount_ByEmail_Elem: map struct too large (%d)", extra)
1405
+
return fmt.Errorf("GitRefUpdate_Meta: map struct too large (%d)", extra)
1618
-
nameBuf := make([]byte, 5)
1410
+
nameBuf := make([]byte, 13)
for i := uint64(0); i < n; i++ {
nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000)
···
switch string(nameBuf[:nameLen]) {
1634
-
// t.Count (int64) (int64)
1426
+
// t.CommitCount (tangled.GitRefUpdate_Meta_CommitCount) (struct)
1427
+
case "commitCount":
1637
-
maj, extra, err := cr.ReadHeader()
1431
+
b, err := cr.ReadByte()
1643
-
case cbg.MajUnsignedInt:
1644
-
extraI = int64(extra)
1646
-
return fmt.Errorf("int64 positive overflow")
1435
+
if b != cbg.CborNull[0] {
1436
+
if err := cr.UnreadByte(); err != nil {
1648
-
case cbg.MajNegativeInt:
1649
-
extraI = int64(extra)
1651
-
return fmt.Errorf("int64 negative overflow")
1439
+
t.CommitCount = new(GitRefUpdate_Meta_CommitCount)
1440
+
if err := t.CommitCount.UnmarshalCBOR(cr); err != nil {
1441
+
return xerrors.Errorf("unmarshaling t.CommitCount pointer: %w", err)
1653
-
extraI = -1 - extraI
1655
-
return fmt.Errorf("wrong type for int64 field: %d", maj)
1658
-
t.Count = int64(extraI)
1446
+
// t.IsDefaultRef (bool) (bool)
1447
+
case "isDefaultRef":
1449
+
maj, extra, err = cr.ReadHeader()
1453
+
if maj != cbg.MajOther {
1454
+
return fmt.Errorf("booleans must be major type 7")
1458
+
t.IsDefaultRef = false
1460
+
t.IsDefaultRef = true
1462
+
return fmt.Errorf("booleans are either major type 7, value 20 or 21 (got %d)", extra)
1660
-
// t.Email (string) (string)
1464
+
// t.LangBreakdown (tangled.GitRefUpdate_Meta_LangBreakdown) (struct)
1465
+
case "langBreakdown":
1664
-
sval, err := cbg.ReadStringWithMax(cr, 1000000)
1469
+
b, err := cr.ReadByte()
1473
+
if b != cbg.CborNull[0] {
1474
+
if err := cr.UnreadByte(); err != nil {
1477
+
t.LangBreakdown = new(GitRefUpdate_Meta_LangBreakdown)
1478
+
if err := t.LangBreakdown.UnmarshalCBOR(cr); err != nil {
1479
+
return xerrors.Errorf("unmarshaling t.LangBreakdown pointer: %w", err)
1669
-
t.Email = string(sval)
···
1682
-
func (t *GitRefUpdate_Meta_LangBreakdown) MarshalCBOR(w io.Writer) error {
1495
+
func (t *GitRefUpdate_Pair) MarshalCBOR(w io.Writer) error {
_, err := w.Write(cbg.CborNull)
cw := cbg.NewCborWriter(w)
1503
+
if _, err := cw.Write([]byte{162}); err != nil {
1691
-
if t.Inputs == nil {
1507
+
// t.Lang (string) (string)
1508
+
if len("lang") > 1000000 {
1509
+
return xerrors.Errorf("Value in field \"lang\" was too long")
1695
-
if _, err := cw.Write(cbg.CborEncodeMajorType(cbg.MajMap, uint64(fieldCount))); err != nil {
1512
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("lang"))); err != nil {
1515
+
if _, err := cw.WriteString(string("lang")); err != nil {
1699
-
// t.Inputs ([]*tangled.GitRefUpdate_Pair) (slice)
1700
-
if t.Inputs != nil {
1519
+
if len(t.Lang) > 1000000 {
1520
+
return xerrors.Errorf("Value in field t.Lang was too long")
1702
-
if len("inputs") > 1000000 {
1703
-
return xerrors.Errorf("Value in field \"inputs\" was too long")
1523
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Lang))); err != nil {
1526
+
if _, err := cw.WriteString(string(t.Lang)); err != nil {
1706
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("inputs"))); err != nil {
1709
-
if _, err := cw.WriteString(string("inputs")); err != nil {
1530
+
// t.Size (int64) (int64)
1531
+
if len("size") > 1000000 {
1532
+
return xerrors.Errorf("Value in field \"size\" was too long")
1713
-
if len(t.Inputs) > 8192 {
1714
-
return xerrors.Errorf("Slice value in field t.Inputs was too long")
1535
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("size"))); err != nil {
1538
+
if _, err := cw.WriteString(string("size")); err != nil {
1717
-
if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.Inputs))); err != nil {
1543
+
if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.Size)); err != nil {
1720
-
for _, v := range t.Inputs {
1721
-
if err := v.MarshalCBOR(cw); err != nil {
1547
+
if err := cw.WriteMajorTypeHeader(cbg.MajNegativeInt, uint64(-t.Size-1)); err != nil {
1730
-
func (t *GitRefUpdate_Meta_LangBreakdown) UnmarshalCBOR(r io.Reader) (err error) {
1731
-
*t = GitRefUpdate_Meta_LangBreakdown{}
1555
+
func (t *GitRefUpdate_Pair) UnmarshalCBOR(r io.Reader) (err error) {
1556
+
*t = GitRefUpdate_Pair{}
cr := cbg.NewCborReader(r)
···
if extra > cbg.MaxLength {
1750
-
return fmt.Errorf("GitRefUpdate_Meta_LangBreakdown: map struct too large (%d)", extra)
1575
+
return fmt.Errorf("GitRefUpdate_Pair: map struct too large (%d)", extra)
1755
-
nameBuf := make([]byte, 6)
1580
+
nameBuf := make([]byte, 4)
for i := uint64(0); i < n; i++ {
nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000)
···
switch string(nameBuf[:nameLen]) {
1771
-
// t.Inputs ([]*tangled.GitRefUpdate_Pair) (slice)
1774
-
maj, extra, err = cr.ReadHeader()
1596
+
// t.Lang (string) (string)
1780
-
return fmt.Errorf("t.Inputs: array too large (%d)", extra)
1600
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
1783
-
if maj != cbg.MajArray {
1784
-
return fmt.Errorf("expected cbor array")
1605
+
t.Lang = string(sval)
1788
-
t.Inputs = make([]*GitRefUpdate_Pair, extra)
1791
-
for i := 0; i < int(extra); i++ {
1802
-
b, err := cr.ReadByte()
1806
-
if b != cbg.CborNull[0] {
1807
-
if err := cr.UnreadByte(); err != nil {
1810
-
t.Inputs[i] = new(GitRefUpdate_Pair)
1811
-
if err := t.Inputs[i].UnmarshalCBOR(cr); err != nil {
1812
-
return xerrors.Errorf("unmarshaling t.Inputs[i] pointer: %w", err)
1607
+
// t.Size (int64) (int64)
1610
+
maj, extra, err := cr.ReadHeader()
1616
+
case cbg.MajUnsignedInt:
1617
+
extraI = int64(extra)
1619
+
return fmt.Errorf("int64 positive overflow")
1621
+
case cbg.MajNegativeInt:
1622
+
extraI = int64(extra)
1624
+
return fmt.Errorf("int64 negative overflow")
1626
+
extraI = -1 - extraI
1628
+
return fmt.Errorf("wrong type for int64 field: %d", maj)
1631
+
t.Size = int64(extraI)
···
1831
-
func (t *GitRefUpdate_Pair) MarshalCBOR(w io.Writer) error {
1644
+
func (t *GitRefUpdate) MarshalCBOR(w io.Writer) error {
_, err := w.Write(cbg.CborNull)
···
cw := cbg.NewCborWriter(w)
1839
-
if _, err := cw.Write([]byte{162}); err != nil {
1652
+
if _, err := cw.Write([]byte{168}); err != nil {
1843
-
// t.Lang (string) (string)
1844
-
if len("lang") > 1000000 {
1845
-
return xerrors.Errorf("Value in field \"lang\" was too long")
1656
+
// t.Ref (string) (string)
1657
+
if len("ref") > 1000000 {
1658
+
return xerrors.Errorf("Value in field \"ref\" was too long")
1848
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("lang"))); err != nil {
1661
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("ref"))); err != nil {
1851
-
if _, err := cw.WriteString(string("lang")); err != nil {
1664
+
if _, err := cw.WriteString(string("ref")); err != nil {
1855
-
if len(t.Lang) > 1000000 {
1856
-
return xerrors.Errorf("Value in field t.Lang was too long")
1668
+
if len(t.Ref) > 1000000 {
1669
+
return xerrors.Errorf("Value in field t.Ref was too long")
1859
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Lang))); err != nil {
1672
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Ref))); err != nil {
1862
-
if _, err := cw.WriteString(string(t.Lang)); err != nil {
1675
+
if _, err := cw.WriteString(string(t.Ref)); err != nil {
1866
-
// t.Size (int64) (int64)
1867
-
if len("size") > 1000000 {
1868
-
return xerrors.Errorf("Value in field \"size\" was too long")
1679
+
// t.Meta (tangled.GitRefUpdate_Meta) (struct)
1680
+
if len("meta") > 1000000 {
1681
+
return xerrors.Errorf("Value in field \"meta\" was too long")
1871
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("size"))); err != nil {
1684
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("meta"))); err != nil {
1687
+
if _, err := cw.WriteString(string("meta")); err != nil {
1874
-
if _, err := cw.WriteString(string("size")); err != nil {
1691
+
if err := t.Meta.MarshalCBOR(cw); err != nil {
1879
-
if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.Size)); err != nil {
1883
-
if err := cw.WriteMajorTypeHeader(cbg.MajNegativeInt, uint64(-t.Size-1)); err != nil {
1695
+
// t.LexiconTypeID (string) (string)
1696
+
if len("$type") > 1000000 {
1697
+
return xerrors.Errorf("Value in field \"$type\" was too long")
1700
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("$type"))); err != nil {
1703
+
if _, err := cw.WriteString(string("$type")); err != nil {
1707
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("sh.tangled.git.refUpdate"))); err != nil {
1710
+
if _, err := cw.WriteString(string("sh.tangled.git.refUpdate")); err != nil {
1714
+
// t.NewSha (string) (string)
1715
+
if len("newSha") > 1000000 {
1716
+
return xerrors.Errorf("Value in field \"newSha\" was too long")
1719
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("newSha"))); err != nil {
1722
+
if _, err := cw.WriteString(string("newSha")); err != nil {
1726
+
if len(t.NewSha) > 1000000 {
1727
+
return xerrors.Errorf("Value in field t.NewSha was too long")
1730
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.NewSha))); err != nil {
1733
+
if _, err := cw.WriteString(string(t.NewSha)); err != nil {
1737
+
// t.OldSha (string) (string)
1738
+
if len("oldSha") > 1000000 {
1739
+
return xerrors.Errorf("Value in field \"oldSha\" was too long")
1742
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("oldSha"))); err != nil {
1745
+
if _, err := cw.WriteString(string("oldSha")); err != nil {
1749
+
if len(t.OldSha) > 1000000 {
1750
+
return xerrors.Errorf("Value in field t.OldSha was too long")
1753
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.OldSha))); err != nil {
1756
+
if _, err := cw.WriteString(string(t.OldSha)); err != nil {
1760
+
// t.RepoDid (string) (string)
1761
+
if len("repoDid") > 1000000 {
1762
+
return xerrors.Errorf("Value in field \"repoDid\" was too long")
1765
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("repoDid"))); err != nil {
1768
+
if _, err := cw.WriteString(string("repoDid")); err != nil {
1772
+
if len(t.RepoDid) > 1000000 {
1773
+
return xerrors.Errorf("Value in field t.RepoDid was too long")
1776
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.RepoDid))); err != nil {
1779
+
if _, err := cw.WriteString(string(t.RepoDid)); err != nil {
1783
+
// t.RepoName (string) (string)
1784
+
if len("repoName") > 1000000 {
1785
+
return xerrors.Errorf("Value in field \"repoName\" was too long")
1788
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("repoName"))); err != nil {
1791
+
if _, err := cw.WriteString(string("repoName")); err != nil {
1795
+
if len(t.RepoName) > 1000000 {
1796
+
return xerrors.Errorf("Value in field t.RepoName was too long")
1799
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.RepoName))); err != nil {
1802
+
if _, err := cw.WriteString(string(t.RepoName)); err != nil {
1806
+
// t.CommitterDid (string) (string)
1807
+
if len("committerDid") > 1000000 {
1808
+
return xerrors.Errorf("Value in field \"committerDid\" was too long")
1811
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("committerDid"))); err != nil {
1814
+
if _, err := cw.WriteString(string("committerDid")); err != nil {
1818
+
if len(t.CommitterDid) > 1000000 {
1819
+
return xerrors.Errorf("Value in field t.CommitterDid was too long")
1822
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.CommitterDid))); err != nil {
1825
+
if _, err := cw.WriteString(string(t.CommitterDid)); err != nil {
1891
-
func (t *GitRefUpdate_Pair) UnmarshalCBOR(r io.Reader) (err error) {
1892
-
*t = GitRefUpdate_Pair{}
1831
+
func (t *GitRefUpdate) UnmarshalCBOR(r io.Reader) (err error) {
1832
+
*t = GitRefUpdate{}
cr := cbg.NewCborReader(r)
···
if extra > cbg.MaxLength {
1911
-
return fmt.Errorf("GitRefUpdate_Pair: map struct too large (%d)", extra)
1851
+
return fmt.Errorf("GitRefUpdate: map struct too large (%d)", extra)
1916
-
nameBuf := make([]byte, 4)
1856
+
nameBuf := make([]byte, 12)
for i := uint64(0); i < n; i++ {
nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000)
···
switch string(nameBuf[:nameLen]) {
1932
-
// t.Lang (string) (string)
1872
+
// t.Ref (string) (string)
sval, err := cbg.ReadStringWithMax(cr, 1000000)
···
1941
-
t.Lang = string(sval)
1881
+
t.Ref = string(sval)
1943
-
// t.Size (int64) (int64)
1883
+
// t.Meta (tangled.GitRefUpdate_Meta) (struct)
1946
-
maj, extra, err := cr.ReadHeader()
1888
+
b, err := cr.ReadByte()
1952
-
case cbg.MajUnsignedInt:
1953
-
extraI = int64(extra)
1955
-
return fmt.Errorf("int64 positive overflow")
1892
+
if b != cbg.CborNull[0] {
1893
+
if err := cr.UnreadByte(); err != nil {
1957
-
case cbg.MajNegativeInt:
1958
-
extraI = int64(extra)
1960
-
return fmt.Errorf("int64 negative overflow")
1896
+
t.Meta = new(GitRefUpdate_Meta)
1897
+
if err := t.Meta.UnmarshalCBOR(cr); err != nil {
1898
+
return xerrors.Errorf("unmarshaling t.Meta pointer: %w", err)
1962
-
extraI = -1 - extraI
1964
-
return fmt.Errorf("wrong type for int64 field: %d", maj)
1967
-
t.Size = int64(extraI)
1903
+
// t.LexiconTypeID (string) (string)
1907
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
1912
+
t.LexiconTypeID = string(sval)
1914
+
// t.NewSha (string) (string)
1918
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
1923
+
t.NewSha = string(sval)
1925
+
// t.OldSha (string) (string)
1929
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
1934
+
t.OldSha = string(sval)
1936
+
// t.RepoDid (string) (string)
1940
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
1945
+
t.RepoDid = string(sval)
1947
+
// t.RepoName (string) (string)
1951
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
1956
+
t.RepoName = string(sval)
1958
+
// t.CommitterDid (string) (string)
1959
+
case "committerDid":
1962
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
1967
+
t.CommitterDid = string(sval)
···
2342
-
func (t *Pipeline) MarshalCBOR(w io.Writer) error {
2342
+
func (t *Knot) MarshalCBOR(w io.Writer) error {
_, err := w.Write(cbg.CborNull)
···
cw := cbg.NewCborWriter(w)
2350
-
if _, err := cw.Write([]byte{163}); err != nil {
2350
+
if _, err := cw.Write([]byte{162}); err != nil {
···
2366
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("sh.tangled.pipeline"))); err != nil {
2366
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("sh.tangled.knot"))); err != nil {
2369
-
if _, err := cw.WriteString(string("sh.tangled.pipeline")); err != nil {
2369
+
if _, err := cw.WriteString(string("sh.tangled.knot")); err != nil {
2373
-
// t.Workflows ([]*tangled.Pipeline_Workflow) (slice)
2374
-
if len("workflows") > 1000000 {
2375
-
return xerrors.Errorf("Value in field \"workflows\" was too long")
2373
+
// t.CreatedAt (string) (string)
2374
+
if len("createdAt") > 1000000 {
2375
+
return xerrors.Errorf("Value in field \"createdAt\" was too long")
2378
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("workflows"))); err != nil {
2378
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("createdAt"))); err != nil {
2381
-
if _, err := cw.WriteString(string("workflows")); err != nil {
2381
+
if _, err := cw.WriteString(string("createdAt")); err != nil {
2385
-
if len(t.Workflows) > 8192 {
2386
-
return xerrors.Errorf("Slice value in field t.Workflows was too long")
2385
+
if len(t.CreatedAt) > 1000000 {
2386
+
return xerrors.Errorf("Value in field t.CreatedAt was too long")
2389
-
if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.Workflows))); err != nil {
2389
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.CreatedAt))); err != nil {
2392
+
if _, err := cw.WriteString(string(t.CreatedAt)); err != nil {
2398
+
func (t *Knot) UnmarshalCBOR(r io.Reader) (err error) {
2401
+
cr := cbg.NewCborReader(r)
2403
+
maj, extra, err := cr.ReadHeader()
2392
-
for _, v := range t.Workflows {
2393
-
if err := v.MarshalCBOR(cw); err != nil {
2408
+
if err == io.EOF {
2409
+
err = io.ErrUnexpectedEOF
2413
+
if maj != cbg.MajMap {
2414
+
return fmt.Errorf("cbor input should be of type map")
2417
+
if extra > cbg.MaxLength {
2418
+
return fmt.Errorf("Knot: map struct too large (%d)", extra)
2423
+
nameBuf := make([]byte, 9)
2424
+
for i := uint64(0); i < n; i++ {
2425
+
nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000)
2431
+
// Field doesn't exist on this type, so ignore it
2432
+
if err := cbg.ScanForLinks(cr, func(cid.Cid) {}); err != nil {
2438
+
switch string(nameBuf[:nameLen]) {
2439
+
// t.LexiconTypeID (string) (string)
2443
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
2448
+
t.LexiconTypeID = string(sval)
2450
+
// t.CreatedAt (string) (string)
2454
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
2459
+
t.CreatedAt = string(sval)
2463
+
// Field doesn't exist on this type, so ignore it
2464
+
if err := cbg.ScanForLinks(r, func(cid.Cid) {}); err != nil {
2399
-
// t.TriggerMetadata (tangled.Pipeline_TriggerMetadata) (struct)
2400
-
if len("triggerMetadata") > 1000000 {
2401
-
return xerrors.Errorf("Value in field \"triggerMetadata\" was too long")
2472
+
func (t *PipelineStatus) MarshalCBOR(w io.Writer) error {
2474
+
_, err := w.Write(cbg.CborNull)
2404
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("triggerMetadata"))); err != nil {
2478
+
cw := cbg.NewCborWriter(w)
2481
+
if t.Error == nil {
2485
+
if t.ExitCode == nil {
2489
+
if _, err := cw.Write(cbg.CborEncodeMajorType(cbg.MajMap, uint64(fieldCount))); err != nil {
2407
-
if _, err := cw.WriteString(string("triggerMetadata")); err != nil {
2493
+
// t.LexiconTypeID (string) (string)
2494
+
if len("$type") > 1000000 {
2495
+
return xerrors.Errorf("Value in field \"$type\" was too long")
2498
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("$type"))); err != nil {
2501
+
if _, err := cw.WriteString(string("$type")); err != nil {
2411
-
if err := t.TriggerMetadata.MarshalCBOR(cw); err != nil {
2505
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("sh.tangled.pipeline.status"))); err != nil {
2508
+
if _, err := cw.WriteString(string("sh.tangled.pipeline.status")); err != nil {
2512
+
// t.Error (string) (string)
2513
+
if t.Error != nil {
2515
+
if len("error") > 1000000 {
2516
+
return xerrors.Errorf("Value in field \"error\" was too long")
2519
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("error"))); err != nil {
2522
+
if _, err := cw.WriteString(string("error")); err != nil {
2526
+
if t.Error == nil {
2527
+
if _, err := cw.Write(cbg.CborNull); err != nil {
2531
+
if len(*t.Error) > 1000000 {
2532
+
return xerrors.Errorf("Value in field t.Error was too long")
2535
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Error))); err != nil {
2538
+
if _, err := cw.WriteString(string(*t.Error)); err != nil {
2544
+
// t.Status (string) (string)
2545
+
if len("status") > 1000000 {
2546
+
return xerrors.Errorf("Value in field \"status\" was too long")
2549
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("status"))); err != nil {
2552
+
if _, err := cw.WriteString(string("status")); err != nil {
2556
+
if len(t.Status) > 1000000 {
2557
+
return xerrors.Errorf("Value in field t.Status was too long")
2560
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Status))); err != nil {
2563
+
if _, err := cw.WriteString(string(t.Status)); err != nil {
2567
+
// t.ExitCode (int64) (int64)
2568
+
if t.ExitCode != nil {
2570
+
if len("exitCode") > 1000000 {
2571
+
return xerrors.Errorf("Value in field \"exitCode\" was too long")
2574
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("exitCode"))); err != nil {
2577
+
if _, err := cw.WriteString(string("exitCode")); err != nil {
2581
+
if t.ExitCode == nil {
2582
+
if _, err := cw.Write(cbg.CborNull); err != nil {
2586
+
if *t.ExitCode >= 0 {
2587
+
if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(*t.ExitCode)); err != nil {
2591
+
if err := cw.WriteMajorTypeHeader(cbg.MajNegativeInt, uint64(-*t.ExitCode-1)); err != nil {
2599
+
// t.Pipeline (string) (string)
2600
+
if len("pipeline") > 1000000 {
2601
+
return xerrors.Errorf("Value in field \"pipeline\" was too long")
2604
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("pipeline"))); err != nil {
2607
+
if _, err := cw.WriteString(string("pipeline")); err != nil {
2611
+
if len(t.Pipeline) > 1000000 {
2612
+
return xerrors.Errorf("Value in field t.Pipeline was too long")
2615
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Pipeline))); err != nil {
2618
+
if _, err := cw.WriteString(string(t.Pipeline)); err != nil {
2622
+
// t.Workflow (string) (string)
2623
+
if len("workflow") > 1000000 {
2624
+
return xerrors.Errorf("Value in field \"workflow\" was too long")
2627
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("workflow"))); err != nil {
2630
+
if _, err := cw.WriteString(string("workflow")); err != nil {
2634
+
if len(t.Workflow) > 1000000 {
2635
+
return xerrors.Errorf("Value in field t.Workflow was too long")
2638
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Workflow))); err != nil {
2641
+
if _, err := cw.WriteString(string(t.Workflow)); err != nil {
2645
+
// t.CreatedAt (string) (string)
2646
+
if len("createdAt") > 1000000 {
2647
+
return xerrors.Errorf("Value in field \"createdAt\" was too long")
2650
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("createdAt"))); err != nil {
2653
+
if _, err := cw.WriteString(string("createdAt")); err != nil {
2657
+
if len(t.CreatedAt) > 1000000 {
2658
+
return xerrors.Errorf("Value in field t.CreatedAt was too long")
2661
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.CreatedAt))); err != nil {
2664
+
if _, err := cw.WriteString(string(t.CreatedAt)); err != nil {
2417
-
func (t *Pipeline) UnmarshalCBOR(r io.Reader) (err error) {
2670
+
func (t *PipelineStatus) UnmarshalCBOR(r io.Reader) (err error) {
2671
+
*t = PipelineStatus{}
cr := cbg.NewCborReader(r)
···
if extra > cbg.MaxLength {
2437
-
return fmt.Errorf("Pipeline: map struct too large (%d)", extra)
2690
+
return fmt.Errorf("PipelineStatus: map struct too large (%d)", extra)
2442
-
nameBuf := make([]byte, 15)
2695
+
nameBuf := make([]byte, 9)
for i := uint64(0); i < n; i++ {
nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000)
···
t.LexiconTypeID = string(sval)
2469
-
// t.Workflows ([]*tangled.Pipeline_Workflow) (slice)
2722
+
// t.Error (string) (string)
2472
-
maj, extra, err = cr.ReadHeader()
2726
+
b, err := cr.ReadByte()
2730
+
if b != cbg.CborNull[0] {
2731
+
if err := cr.UnreadByte(); err != nil {
2478
-
return fmt.Errorf("t.Workflows: array too large (%d)", extra)
2735
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
2740
+
t.Error = (*string)(&sval)
2743
+
// t.Status (string) (string)
2481
-
if maj != cbg.MajArray {
2482
-
return fmt.Errorf("expected cbor array")
2747
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
2486
-
t.Workflows = make([]*Pipeline_Workflow, extra)
2752
+
t.Status = string(sval)
2754
+
// t.ExitCode (int64) (int64)
2489
-
for i := 0; i < int(extra); i++ {
2500
-
b, err := cr.ReadByte()
2758
+
b, err := cr.ReadByte()
2762
+
if b != cbg.CborNull[0] {
2763
+
if err := cr.UnreadByte(); err != nil {
2766
+
maj, extra, err := cr.ReadHeader()
2772
+
case cbg.MajUnsignedInt:
2773
+
extraI = int64(extra)
2775
+
return fmt.Errorf("int64 positive overflow")
2504
-
if b != cbg.CborNull[0] {
2505
-
if err := cr.UnreadByte(); err != nil {
2508
-
t.Workflows[i] = new(Pipeline_Workflow)
2509
-
if err := t.Workflows[i].UnmarshalCBOR(cr); err != nil {
2510
-
return xerrors.Errorf("unmarshaling t.Workflows[i] pointer: %w", err)
2777
+
case cbg.MajNegativeInt:
2778
+
extraI = int64(extra)
2780
+
return fmt.Errorf("int64 negative overflow")
2782
+
extraI = -1 - extraI
2784
+
return fmt.Errorf("wrong type for int64 field: %d", maj)
2787
+
t.ExitCode = (*int64)(&extraI)
2518
-
// t.TriggerMetadata (tangled.Pipeline_TriggerMetadata) (struct)
2519
-
case "triggerMetadata":
2790
+
// t.Pipeline (string) (string)
2794
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
2523
-
b, err := cr.ReadByte()
2799
+
t.Pipeline = string(sval)
2801
+
// t.Workflow (string) (string)
2805
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
2527
-
if b != cbg.CborNull[0] {
2528
-
if err := cr.UnreadByte(); err != nil {
2531
-
t.TriggerMetadata = new(Pipeline_TriggerMetadata)
2532
-
if err := t.TriggerMetadata.UnmarshalCBOR(cr); err != nil {
2533
-
return xerrors.Errorf("unmarshaling t.TriggerMetadata pointer: %w", err)
2810
+
t.Workflow = string(sval)
2812
+
// t.CreatedAt (string) (string)
2816
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
2821
+
t.CreatedAt = string(sval)
···
3557
-
func (t *PipelineStatus) MarshalCBOR(w io.Writer) error {
3559
-
_, err := w.Write(cbg.CborNull)
3563
-
cw := cbg.NewCborWriter(w)
3566
-
if t.Error == nil {
3570
-
if t.ExitCode == nil {
3574
-
if _, err := cw.Write(cbg.CborEncodeMajorType(cbg.MajMap, uint64(fieldCount))); err != nil {
3578
-
// t.LexiconTypeID (string) (string)
3579
-
if len("$type") > 1000000 {
3580
-
return xerrors.Errorf("Value in field \"$type\" was too long")
3583
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("$type"))); err != nil {
3586
-
if _, err := cw.WriteString(string("$type")); err != nil {
3590
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("sh.tangled.pipeline.status"))); err != nil {
3593
-
if _, err := cw.WriteString(string("sh.tangled.pipeline.status")); err != nil {
3597
-
// t.Error (string) (string)
3598
-
if t.Error != nil {
3600
-
if len("error") > 1000000 {
3601
-
return xerrors.Errorf("Value in field \"error\" was too long")
3604
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("error"))); err != nil {
3607
-
if _, err := cw.WriteString(string("error")); err != nil {
3611
-
if t.Error == nil {
3612
-
if _, err := cw.Write(cbg.CborNull); err != nil {
3616
-
if len(*t.Error) > 1000000 {
3617
-
return xerrors.Errorf("Value in field t.Error was too long")
3620
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Error))); err != nil {
3623
-
if _, err := cw.WriteString(string(*t.Error)); err != nil {
3629
-
// t.Status (string) (string)
3630
-
if len("status") > 1000000 {
3631
-
return xerrors.Errorf("Value in field \"status\" was too long")
3634
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("status"))); err != nil {
3637
-
if _, err := cw.WriteString(string("status")); err != nil {
3641
-
if len(t.Status) > 1000000 {
3642
-
return xerrors.Errorf("Value in field t.Status was too long")
3645
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Status))); err != nil {
3648
-
if _, err := cw.WriteString(string(t.Status)); err != nil {
3652
-
// t.ExitCode (int64) (int64)
3653
-
if t.ExitCode != nil {
3655
-
if len("exitCode") > 1000000 {
3656
-
return xerrors.Errorf("Value in field \"exitCode\" was too long")
3659
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("exitCode"))); err != nil {
3662
-
if _, err := cw.WriteString(string("exitCode")); err != nil {
3666
-
if t.ExitCode == nil {
3667
-
if _, err := cw.Write(cbg.CborNull); err != nil {
3671
-
if *t.ExitCode >= 0 {
3672
-
if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(*t.ExitCode)); err != nil {
3676
-
if err := cw.WriteMajorTypeHeader(cbg.MajNegativeInt, uint64(-*t.ExitCode-1)); err != nil {
3684
-
// t.Pipeline (string) (string)
3685
-
if len("pipeline") > 1000000 {
3686
-
return xerrors.Errorf("Value in field \"pipeline\" was too long")
3689
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("pipeline"))); err != nil {
3692
-
if _, err := cw.WriteString(string("pipeline")); err != nil {
3696
-
if len(t.Pipeline) > 1000000 {
3697
-
return xerrors.Errorf("Value in field t.Pipeline was too long")
3700
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Pipeline))); err != nil {
3703
-
if _, err := cw.WriteString(string(t.Pipeline)); err != nil {
3707
-
// t.Workflow (string) (string)
3708
-
if len("workflow") > 1000000 {
3709
-
return xerrors.Errorf("Value in field \"workflow\" was too long")
3712
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("workflow"))); err != nil {
3715
-
if _, err := cw.WriteString(string("workflow")); err != nil {
3719
-
if len(t.Workflow) > 1000000 {
3720
-
return xerrors.Errorf("Value in field t.Workflow was too long")
3723
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Workflow))); err != nil {
3726
-
if _, err := cw.WriteString(string(t.Workflow)); err != nil {
3730
-
// t.CreatedAt (string) (string)
3731
-
if len("createdAt") > 1000000 {
3732
-
return xerrors.Errorf("Value in field \"createdAt\" was too long")
3735
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("createdAt"))); err != nil {
3738
-
if _, err := cw.WriteString(string("createdAt")); err != nil {
3742
-
if len(t.CreatedAt) > 1000000 {
3743
-
return xerrors.Errorf("Value in field t.CreatedAt was too long")
3746
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.CreatedAt))); err != nil {
3749
-
if _, err := cw.WriteString(string(t.CreatedAt)); err != nil {
3755
-
func (t *PipelineStatus) UnmarshalCBOR(r io.Reader) (err error) {
3756
-
*t = PipelineStatus{}
3758
-
cr := cbg.NewCborReader(r)
3760
-
maj, extra, err := cr.ReadHeader()
3765
-
if err == io.EOF {
3766
-
err = io.ErrUnexpectedEOF
3770
-
if maj != cbg.MajMap {
3771
-
return fmt.Errorf("cbor input should be of type map")
3774
-
if extra > cbg.MaxLength {
3775
-
return fmt.Errorf("PipelineStatus: map struct too large (%d)", extra)
3780
-
nameBuf := make([]byte, 9)
3781
-
for i := uint64(0); i < n; i++ {
3782
-
nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000)
3788
-
// Field doesn't exist on this type, so ignore it
3789
-
if err := cbg.ScanForLinks(cr, func(cid.Cid) {}); err != nil {
3795
-
switch string(nameBuf[:nameLen]) {
3796
-
// t.LexiconTypeID (string) (string)
3800
-
sval, err := cbg.ReadStringWithMax(cr, 1000000)
3805
-
t.LexiconTypeID = string(sval)
3807
-
// t.Error (string) (string)
3811
-
b, err := cr.ReadByte()
3815
-
if b != cbg.CborNull[0] {
3816
-
if err := cr.UnreadByte(); err != nil {
3820
-
sval, err := cbg.ReadStringWithMax(cr, 1000000)
3825
-
t.Error = (*string)(&sval)
3828
-
// t.Status (string) (string)
3832
-
sval, err := cbg.ReadStringWithMax(cr, 1000000)
3837
-
t.Status = string(sval)
3839
-
// t.ExitCode (int64) (int64)
3843
-
b, err := cr.ReadByte()
3847
-
if b != cbg.CborNull[0] {
3848
-
if err := cr.UnreadByte(); err != nil {
3851
-
maj, extra, err := cr.ReadHeader()
3857
-
case cbg.MajUnsignedInt:
3858
-
extraI = int64(extra)
3860
-
return fmt.Errorf("int64 positive overflow")
3862
-
case cbg.MajNegativeInt:
3863
-
extraI = int64(extra)
3865
-
return fmt.Errorf("int64 negative overflow")
3867
-
extraI = -1 - extraI
3869
-
return fmt.Errorf("wrong type for int64 field: %d", maj)
3872
-
t.ExitCode = (*int64)(&extraI)
3875
-
// t.Pipeline (string) (string)
3879
-
sval, err := cbg.ReadStringWithMax(cr, 1000000)
3884
-
t.Pipeline = string(sval)
3886
-
// t.Workflow (string) (string)
3890
-
sval, err := cbg.ReadStringWithMax(cr, 1000000)
3895
-
t.Workflow = string(sval)
3897
-
// t.CreatedAt (string) (string)
3901
-
sval, err := cbg.ReadStringWithMax(cr, 1000000)
3906
-
t.CreatedAt = string(sval)
3910
-
// Field doesn't exist on this type, so ignore it
3911
-
if err := cbg.ScanForLinks(r, func(cid.Cid) {}); err != nil {
func (t *Pipeline_Step) MarshalCBOR(w io.Writer) error {
_, err := w.Write(cbg.CborNull)
···
4965
-
func (t *PublicKey) MarshalCBOR(w io.Writer) error {
4888
+
func (t *Pipeline) MarshalCBOR(w io.Writer) error {
_, err := w.Write(cbg.CborNull)
···
cw := cbg.NewCborWriter(w)
4973
-
if _, err := cw.Write([]byte{164}); err != nil {
4977
-
// t.Key (string) (string)
4978
-
if len("key") > 1000000 {
4979
-
return xerrors.Errorf("Value in field \"key\" was too long")
4982
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("key"))); err != nil {
4985
-
if _, err := cw.WriteString(string("key")); err != nil {
4896
+
if _, err := cw.Write([]byte{163}); err != nil {
4989
-
if len(t.Key) > 1000000 {
4990
-
return xerrors.Errorf("Value in field t.Key was too long")
4900
+
// t.LexiconTypeID (string) (string)
4901
+
if len("$type") > 1000000 {
4902
+
return xerrors.Errorf("Value in field \"$type\" was too long")
4993
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Key))); err != nil {
4905
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("$type"))); err != nil {
4996
-
if _, err := cw.WriteString(string(t.Key)); err != nil {
4908
+
if _, err := cw.WriteString(string("$type")); err != nil {
5000
-
// t.Name (string) (string)
5001
-
if len("name") > 1000000 {
5002
-
return xerrors.Errorf("Value in field \"name\" was too long")
5005
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("name"))); err != nil {
4912
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("sh.tangled.pipeline"))); err != nil {
5008
-
if _, err := cw.WriteString(string("name")); err != nil {
4915
+
if _, err := cw.WriteString(string("sh.tangled.pipeline")); err != nil {
5012
-
if len(t.Name) > 1000000 {
5013
-
return xerrors.Errorf("Value in field t.Name was too long")
4919
+
// t.Workflows ([]*tangled.Pipeline_Workflow) (slice)
4920
+
if len("workflows") > 1000000 {
4921
+
return xerrors.Errorf("Value in field \"workflows\" was too long")
5016
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Name))); err != nil {
4924
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("workflows"))); err != nil {
5019
-
if _, err := cw.WriteString(string(t.Name)); err != nil {
4927
+
if _, err := cw.WriteString(string("workflows")); err != nil {
5023
-
// t.LexiconTypeID (string) (string)
5024
-
if len("$type") > 1000000 {
5025
-
return xerrors.Errorf("Value in field \"$type\" was too long")
4931
+
if len(t.Workflows) > 8192 {
4932
+
return xerrors.Errorf("Slice value in field t.Workflows was too long")
5028
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("$type"))); err != nil {
5031
-
if _, err := cw.WriteString(string("$type")); err != nil {
4935
+
if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.Workflows))); err != nil {
4938
+
for _, v := range t.Workflows {
4939
+
if err := v.MarshalCBOR(cw); err != nil {
5035
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("sh.tangled.publicKey"))); err != nil {
5038
-
if _, err := cw.WriteString(string("sh.tangled.publicKey")); err != nil {
5042
-
// t.CreatedAt (string) (string)
5043
-
if len("createdAt") > 1000000 {
5044
-
return xerrors.Errorf("Value in field \"createdAt\" was too long")
4945
+
// t.TriggerMetadata (tangled.Pipeline_TriggerMetadata) (struct)
4946
+
if len("triggerMetadata") > 1000000 {
4947
+
return xerrors.Errorf("Value in field \"triggerMetadata\" was too long")
5047
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("createdAt"))); err != nil {
4950
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("triggerMetadata"))); err != nil {
5050
-
if _, err := cw.WriteString(string("createdAt")); err != nil {
4953
+
if _, err := cw.WriteString(string("triggerMetadata")); err != nil {
5054
-
if len(t.CreatedAt) > 1000000 {
5055
-
return xerrors.Errorf("Value in field t.CreatedAt was too long")
5058
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.CreatedAt))); err != nil {
5061
-
if _, err := cw.WriteString(string(t.CreatedAt)); err != nil {
4957
+
if err := t.TriggerMetadata.MarshalCBOR(cw); err != nil {
5067
-
func (t *PublicKey) UnmarshalCBOR(r io.Reader) (err error) {
4963
+
func (t *Pipeline) UnmarshalCBOR(r io.Reader) (err error) {
cr := cbg.NewCborReader(r)
···
if extra > cbg.MaxLength {
5087
-
return fmt.Errorf("PublicKey: map struct too large (%d)", extra)
4983
+
return fmt.Errorf("Pipeline: map struct too large (%d)", extra)
5092
-
nameBuf := make([]byte, 9)
4988
+
nameBuf := make([]byte, 15)
for i := uint64(0); i < n; i++ {
nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000)
···
switch string(nameBuf[:nameLen]) {
5108
-
// t.Key (string) (string)
5004
+
// t.LexiconTypeID (string) (string)
sval, err := cbg.ReadStringWithMax(cr, 1000000)
···
5117
-
t.Key = string(sval)
5013
+
t.LexiconTypeID = string(sval)
5119
-
// t.Name (string) (string)
5015
+
// t.Workflows ([]*tangled.Pipeline_Workflow) (slice)
5123
-
sval, err := cbg.ReadStringWithMax(cr, 1000000)
5018
+
maj, extra, err = cr.ReadHeader()
5128
-
t.Name = string(sval)
5024
+
return fmt.Errorf("t.Workflows: array too large (%d)", extra)
5130
-
// t.LexiconTypeID (string) (string)
5134
-
sval, err := cbg.ReadStringWithMax(cr, 1000000)
5027
+
if maj != cbg.MajArray {
5028
+
return fmt.Errorf("expected cbor array")
5139
-
t.LexiconTypeID = string(sval)
5032
+
t.Workflows = make([]*Pipeline_Workflow, extra)
5141
-
// t.CreatedAt (string) (string)
5035
+
for i := 0; i < int(extra); i++ {
5046
+
b, err := cr.ReadByte()
5050
+
if b != cbg.CborNull[0] {
5051
+
if err := cr.UnreadByte(); err != nil {
5054
+
t.Workflows[i] = new(Pipeline_Workflow)
5055
+
if err := t.Workflows[i].UnmarshalCBOR(cr); err != nil {
5056
+
return xerrors.Errorf("unmarshaling t.Workflows[i] pointer: %w", err)
5064
+
// t.TriggerMetadata (tangled.Pipeline_TriggerMetadata) (struct)
5065
+
case "triggerMetadata":
5145
-
sval, err := cbg.ReadStringWithMax(cr, 1000000)
5069
+
b, err := cr.ReadByte()
5073
+
if b != cbg.CborNull[0] {
5074
+
if err := cr.UnreadByte(); err != nil {
5077
+
t.TriggerMetadata = new(Pipeline_TriggerMetadata)
5078
+
if err := t.TriggerMetadata.UnmarshalCBOR(cr); err != nil {
5079
+
return xerrors.Errorf("unmarshaling t.TriggerMetadata pointer: %w", err)
5150
-
t.CreatedAt = string(sval)
···
5163
-
func (t *Repo) MarshalCBOR(w io.Writer) error {
5095
+
func (t *PublicKey) MarshalCBOR(w io.Writer) error {
_, err := w.Write(cbg.CborNull)
cw := cbg.NewCborWriter(w)
5172
-
if t.Description == nil {
5176
-
if t.Source == nil {
5180
-
if t.Spindle == nil {
5184
-
if _, err := cw.Write(cbg.CborEncodeMajorType(cbg.MajMap, uint64(fieldCount))); err != nil {
5103
+
if _, err := cw.Write([]byte{164}); err != nil {
5188
-
// t.Knot (string) (string)
5189
-
if len("knot") > 1000000 {
5190
-
return xerrors.Errorf("Value in field \"knot\" was too long")
5107
+
// t.Key (string) (string)
5108
+
if len("key") > 1000000 {
5109
+
return xerrors.Errorf("Value in field \"key\" was too long")
5193
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("knot"))); err != nil {
5112
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("key"))); err != nil {
5196
-
if _, err := cw.WriteString(string("knot")); err != nil {
5115
+
if _, err := cw.WriteString(string("key")); err != nil {
5200
-
if len(t.Knot) > 1000000 {
5201
-
return xerrors.Errorf("Value in field t.Knot was too long")
5119
+
if len(t.Key) > 1000000 {
5120
+
return xerrors.Errorf("Value in field t.Key was too long")
5204
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Knot))); err != nil {
5123
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Key))); err != nil {
5207
-
if _, err := cw.WriteString(string(t.Knot)); err != nil {
5126
+
if _, err := cw.WriteString(string(t.Key)); err != nil {
···
5246
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("sh.tangled.repo"))); err != nil {
5249
-
if _, err := cw.WriteString(string("sh.tangled.repo")); err != nil {
5253
-
// t.Owner (string) (string)
5254
-
if len("owner") > 1000000 {
5255
-
return xerrors.Errorf("Value in field \"owner\" was too long")
5258
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("owner"))); err != nil {
5261
-
if _, err := cw.WriteString(string("owner")); err != nil {
5265
-
if len(t.Owner) > 1000000 {
5266
-
return xerrors.Errorf("Value in field t.Owner was too long")
5269
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Owner))); err != nil {
5165
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("sh.tangled.publicKey"))); err != nil {
5272
-
if _, err := cw.WriteString(string(t.Owner)); err != nil {
5168
+
if _, err := cw.WriteString(string("sh.tangled.publicKey")); err != nil {
5276
-
// t.Source (string) (string)
5277
-
if t.Source != nil {
5279
-
if len("source") > 1000000 {
5280
-
return xerrors.Errorf("Value in field \"source\" was too long")
5283
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("source"))); err != nil {
5286
-
if _, err := cw.WriteString(string("source")); err != nil {
5290
-
if t.Source == nil {
5291
-
if _, err := cw.Write(cbg.CborNull); err != nil {
5295
-
if len(*t.Source) > 1000000 {
5296
-
return xerrors.Errorf("Value in field t.Source was too long")
5299
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Source))); err != nil {
5302
-
if _, err := cw.WriteString(string(*t.Source)); err != nil {
5308
-
// t.Spindle (string) (string)
5309
-
if t.Spindle != nil {
5311
-
if len("spindle") > 1000000 {
5312
-
return xerrors.Errorf("Value in field \"spindle\" was too long")
5315
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("spindle"))); err != nil {
5318
-
if _, err := cw.WriteString(string("spindle")); err != nil {
5322
-
if t.Spindle == nil {
5323
-
if _, err := cw.Write(cbg.CborNull); err != nil {
5327
-
if len(*t.Spindle) > 1000000 {
5328
-
return xerrors.Errorf("Value in field t.Spindle was too long")
5331
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Spindle))); err != nil {
5334
-
if _, err := cw.WriteString(string(*t.Spindle)); 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 {
5363
-
// t.Description (string) (string)
5364
-
if t.Description != nil {
5366
-
if len("description") > 1000000 {
5367
-
return xerrors.Errorf("Value in field \"description\" was too long")
5370
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("description"))); err != nil {
5373
-
if _, err := cw.WriteString(string("description")); err != nil {
5377
-
if t.Description == nil {
5378
-
if _, err := cw.Write(cbg.CborNull); err != nil {
5382
-
if len(*t.Description) > 1000000 {
5383
-
return xerrors.Errorf("Value in field t.Description was too long")
5386
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Description))); err != nil {
5389
-
if _, err := cw.WriteString(string(*t.Description)); err != nil {
5397
-
func (t *Repo) UnmarshalCBOR(r io.Reader) (err error) {
5197
+
func (t *PublicKey) UnmarshalCBOR(r io.Reader) (err error) {
cr := cbg.NewCborReader(r)
···
if extra > cbg.MaxLength {
5417
-
return fmt.Errorf("Repo: map struct too large (%d)", extra)
5217
+
return fmt.Errorf("PublicKey: map struct too large (%d)", extra)
5422
-
nameBuf := make([]byte, 11)
5222
+
nameBuf := make([]byte, 9)
for i := uint64(0); i < n; i++ {
nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000)
···
switch string(nameBuf[:nameLen]) {
5438
-
// t.Knot (string) (string)
5238
+
// t.Key (string) (string)
sval, err := cbg.ReadStringWithMax(cr, 1000000)
···
5447
-
t.Knot = string(sval)
5247
+
t.Key = string(sval)
// t.Name (string) (string)
···
t.LexiconTypeID = string(sval)
5471
-
// t.Owner (string) (string)
5475
-
sval, err := cbg.ReadStringWithMax(cr, 1000000)
5480
-
t.Owner = string(sval)
5482
-
// t.Source (string) (string)
5486
-
b, err := cr.ReadByte()
5490
-
if b != cbg.CborNull[0] {
5491
-
if err := cr.UnreadByte(); err != nil {
5495
-
sval, err := cbg.ReadStringWithMax(cr, 1000000)
5500
-
t.Source = (*string)(&sval)
5503
-
// t.Spindle (string) (string)
5507
-
b, err := cr.ReadByte()
5511
-
if b != cbg.CborNull[0] {
5512
-
if err := cr.UnreadByte(); err != nil {
5516
-
sval, err := cbg.ReadStringWithMax(cr, 1000000)
5521
-
t.Spindle = (*string)(&sval)
// t.CreatedAt (string) (string)
···
t.CreatedAt = string(sval)
5535
-
// t.Description (string) (string)
5536
-
case "description":
5539
-
b, err := cr.ReadByte()
5543
-
if b != cbg.CborNull[0] {
5544
-
if err := cr.UnreadByte(); err != nil {
5548
-
sval, err := cbg.ReadStringWithMax(cr, 1000000)
5553
-
t.Description = (*string)(&sval)
···
6055
-
func (t *RepoIssue) MarshalCBOR(w io.Writer) error {
6057
-
_, err := w.Write(cbg.CborNull)
6061
-
cw := cbg.NewCborWriter(w)
6064
-
if t.Body == nil {
6068
-
if _, err := cw.Write(cbg.CborEncodeMajorType(cbg.MajMap, uint64(fieldCount))); err != nil {
6072
-
// t.Body (string) (string)
6073
-
if t.Body != nil {
6075
-
if len("body") > 1000000 {
6076
-
return xerrors.Errorf("Value in field \"body\" was too long")
6079
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("body"))); err != nil {
6082
-
if _, err := cw.WriteString(string("body")); err != nil {
6086
-
if t.Body == nil {
6087
-
if _, err := cw.Write(cbg.CborNull); err != nil {
6091
-
if len(*t.Body) > 1000000 {
6092
-
return xerrors.Errorf("Value in field t.Body was too long")
6095
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Body))); err != nil {
6098
-
if _, err := cw.WriteString(string(*t.Body)); err != nil {
6104
-
// t.Repo (string) (string)
6105
-
if len("repo") > 1000000 {
6106
-
return xerrors.Errorf("Value in field \"repo\" was too long")
6109
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("repo"))); err != nil {
6112
-
if _, err := cw.WriteString(string("repo")); err != nil {
6116
-
if len(t.Repo) > 1000000 {
6117
-
return xerrors.Errorf("Value in field t.Repo was too long")
6120
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Repo))); err != nil {
6123
-
if _, err := cw.WriteString(string(t.Repo)); err != nil {
6127
-
// t.LexiconTypeID (string) (string)
6128
-
if len("$type") > 1000000 {
6129
-
return xerrors.Errorf("Value in field \"$type\" was too long")
6132
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("$type"))); err != nil {
6135
-
if _, err := cw.WriteString(string("$type")); err != nil {
6139
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("sh.tangled.repo.issue"))); err != nil {
6142
-
if _, err := cw.WriteString(string("sh.tangled.repo.issue")); err != nil {
6146
-
// t.Owner (string) (string)
6147
-
if len("owner") > 1000000 {
6148
-
return xerrors.Errorf("Value in field \"owner\" was too long")
6151
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("owner"))); err != nil {
6154
-
if _, err := cw.WriteString(string("owner")); err != nil {
6158
-
if len(t.Owner) > 1000000 {
6159
-
return xerrors.Errorf("Value in field t.Owner was too long")
6162
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Owner))); err != nil {
6165
-
if _, err := cw.WriteString(string(t.Owner)); err != nil {
6169
-
// t.Title (string) (string)
6170
-
if len("title") > 1000000 {
6171
-
return xerrors.Errorf("Value in field \"title\" was too long")
6174
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("title"))); err != nil {
6177
-
if _, err := cw.WriteString(string("title")); err != nil {
6181
-
if len(t.Title) > 1000000 {
6182
-
return xerrors.Errorf("Value in field t.Title was too long")
6185
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Title))); err != nil {
6188
-
if _, err := cw.WriteString(string(t.Title)); err != nil {
6192
-
// t.IssueId (int64) (int64)
6193
-
if len("issueId") > 1000000 {
6194
-
return xerrors.Errorf("Value in field \"issueId\" was too long")
6197
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("issueId"))); err != nil {
6200
-
if _, err := cw.WriteString(string("issueId")); err != nil {
6204
-
if t.IssueId >= 0 {
6205
-
if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.IssueId)); err != nil {
6209
-
if err := cw.WriteMajorTypeHeader(cbg.MajNegativeInt, uint64(-t.IssueId-1)); err != nil {
6214
-
// t.CreatedAt (string) (string)
6215
-
if len("createdAt") > 1000000 {
6216
-
return xerrors.Errorf("Value in field \"createdAt\" was too long")
6219
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("createdAt"))); err != nil {
6222
-
if _, err := cw.WriteString(string("createdAt")); err != nil {
6226
-
if len(t.CreatedAt) > 1000000 {
6227
-
return xerrors.Errorf("Value in field t.CreatedAt was too long")
6230
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.CreatedAt))); err != nil {
6233
-
if _, err := cw.WriteString(string(t.CreatedAt)); err != nil {
6239
-
func (t *RepoIssue) UnmarshalCBOR(r io.Reader) (err error) {
6242
-
cr := cbg.NewCborReader(r)
6244
-
maj, extra, err := cr.ReadHeader()
6249
-
if err == io.EOF {
6250
-
err = io.ErrUnexpectedEOF
6254
-
if maj != cbg.MajMap {
6255
-
return fmt.Errorf("cbor input should be of type map")
6258
-
if extra > cbg.MaxLength {
6259
-
return fmt.Errorf("RepoIssue: map struct too large (%d)", extra)
6264
-
nameBuf := make([]byte, 9)
6265
-
for i := uint64(0); i < n; i++ {
6266
-
nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000)
6272
-
// Field doesn't exist on this type, so ignore it
6273
-
if err := cbg.ScanForLinks(cr, func(cid.Cid) {}); err != nil {
6279
-
switch string(nameBuf[:nameLen]) {
6280
-
// t.Body (string) (string)
6284
-
b, err := cr.ReadByte()
6288
-
if b != cbg.CborNull[0] {
6289
-
if err := cr.UnreadByte(); err != nil {
6293
-
sval, err := cbg.ReadStringWithMax(cr, 1000000)
6298
-
t.Body = (*string)(&sval)
6301
-
// t.Repo (string) (string)
6305
-
sval, err := cbg.ReadStringWithMax(cr, 1000000)
6310
-
t.Repo = string(sval)
6312
-
// t.LexiconTypeID (string) (string)
6316
-
sval, err := cbg.ReadStringWithMax(cr, 1000000)
6321
-
t.LexiconTypeID = string(sval)
6323
-
// t.Owner (string) (string)
6327
-
sval, err := cbg.ReadStringWithMax(cr, 1000000)
6332
-
t.Owner = string(sval)
6334
-
// t.Title (string) (string)
6338
-
sval, err := cbg.ReadStringWithMax(cr, 1000000)
6343
-
t.Title = string(sval)
6345
-
// t.IssueId (int64) (int64)
6348
-
maj, extra, err := cr.ReadHeader()
6354
-
case cbg.MajUnsignedInt:
6355
-
extraI = int64(extra)
6357
-
return fmt.Errorf("int64 positive overflow")
6359
-
case cbg.MajNegativeInt:
6360
-
extraI = int64(extra)
6362
-
return fmt.Errorf("int64 negative overflow")
6364
-
extraI = -1 - extraI
6366
-
return fmt.Errorf("wrong type for int64 field: %d", maj)
6369
-
t.IssueId = int64(extraI)
6371
-
// t.CreatedAt (string) (string)
6375
-
sval, err := cbg.ReadStringWithMax(cr, 1000000)
6380
-
t.CreatedAt = string(sval)
6384
-
// Field doesn't exist on this type, so ignore it
6385
-
if err := cbg.ScanForLinks(r, func(cid.Cid) {}); err != nil {
func (t *RepoIssueComment) MarshalCBOR(w io.Writer) error {
_, err := w.Write(cbg.CborNull)
···
6942
-
func (t *RepoPull) MarshalCBOR(w io.Writer) error {
6330
+
func (t *RepoIssue) MarshalCBOR(w io.Writer) error {
_, err := w.Write(cbg.CborNull)
cw := cbg.NewCborWriter(w)
6955
-
if t.Source == nil {
···
6379
+
// t.Repo (string) (string)
6380
+
if len("repo") > 1000000 {
6381
+
return xerrors.Errorf("Value in field \"repo\" was too long")
6384
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("repo"))); err != nil {
6387
+
if _, err := cw.WriteString(string("repo")); err != nil {
6391
+
if len(t.Repo) > 1000000 {
6392
+
return xerrors.Errorf("Value in field t.Repo was too long")
6395
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Repo))); err != nil {
6398
+
if _, err := cw.WriteString(string(t.Repo)); err != nil {
// t.LexiconTypeID (string) (string)
if len("$type") > 1000000 {
return xerrors.Errorf("Value in field \"$type\" was too long")
···
7007
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("sh.tangled.repo.pull"))); err != nil {
6414
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("sh.tangled.repo.issue"))); err != nil {
7010
-
if _, err := cw.WriteString(string("sh.tangled.repo.pull")); err != nil {
6417
+
if _, err := cw.WriteString(string("sh.tangled.repo.issue")); err != nil {
7014
-
// t.Patch (string) (string)
7015
-
if len("patch") > 1000000 {
7016
-
return xerrors.Errorf("Value in field \"patch\" was too long")
6421
+
// t.Owner (string) (string)
6422
+
if len("owner") > 1000000 {
6423
+
return xerrors.Errorf("Value in field \"owner\" was too long")
7019
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("patch"))); err != nil {
6426
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("owner"))); err != nil {
7022
-
if _, err := cw.WriteString(string("patch")); err != nil {
6429
+
if _, err := cw.WriteString(string("owner")); err != nil {
7026
-
if len(t.Patch) > 1000000 {
7027
-
return xerrors.Errorf("Value in field t.Patch was too long")
6433
+
if len(t.Owner) > 1000000 {
6434
+
return xerrors.Errorf("Value in field t.Owner was too long")
7030
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Patch))); err != nil {
6437
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Owner))); err != nil {
7033
-
if _, err := cw.WriteString(string(t.Patch)); err != nil {
6440
+
if _, err := cw.WriteString(string(t.Owner)); err != nil {
···
7060
-
// t.PullId (int64) (int64)
7061
-
if len("pullId") > 1000000 {
7062
-
return xerrors.Errorf("Value in field \"pullId\" was too long")
6467
+
// t.IssueId (int64) (int64)
6468
+
if len("issueId") > 1000000 {
6469
+
return xerrors.Errorf("Value in field \"issueId\" was too long")
7065
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("pullId"))); err != nil {
6472
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("issueId"))); err != nil {
7068
-
if _, err := cw.WriteString(string("pullId")); err != nil {
6475
+
if _, err := cw.WriteString(string("issueId")); err != nil {
7072
-
if t.PullId >= 0 {
7073
-
if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.PullId)); err != nil {
6479
+
if t.IssueId >= 0 {
6480
+
if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.IssueId)); err != nil {
7077
-
if err := cw.WriteMajorTypeHeader(cbg.MajNegativeInt, uint64(-t.PullId-1)); err != nil {
7082
-
// t.Source (tangled.RepoPull_Source) (struct)
7083
-
if t.Source != nil {
7085
-
if len("source") > 1000000 {
7086
-
return xerrors.Errorf("Value in field \"source\" was too long")
7089
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("source"))); err != nil {
7092
-
if _, err := cw.WriteString(string("source")); err != nil {
7096
-
if err := t.Source.MarshalCBOR(cw); err != nil {
6484
+
if err := cw.WriteMajorTypeHeader(cbg.MajNegativeInt, uint64(-t.IssueId-1)); err != nil {
···
if _, err := cw.WriteString(string(t.CreatedAt)); err != nil {
7124
-
// t.TargetRepo (string) (string)
7125
-
if len("targetRepo") > 1000000 {
7126
-
return xerrors.Errorf("Value in field \"targetRepo\" was too long")
7129
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("targetRepo"))); err != nil {
7132
-
if _, err := cw.WriteString(string("targetRepo")); err != nil {
7136
-
if len(t.TargetRepo) > 1000000 {
7137
-
return xerrors.Errorf("Value in field t.TargetRepo was too long")
7140
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.TargetRepo))); err != nil {
7143
-
if _, err := cw.WriteString(string(t.TargetRepo)); err != nil {
7147
-
// t.TargetBranch (string) (string)
7148
-
if len("targetBranch") > 1000000 {
7149
-
return xerrors.Errorf("Value in field \"targetBranch\" was too long")
7152
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("targetBranch"))); err != nil {
7155
-
if _, err := cw.WriteString(string("targetBranch")); err != nil {
7159
-
if len(t.TargetBranch) > 1000000 {
7160
-
return xerrors.Errorf("Value in field t.TargetBranch was too long")
7163
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.TargetBranch))); err != nil {
7166
-
if _, err := cw.WriteString(string(t.TargetBranch)); err != nil {
7172
-
func (t *RepoPull) UnmarshalCBOR(r io.Reader) (err error) {
6514
+
func (t *RepoIssue) UnmarshalCBOR(r io.Reader) (err error) {
cr := cbg.NewCborReader(r)
···
if extra > cbg.MaxLength {
7192
-
return fmt.Errorf("RepoPull: map struct too large (%d)", extra)
6534
+
return fmt.Errorf("RepoIssue: map struct too large (%d)", extra)
7197
-
nameBuf := make([]byte, 12)
6539
+
nameBuf := make([]byte, 9)
for i := uint64(0); i < n; i++ {
nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000)
···
t.Body = (*string)(&sval)
6576
+
// t.Repo (string) (string)
6580
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
6585
+
t.Repo = string(sval)
// t.LexiconTypeID (string) (string)
···
t.LexiconTypeID = string(sval)
7245
-
// t.Patch (string) (string)
6598
+
// t.Owner (string) (string)
sval, err := cbg.ReadStringWithMax(cr, 1000000)
···
7254
-
t.Patch = string(sval)
6607
+
t.Owner = string(sval)
// t.Title (string) (string)
···
7267
-
// t.PullId (int64) (int64)
6620
+
// t.IssueId (int64) (int64)
maj, extra, err := cr.ReadHeader()
···
return fmt.Errorf("wrong type for int64 field: %d", maj)
7291
-
t.PullId = int64(extraI)
7293
-
// t.Source (tangled.RepoPull_Source) (struct)
7298
-
b, err := cr.ReadByte()
7302
-
if b != cbg.CborNull[0] {
7303
-
if err := cr.UnreadByte(); err != nil {
7306
-
t.Source = new(RepoPull_Source)
7307
-
if err := t.Source.UnmarshalCBOR(cr); err != nil {
7308
-
return xerrors.Errorf("unmarshaling t.Source pointer: %w", err)
6644
+
t.IssueId = int64(extraI)
// t.CreatedAt (string) (string)
···
t.CreatedAt = string(sval)
7324
-
// t.TargetRepo (string) (string)
7325
-
case "targetRepo":
7328
-
sval, err := cbg.ReadStringWithMax(cr, 1000000)
7333
-
t.TargetRepo = string(sval)
7335
-
// t.TargetBranch (string) (string)
7336
-
case "targetBranch":
7339
-
sval, err := cbg.ReadStringWithMax(cr, 1000000)
7344
-
t.TargetBranch = string(sval)
// Field doesn't exist on this type, so ignore it
···
7053
+
func (t *RepoPullStatus) MarshalCBOR(w io.Writer) error {
7055
+
_, err := w.Write(cbg.CborNull)
7059
+
cw := cbg.NewCborWriter(w)
7061
+
if _, err := cw.Write([]byte{163}); err != nil {
7065
+
// t.Pull (string) (string)
7066
+
if len("pull") > 1000000 {
7067
+
return xerrors.Errorf("Value in field \"pull\" was too long")
7070
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("pull"))); err != nil {
7073
+
if _, err := cw.WriteString(string("pull")); err != nil {
7077
+
if len(t.Pull) > 1000000 {
7078
+
return xerrors.Errorf("Value in field t.Pull was too long")
7081
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Pull))); err != nil {
7084
+
if _, err := cw.WriteString(string(t.Pull)); err != nil {
7088
+
// t.LexiconTypeID (string) (string)
7089
+
if len("$type") > 1000000 {
7090
+
return xerrors.Errorf("Value in field \"$type\" was too long")
7093
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("$type"))); err != nil {
7096
+
if _, err := cw.WriteString(string("$type")); err != nil {
7100
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("sh.tangled.repo.pull.status"))); err != nil {
7103
+
if _, err := cw.WriteString(string("sh.tangled.repo.pull.status")); err != nil {
7107
+
// t.Status (string) (string)
7108
+
if len("status") > 1000000 {
7109
+
return xerrors.Errorf("Value in field \"status\" was too long")
7112
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("status"))); err != nil {
7115
+
if _, err := cw.WriteString(string("status")); err != nil {
7119
+
if len(t.Status) > 1000000 {
7120
+
return xerrors.Errorf("Value in field t.Status was too long")
7123
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Status))); err != nil {
7126
+
if _, err := cw.WriteString(string(t.Status)); err != nil {
7132
+
func (t *RepoPullStatus) UnmarshalCBOR(r io.Reader) (err error) {
7133
+
*t = RepoPullStatus{}
7135
+
cr := cbg.NewCborReader(r)
7137
+
maj, extra, err := cr.ReadHeader()
7142
+
if err == io.EOF {
7143
+
err = io.ErrUnexpectedEOF
7147
+
if maj != cbg.MajMap {
7148
+
return fmt.Errorf("cbor input should be of type map")
7151
+
if extra > cbg.MaxLength {
7152
+
return fmt.Errorf("RepoPullStatus: map struct too large (%d)", extra)
7157
+
nameBuf := make([]byte, 6)
7158
+
for i := uint64(0); i < n; i++ {
7159
+
nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000)
7165
+
// Field doesn't exist on this type, so ignore it
7166
+
if err := cbg.ScanForLinks(cr, func(cid.Cid) {}); err != nil {
7172
+
switch string(nameBuf[:nameLen]) {
7173
+
// t.Pull (string) (string)
7177
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
7182
+
t.Pull = string(sval)
7184
+
// t.LexiconTypeID (string) (string)
7188
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
7193
+
t.LexiconTypeID = string(sval)
7195
+
// t.Status (string) (string)
7199
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
7204
+
t.Status = string(sval)
7208
+
// Field doesn't exist on this type, so ignore it
7209
+
if err := cbg.ScanForLinks(r, func(cid.Cid) {}); err != nil {
func (t *RepoPull_Source) MarshalCBOR(w io.Writer) error {
_, err := w.Write(cbg.CborNull)
···
7934
-
func (t *RepoPullStatus) MarshalCBOR(w io.Writer) error {
7409
+
func (t *RepoPull) MarshalCBOR(w io.Writer) error {
_, err := w.Write(cbg.CborNull)
cw := cbg.NewCborWriter(w)
7942
-
if _, err := cw.Write([]byte{163}); err != nil {
7418
+
if t.Body == nil {
7422
+
if t.Source == nil {
7426
+
if _, err := cw.Write(cbg.CborEncodeMajorType(cbg.MajMap, uint64(fieldCount))); err != nil {
7946
-
// t.Pull (string) (string)
7947
-
if len("pull") > 1000000 {
7948
-
return xerrors.Errorf("Value in field \"pull\" was too long")
7430
+
// t.Body (string) (string)
7431
+
if t.Body != nil {
7433
+
if len("body") > 1000000 {
7434
+
return xerrors.Errorf("Value in field \"body\" was too long")
7437
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("body"))); err != nil {
7440
+
if _, err := cw.WriteString(string("body")); err != nil {
7444
+
if t.Body == nil {
7445
+
if _, err := cw.Write(cbg.CborNull); err != nil {
7449
+
if len(*t.Body) > 1000000 {
7450
+
return xerrors.Errorf("Value in field t.Body was too long")
7453
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Body))); err != nil {
7456
+
if _, err := cw.WriteString(string(*t.Body)); err != nil {
7951
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("pull"))); err != nil {
7462
+
// t.LexiconTypeID (string) (string)
7463
+
if len("$type") > 1000000 {
7464
+
return xerrors.Errorf("Value in field \"$type\" was too long")
7467
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("$type"))); err != nil {
7954
-
if _, err := cw.WriteString(string("pull")); err != nil {
7470
+
if _, err := cw.WriteString(string("$type")); err != nil {
7474
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("sh.tangled.repo.pull"))); err != nil {
7477
+
if _, err := cw.WriteString(string("sh.tangled.repo.pull")); err != nil {
7958
-
if len(t.Pull) > 1000000 {
7959
-
return xerrors.Errorf("Value in field t.Pull was too long")
7481
+
// t.Patch (string) (string)
7482
+
if len("patch") > 1000000 {
7483
+
return xerrors.Errorf("Value in field \"patch\" was too long")
7962
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Pull))); err != nil {
7486
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("patch"))); err != nil {
7965
-
if _, err := cw.WriteString(string(t.Pull)); err != nil {
7489
+
if _, err := cw.WriteString(string("patch")); err != nil {
7969
-
// t.LexiconTypeID (string) (string)
7970
-
if len("$type") > 1000000 {
7971
-
return xerrors.Errorf("Value in field \"$type\" was too long")
7493
+
if len(t.Patch) > 1000000 {
7494
+
return xerrors.Errorf("Value in field t.Patch was too long")
7974
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("$type"))); err != nil {
7497
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Patch))); err != nil {
7977
-
if _, err := cw.WriteString(string("$type")); err != nil {
7500
+
if _, err := cw.WriteString(string(t.Patch)); err != nil {
7981
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("sh.tangled.repo.pull.status"))); err != nil {
7504
+
// t.Title (string) (string)
7505
+
if len("title") > 1000000 {
7506
+
return xerrors.Errorf("Value in field \"title\" was too long")
7509
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("title"))); err != nil {
7984
-
if _, err := cw.WriteString(string("sh.tangled.repo.pull.status")); err != nil {
7512
+
if _, err := cw.WriteString(string("title")); err != nil {
7988
-
// t.Status (string) (string)
7989
-
if len("status") > 1000000 {
7990
-
return xerrors.Errorf("Value in field \"status\" was too long")
7516
+
if len(t.Title) > 1000000 {
7517
+
return xerrors.Errorf("Value in field t.Title was too long")
7993
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("status"))); err != nil {
7520
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Title))); err != nil {
7996
-
if _, err := cw.WriteString(string("status")); err != nil {
7523
+
if _, err := cw.WriteString(string(t.Title)); err != nil {
8000
-
if len(t.Status) > 1000000 {
8001
-
return xerrors.Errorf("Value in field t.Status was too long")
7527
+
// t.PullId (int64) (int64)
7528
+
if len("pullId") > 1000000 {
7529
+
return xerrors.Errorf("Value in field \"pullId\" was too long")
8004
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Status))); err != nil {
7532
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("pullId"))); err != nil {
8007
-
if _, err := cw.WriteString(string(t.Status)); err != nil {
7535
+
if _, err := cw.WriteString(string("pullId")); err != nil {
7539
+
if t.PullId >= 0 {
7540
+
if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.PullId)); err != nil {
7544
+
if err := cw.WriteMajorTypeHeader(cbg.MajNegativeInt, uint64(-t.PullId-1)); err != nil {
7549
+
// t.Source (tangled.RepoPull_Source) (struct)
7550
+
if t.Source != nil {
7552
+
if len("source") > 1000000 {
7553
+
return xerrors.Errorf("Value in field \"source\" was too long")
7556
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("source"))); err != nil {
7559
+
if _, err := cw.WriteString(string("source")); err != nil {
7563
+
if err := t.Source.MarshalCBOR(cw); err != nil {
7568
+
// t.CreatedAt (string) (string)
7569
+
if len("createdAt") > 1000000 {
7570
+
return xerrors.Errorf("Value in field \"createdAt\" was too long")
7573
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("createdAt"))); err != nil {
7576
+
if _, err := cw.WriteString(string("createdAt")); err != nil {
7580
+
if len(t.CreatedAt) > 1000000 {
7581
+
return xerrors.Errorf("Value in field t.CreatedAt was too long")
7584
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.CreatedAt))); err != nil {
7587
+
if _, err := cw.WriteString(string(t.CreatedAt)); err != nil {
7591
+
// t.TargetRepo (string) (string)
7592
+
if len("targetRepo") > 1000000 {
7593
+
return xerrors.Errorf("Value in field \"targetRepo\" was too long")
7596
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("targetRepo"))); err != nil {
7599
+
if _, err := cw.WriteString(string("targetRepo")); err != nil {
7603
+
if len(t.TargetRepo) > 1000000 {
7604
+
return xerrors.Errorf("Value in field t.TargetRepo was too long")
7607
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.TargetRepo))); err != nil {
7610
+
if _, err := cw.WriteString(string(t.TargetRepo)); err != nil {
7614
+
// t.TargetBranch (string) (string)
7615
+
if len("targetBranch") > 1000000 {
7616
+
return xerrors.Errorf("Value in field \"targetBranch\" was too long")
7619
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("targetBranch"))); err != nil {
7622
+
if _, err := cw.WriteString(string("targetBranch")); err != nil {
7626
+
if len(t.TargetBranch) > 1000000 {
7627
+
return xerrors.Errorf("Value in field t.TargetBranch was too long")
7630
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.TargetBranch))); err != nil {
7633
+
if _, err := cw.WriteString(string(t.TargetBranch)); err != nil {
8013
-
func (t *RepoPullStatus) UnmarshalCBOR(r io.Reader) (err error) {
8014
-
*t = RepoPullStatus{}
7639
+
func (t *RepoPull) UnmarshalCBOR(r io.Reader) (err error) {
cr := cbg.NewCborReader(r)
···
if extra > cbg.MaxLength {
8033
-
return fmt.Errorf("RepoPullStatus: map struct too large (%d)", extra)
7659
+
return fmt.Errorf("RepoPull: map struct too large (%d)", extra)
8038
-
nameBuf := make([]byte, 6)
7664
+
nameBuf := make([]byte, 12)
for i := uint64(0); i < n; i++ {
nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000)
···
switch string(nameBuf[:nameLen]) {
8054
-
// t.Pull (string) (string)
7680
+
// t.Body (string) (string)
8058
-
sval, err := cbg.ReadStringWithMax(cr, 1000000)
7684
+
b, err := cr.ReadByte()
7688
+
if b != cbg.CborNull[0] {
7689
+
if err := cr.UnreadByte(); err != nil {
8063
-
t.Pull = string(sval)
7693
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
7698
+
t.Body = (*string)(&sval)
// t.LexiconTypeID (string) (string)
···
t.LexiconTypeID = string(sval)
8076
-
// t.Status (string) (string)
7712
+
// t.Patch (string) (string)
7716
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
7721
+
t.Patch = string(sval)
7723
+
// t.Title (string) (string)
7727
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
7732
+
t.Title = string(sval)
7734
+
// t.PullId (int64) (int64)
7737
+
maj, extra, err := cr.ReadHeader()
7743
+
case cbg.MajUnsignedInt:
7744
+
extraI = int64(extra)
7746
+
return fmt.Errorf("int64 positive overflow")
7748
+
case cbg.MajNegativeInt:
7749
+
extraI = int64(extra)
7751
+
return fmt.Errorf("int64 negative overflow")
7753
+
extraI = -1 - extraI
7755
+
return fmt.Errorf("wrong type for int64 field: %d", maj)
7758
+
t.PullId = int64(extraI)
7760
+
// t.Source (tangled.RepoPull_Source) (struct)
7765
+
b, err := cr.ReadByte()
7769
+
if b != cbg.CborNull[0] {
7770
+
if err := cr.UnreadByte(); err != nil {
7773
+
t.Source = new(RepoPull_Source)
7774
+
if err := t.Source.UnmarshalCBOR(cr); err != nil {
7775
+
return xerrors.Errorf("unmarshaling t.Source pointer: %w", err)
7780
+
// t.CreatedAt (string) (string)
sval, err := cbg.ReadStringWithMax(cr, 1000000)
···
8085
-
t.Status = string(sval)
7789
+
t.CreatedAt = string(sval)
7791
+
// t.TargetRepo (string) (string)
7792
+
case "targetRepo":
7795
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
7800
+
t.TargetRepo = string(sval)
7802
+
// t.TargetBranch (string) (string)
7803
+
case "targetBranch":
7806
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
7811
+
t.TargetBranch = string(sval)
···
8098
-
func (t *Spindle) MarshalCBOR(w io.Writer) error {
7824
+
func (t *Repo) MarshalCBOR(w io.Writer) error {
_, err := w.Write(cbg.CborNull)
cw := cbg.NewCborWriter(w)
8106
-
if _, err := cw.Write([]byte{162}); err != nil {
7833
+
if t.Description == nil {
7837
+
if t.Source == nil {
7841
+
if t.Spindle == nil {
7845
+
if _, err := cw.Write(cbg.CborEncodeMajorType(cbg.MajMap, uint64(fieldCount))); err != nil {
7849
+
// t.Knot (string) (string)
7850
+
if len("knot") > 1000000 {
7851
+
return xerrors.Errorf("Value in field \"knot\" was too long")
7854
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("knot"))); err != nil {
7857
+
if _, err := cw.WriteString(string("knot")); err != nil {
7861
+
if len(t.Knot) > 1000000 {
7862
+
return xerrors.Errorf("Value in field t.Knot was too long")
7865
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Knot))); err != nil {
7868
+
if _, err := cw.WriteString(string(t.Knot)); err != nil {
7872
+
// t.Name (string) (string)
7873
+
if len("name") > 1000000 {
7874
+
return xerrors.Errorf("Value in field \"name\" was too long")
7877
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("name"))); err != nil {
7880
+
if _, err := cw.WriteString(string("name")); err != nil {
7884
+
if len(t.Name) > 1000000 {
7885
+
return xerrors.Errorf("Value in field t.Name was too long")
7888
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Name))); err != nil {
7891
+
if _, err := cw.WriteString(string(t.Name)); err != nil {
···
8122
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("sh.tangled.spindle"))); err != nil {
7907
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("sh.tangled.repo"))); err != nil {
8125
-
if _, err := cw.WriteString(string("sh.tangled.spindle")); err != nil {
7910
+
if _, err := cw.WriteString(string("sh.tangled.repo")); err != nil {
7914
+
// t.Owner (string) (string)
7915
+
if len("owner") > 1000000 {
7916
+
return xerrors.Errorf("Value in field \"owner\" was too long")
7919
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("owner"))); err != nil {
7922
+
if _, err := cw.WriteString(string("owner")); err != nil {
7926
+
if len(t.Owner) > 1000000 {
7927
+
return xerrors.Errorf("Value in field t.Owner was too long")
7930
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Owner))); err != nil {
7933
+
if _, err := cw.WriteString(string(t.Owner)); err != nil {
7937
+
// t.Source (string) (string)
7938
+
if t.Source != nil {
7940
+
if len("source") > 1000000 {
7941
+
return xerrors.Errorf("Value in field \"source\" was too long")
7944
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("source"))); err != nil {
7947
+
if _, err := cw.WriteString(string("source")); err != nil {
7951
+
if t.Source == nil {
7952
+
if _, err := cw.Write(cbg.CborNull); err != nil {
7956
+
if len(*t.Source) > 1000000 {
7957
+
return xerrors.Errorf("Value in field t.Source was too long")
7960
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Source))); err != nil {
7963
+
if _, err := cw.WriteString(string(*t.Source)); err != nil {
7969
+
// t.Spindle (string) (string)
7970
+
if t.Spindle != nil {
7972
+
if len("spindle") > 1000000 {
7973
+
return xerrors.Errorf("Value in field \"spindle\" was too long")
7976
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("spindle"))); err != nil {
7979
+
if _, err := cw.WriteString(string("spindle")); err != nil {
7983
+
if t.Spindle == nil {
7984
+
if _, err := cw.Write(cbg.CborNull); err != nil {
7988
+
if len(*t.Spindle) > 1000000 {
7989
+
return xerrors.Errorf("Value in field t.Spindle was too long")
7992
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Spindle))); err != nil {
7995
+
if _, err := cw.WriteString(string(*t.Spindle)); 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 {
8024
+
// t.Description (string) (string)
8025
+
if t.Description != nil {
8027
+
if len("description") > 1000000 {
8028
+
return xerrors.Errorf("Value in field \"description\" was too long")
8031
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("description"))); err != nil {
8034
+
if _, err := cw.WriteString(string("description")); err != nil {
8038
+
if t.Description == nil {
8039
+
if _, err := cw.Write(cbg.CborNull); err != nil {
8043
+
if len(*t.Description) > 1000000 {
8044
+
return xerrors.Errorf("Value in field t.Description was too long")
8047
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Description))); err != nil {
8050
+
if _, err := cw.WriteString(string(*t.Description)); err != nil {
8154
-
func (t *Spindle) UnmarshalCBOR(r io.Reader) (err error) {
8058
+
func (t *Repo) UnmarshalCBOR(r io.Reader) (err error) {
cr := cbg.NewCborReader(r)
···
if extra > cbg.MaxLength {
8174
-
return fmt.Errorf("Spindle: map struct too large (%d)", extra)
8078
+
return fmt.Errorf("Repo: map struct too large (%d)", extra)
8179
-
nameBuf := make([]byte, 9)
8083
+
nameBuf := make([]byte, 11)
for i := uint64(0); i < n; i++ {
nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000)
···
switch string(nameBuf[:nameLen]) {
8195
-
// t.LexiconTypeID (string) (string)
8099
+
// t.Knot (string) (string)
8103
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
8108
+
t.Knot = string(sval)
8110
+
// t.Name (string) (string)
8114
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
8119
+
t.Name = string(sval)
8121
+
// t.LexiconTypeID (string) (string)
···
t.LexiconTypeID = string(sval)
8132
+
// t.Owner (string) (string)
8136
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
8141
+
t.Owner = string(sval)
8143
+
// t.Source (string) (string)
8147
+
b, err := cr.ReadByte()
8151
+
if b != cbg.CborNull[0] {
8152
+
if err := cr.UnreadByte(); err != nil {
8156
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
8161
+
t.Source = (*string)(&sval)
8164
+
// t.Spindle (string) (string)
8168
+
b, err := cr.ReadByte()
8172
+
if b != cbg.CborNull[0] {
8173
+
if err := cr.UnreadByte(); err != nil {
8177
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
8182
+
t.Spindle = (*string)(&sval)
// t.CreatedAt (string) (string)
···
t.CreatedAt = string(sval)
8196
+
// t.Description (string) (string)
8197
+
case "description":
8200
+
b, err := cr.ReadByte()
8204
+
if b != cbg.CborNull[0] {
8205
+
if err := cr.UnreadByte(); err != nil {
8209
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
8214
+
t.Description = (*string)(&sval)
···
t.Instance = string(sval)
8404
+
// t.CreatedAt (string) (string)
8408
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
8413
+
t.CreatedAt = string(sval)
8417
+
// Field doesn't exist on this type, so ignore it
8418
+
if err := cbg.ScanForLinks(r, func(cid.Cid) {}); err != nil {
8426
+
func (t *Spindle) MarshalCBOR(w io.Writer) error {
8428
+
_, err := w.Write(cbg.CborNull)
8432
+
cw := cbg.NewCborWriter(w)
8434
+
if _, err := cw.Write([]byte{162}); err != nil {
8438
+
// t.LexiconTypeID (string) (string)
8439
+
if len("$type") > 1000000 {
8440
+
return xerrors.Errorf("Value in field \"$type\" was too long")
8443
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("$type"))); err != nil {
8446
+
if _, err := cw.WriteString(string("$type")); err != nil {
8450
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("sh.tangled.spindle"))); err != nil {
8453
+
if _, err := cw.WriteString(string("sh.tangled.spindle")); err != nil {
8457
+
// t.CreatedAt (string) (string)
8458
+
if len("createdAt") > 1000000 {
8459
+
return xerrors.Errorf("Value in field \"createdAt\" was too long")
8462
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("createdAt"))); err != nil {
8465
+
if _, err := cw.WriteString(string("createdAt")); err != nil {
8469
+
if len(t.CreatedAt) > 1000000 {
8470
+
return xerrors.Errorf("Value in field t.CreatedAt was too long")
8473
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.CreatedAt))); err != nil {
8476
+
if _, err := cw.WriteString(string(t.CreatedAt)); err != nil {
8482
+
func (t *Spindle) UnmarshalCBOR(r io.Reader) (err error) {
8485
+
cr := cbg.NewCborReader(r)
8487
+
maj, extra, err := cr.ReadHeader()
8492
+
if err == io.EOF {
8493
+
err = io.ErrUnexpectedEOF
8497
+
if maj != cbg.MajMap {
8498
+
return fmt.Errorf("cbor input should be of type map")
8501
+
if extra > cbg.MaxLength {
8502
+
return fmt.Errorf("Spindle: map struct too large (%d)", extra)
8507
+
nameBuf := make([]byte, 9)
8508
+
for i := uint64(0); i < n; i++ {
8509
+
nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000)
8515
+
// Field doesn't exist on this type, so ignore it
8516
+
if err := cbg.ScanForLinks(cr, func(cid.Cid) {}); err != nil {
8522
+
switch string(nameBuf[:nameLen]) {
8523
+
// t.LexiconTypeID (string) (string)
8527
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
8532
+
t.LexiconTypeID = string(sval)
// t.CreatedAt (string) (string)