···
671
-
func (t *GitRefUpdate_Meta_CommitCount_ByEmail_Elem) MarshalCBOR(w io.Writer) error {
671
+
func (t *GitRefUpdate) MarshalCBOR(w io.Writer) error {
_, err := w.Write(cbg.CborNull)
···
cw := cbg.NewCborWriter(w)
679
-
if _, err := cw.Write([]byte{162}); err != nil {
679
+
if _, err := cw.Write([]byte{168}); err != nil {
683
-
// t.Count (int64) (int64)
684
-
if len("count") > 1000000 {
685
-
return xerrors.Errorf("Value in field \"count\" was too long")
683
+
// t.Ref (string) (string)
684
+
if len("ref") > 1000000 {
685
+
return xerrors.Errorf("Value in field \"ref\" was too long")
688
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("count"))); err != nil {
688
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("ref"))); err != nil {
691
-
if _, err := cw.WriteString(string("count")); err != nil {
691
+
if _, err := cw.WriteString(string("ref")); err != nil {
696
-
if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.Count)); err != nil {
700
-
if err := cw.WriteMajorTypeHeader(cbg.MajNegativeInt, uint64(-t.Count-1)); err != nil {
705
-
// t.Email (string) (string)
706
-
if len("email") > 1000000 {
707
-
return xerrors.Errorf("Value in field \"email\" was too long")
695
+
if len(t.Ref) > 1000000 {
696
+
return xerrors.Errorf("Value in field t.Ref was too long")
710
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("email"))); err != nil {
699
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Ref))); err != nil {
713
-
if _, err := cw.WriteString(string("email")); err != nil {
702
+
if _, err := cw.WriteString(string(t.Ref)); err != nil {
717
-
if len(t.Email) > 1000000 {
718
-
return xerrors.Errorf("Value in field t.Email was too long")
706
+
// t.Meta (tangled.GitRefUpdate_Meta) (struct)
707
+
if len("meta") > 1000000 {
708
+
return xerrors.Errorf("Value in field \"meta\" was too long")
721
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Email))); err != nil {
711
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("meta"))); err != nil {
724
-
if _, err := cw.WriteString(string(t.Email)); err != nil {
714
+
if _, err := cw.WriteString(string("meta")); err != nil {
730
-
func (t *GitRefUpdate_Meta_CommitCount_ByEmail_Elem) UnmarshalCBOR(r io.Reader) (err error) {
731
-
*t = GitRefUpdate_Meta_CommitCount_ByEmail_Elem{}
718
+
if err := t.Meta.MarshalCBOR(cw); err != nil {
733
-
cr := cbg.NewCborReader(r)
722
+
// t.LexiconTypeID (string) (string)
723
+
if len("$type") > 1000000 {
724
+
return xerrors.Errorf("Value in field \"$type\" was too long")
735
-
maj, extra, err := cr.ReadHeader()
727
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("$type"))); err != nil {
730
+
if _, err := cw.WriteString(string("$type")); err != nil {
741
-
err = io.ErrUnexpectedEOF
745
-
if maj != cbg.MajMap {
746
-
return fmt.Errorf("cbor input should be of type map")
734
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("sh.tangled.git.refUpdate"))); err != nil {
737
+
if _, err := cw.WriteString(string("sh.tangled.git.refUpdate")); err != nil {
749
-
if extra > cbg.MaxLength {
750
-
return fmt.Errorf("GitRefUpdate_Meta_CommitCount_ByEmail_Elem: map struct too large (%d)", extra)
741
+
// t.NewSha (string) (string)
742
+
if len("newSha") > 1000000 {
743
+
return xerrors.Errorf("Value in field \"newSha\" was too long")
746
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("newSha"))); err != nil {
749
+
if _, err := cw.WriteString(string("newSha")); err != nil {
755
-
nameBuf := make([]byte, 5)
756
-
for i := uint64(0); i < n; i++ {
757
-
nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000)
753
+
if len(t.NewSha) > 1000000 {
754
+
return xerrors.Errorf("Value in field t.NewSha was too long")
763
-
// Field doesn't exist on this type, so ignore it
764
-
if err := cbg.ScanForLinks(cr, func(cid.Cid) {}); err != nil {
757
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.NewSha))); err != nil {
760
+
if _, err := cw.WriteString(string(t.NewSha)); err != nil {
770
-
switch string(nameBuf[:nameLen]) {
771
-
// t.Count (int64) (int64)
774
-
maj, extra, err := cr.ReadHeader()
780
-
case cbg.MajUnsignedInt:
781
-
extraI = int64(extra)
783
-
return fmt.Errorf("int64 positive overflow")
785
-
case cbg.MajNegativeInt:
786
-
extraI = int64(extra)
788
-
return fmt.Errorf("int64 negative overflow")
790
-
extraI = -1 - extraI
792
-
return fmt.Errorf("wrong type for int64 field: %d", maj)
764
+
// t.OldSha (string) (string)
765
+
if len("oldSha") > 1000000 {
766
+
return xerrors.Errorf("Value in field \"oldSha\" was too long")
795
-
t.Count = int64(extraI)
797
-
// t.Email (string) (string)
769
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("oldSha"))); err != nil {
772
+
if _, err := cw.WriteString(string("oldSha")); err != nil {
801
-
sval, err := cbg.ReadStringWithMax(cr, 1000000)
776
+
if len(t.OldSha) > 1000000 {
777
+
return xerrors.Errorf("Value in field t.OldSha was too long")
806
-
t.Email = string(sval)
780
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.OldSha))); err != nil {
783
+
if _, err := cw.WriteString(string(t.OldSha)); err != nil {
810
-
// Field doesn't exist on this type, so ignore it
811
-
if err := cbg.ScanForLinks(r, func(cid.Cid) {}); err != nil {
787
+
// t.RepoDid (string) (string)
788
+
if len("repoDid") > 1000000 {
789
+
return xerrors.Errorf("Value in field \"repoDid\" was too long")
819
-
func (t *GitRefUpdate_Meta_CommitCount) MarshalCBOR(w io.Writer) error {
821
-
_, err := w.Write(cbg.CborNull)
792
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("repoDid"))); err != nil {
795
+
if _, err := cw.WriteString(string("repoDid")); err != nil {
825
-
cw := cbg.NewCborWriter(w)
799
+
if len(t.RepoDid) > 1000000 {
800
+
return xerrors.Errorf("Value in field t.RepoDid was too long")
803
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.RepoDid))); err != nil {
806
+
if _, err := cw.WriteString(string(t.RepoDid)); err != nil {
828
-
if t.ByEmail == nil {
810
+
// t.RepoName (string) (string)
811
+
if len("repoName") > 1000000 {
812
+
return xerrors.Errorf("Value in field \"repoName\" was too long")
832
-
if _, err := cw.Write(cbg.CborEncodeMajorType(cbg.MajMap, uint64(fieldCount))); err != nil {
815
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("repoName"))); err != nil {
818
+
if _, err := cw.WriteString(string("repoName")); err != nil {
836
-
// t.ByEmail ([]*tangled.GitRefUpdate_Meta_CommitCount_ByEmail_Elem) (slice)
837
-
if t.ByEmail != nil {
822
+
if len(t.RepoName) > 1000000 {
823
+
return xerrors.Errorf("Value in field t.RepoName was too long")
839
-
if len("byEmail") > 1000000 {
840
-
return xerrors.Errorf("Value in field \"byEmail\" was too long")
826
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.RepoName))); err != nil {
829
+
if _, err := cw.WriteString(string(t.RepoName)); err != nil {
843
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("byEmail"))); err != nil {
846
-
if _, err := cw.WriteString(string("byEmail")); err != nil {
833
+
// t.CommitterDid (string) (string)
834
+
if len("committerDid") > 1000000 {
835
+
return xerrors.Errorf("Value in field \"committerDid\" was too long")
850
-
if len(t.ByEmail) > 8192 {
851
-
return xerrors.Errorf("Slice value in field t.ByEmail was too long")
838
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("committerDid"))); err != nil {
841
+
if _, err := cw.WriteString(string("committerDid")); err != nil {
854
-
if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.ByEmail))); err != nil {
857
-
for _, v := range t.ByEmail {
858
-
if err := v.MarshalCBOR(cw); err != nil {
845
+
if len(t.CommitterDid) > 1000000 {
846
+
return xerrors.Errorf("Value in field t.CommitterDid was too long")
849
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.CommitterDid))); err != nil {
852
+
if _, err := cw.WriteString(string(t.CommitterDid)); err != nil {
867
-
func (t *GitRefUpdate_Meta_CommitCount) UnmarshalCBOR(r io.Reader) (err error) {
868
-
*t = GitRefUpdate_Meta_CommitCount{}
858
+
func (t *GitRefUpdate) UnmarshalCBOR(r io.Reader) (err error) {
859
+
*t = GitRefUpdate{}
cr := cbg.NewCborReader(r)
···
if extra > cbg.MaxLength {
887
-
return fmt.Errorf("GitRefUpdate_Meta_CommitCount: map struct too large (%d)", extra)
878
+
return fmt.Errorf("GitRefUpdate: map struct too large (%d)", extra)
892
-
nameBuf := make([]byte, 7)
883
+
nameBuf := make([]byte, 12)
for i := uint64(0); i < n; i++ {
nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000)
···
switch string(nameBuf[:nameLen]) {
908
-
// t.ByEmail ([]*tangled.GitRefUpdate_Meta_CommitCount_ByEmail_Elem) (slice)
899
+
// t.Ref (string) (string)
903
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
908
+
t.Ref = string(sval)
910
+
// t.Meta (tangled.GitRefUpdate_Meta) (struct)
915
+
b, err := cr.ReadByte()
919
+
if b != cbg.CborNull[0] {
920
+
if err := cr.UnreadByte(); err != nil {
923
+
t.Meta = new(GitRefUpdate_Meta)
924
+
if err := t.Meta.UnmarshalCBOR(cr); err != nil {
925
+
return xerrors.Errorf("unmarshaling t.Meta pointer: %w", err)
911
-
maj, extra, err = cr.ReadHeader()
930
+
// t.LexiconTypeID (string) (string)
917
-
return fmt.Errorf("t.ByEmail: array too large (%d)", extra)
934
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
939
+
t.LexiconTypeID = string(sval)
941
+
// t.NewSha (string) (string)
920
-
if maj != cbg.MajArray {
921
-
return fmt.Errorf("expected cbor array")
945
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
950
+
t.NewSha = string(sval)
952
+
// t.OldSha (string) (string)
925
-
t.ByEmail = make([]*GitRefUpdate_Meta_CommitCount_ByEmail_Elem, extra)
956
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
961
+
t.OldSha = string(sval)
963
+
// t.RepoDid (string) (string)
928
-
for i := 0; i < int(extra); i++ {
967
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
972
+
t.RepoDid = string(sval)
974
+
// t.RepoName (string) (string)
939
-
b, err := cr.ReadByte()
943
-
if b != cbg.CborNull[0] {
944
-
if err := cr.UnreadByte(); err != nil {
947
-
t.ByEmail[i] = new(GitRefUpdate_Meta_CommitCount_ByEmail_Elem)
948
-
if err := t.ByEmail[i].UnmarshalCBOR(cr); err != nil {
949
-
return xerrors.Errorf("unmarshaling t.ByEmail[i] pointer: %w", err)
978
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
983
+
t.RepoName = string(sval)
985
+
// t.CommitterDid (string) (string)
986
+
case "committerDid":
989
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
994
+
t.CommitterDid = string(sval)
···
1104
-
func (t *GitRefUpdate) MarshalCBOR(w io.Writer) error {
1143
+
func (t *GitRefUpdate_Meta_CommitCount) MarshalCBOR(w io.Writer) error {
_, err := w.Write(cbg.CborNull)
cw := cbg.NewCborWriter(w)
1112
-
if _, err := cw.Write([]byte{168}); err != nil {
1116
-
// t.Ref (string) (string)
1117
-
if len("ref") > 1000000 {
1118
-
return xerrors.Errorf("Value in field \"ref\" was too long")
1152
+
if t.ByEmail == nil {
1121
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("ref"))); err != nil {
1124
-
if _, err := cw.WriteString(string("ref")); err != nil {
1156
+
if _, err := cw.Write(cbg.CborEncodeMajorType(cbg.MajMap, uint64(fieldCount))); err != nil {
1128
-
if len(t.Ref) > 1000000 {
1129
-
return xerrors.Errorf("Value in field t.Ref was too long")
1160
+
// t.ByEmail ([]*tangled.GitRefUpdate_Meta_CommitCount_ByEmail_Elem) (slice)
1161
+
if t.ByEmail != nil {
1132
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Ref))); err != nil {
1135
-
if _, err := cw.WriteString(string(t.Ref)); err != nil {
1163
+
if len("byEmail") > 1000000 {
1164
+
return xerrors.Errorf("Value in field \"byEmail\" was too long")
1139
-
// t.Meta (tangled.GitRefUpdate_Meta) (struct)
1140
-
if len("meta") > 1000000 {
1141
-
return xerrors.Errorf("Value in field \"meta\" was too long")
1167
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("byEmail"))); err != nil {
1170
+
if _, err := cw.WriteString(string("byEmail")); err != nil {
1144
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("meta"))); err != nil {
1147
-
if _, err := cw.WriteString(string("meta")); err != nil {
1174
+
if len(t.ByEmail) > 8192 {
1175
+
return xerrors.Errorf("Slice value in field t.ByEmail was too long")
1151
-
if err := t.Meta.MarshalCBOR(cw); err != nil {
1178
+
if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.ByEmail))); err != nil {
1181
+
for _, v := range t.ByEmail {
1182
+
if err := v.MarshalCBOR(cw); err != nil {
1155
-
// t.LexiconTypeID (string) (string)
1156
-
if len("$type") > 1000000 {
1157
-
return xerrors.Errorf("Value in field \"$type\" was too long")
1191
+
func (t *GitRefUpdate_Meta_CommitCount) UnmarshalCBOR(r io.Reader) (err error) {
1192
+
*t = GitRefUpdate_Meta_CommitCount{}
1160
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("$type"))); err != nil {
1163
-
if _, err := cw.WriteString(string("$type")); err != nil {
1194
+
cr := cbg.NewCborReader(r)
1167
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("sh.tangled.git.refUpdate"))); err != nil {
1170
-
if _, err := cw.WriteString(string("sh.tangled.git.refUpdate")); err != nil {
1196
+
maj, extra, err := cr.ReadHeader()
1201
+
if err == io.EOF {
1202
+
err = io.ErrUnexpectedEOF
1174
-
// t.NewSha (string) (string)
1175
-
if len("newSha") > 1000000 {
1176
-
return xerrors.Errorf("Value in field \"newSha\" was too long")
1206
+
if maj != cbg.MajMap {
1207
+
return fmt.Errorf("cbor input should be of type map")
1179
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("newSha"))); err != nil {
1182
-
if _, err := cw.WriteString(string("newSha")); err != nil {
1210
+
if extra > cbg.MaxLength {
1211
+
return fmt.Errorf("GitRefUpdate_Meta_CommitCount: map struct too large (%d)", extra)
1186
-
if len(t.NewSha) > 1000000 {
1187
-
return xerrors.Errorf("Value in field t.NewSha was too long")
1190
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.NewSha))); err != nil {
1193
-
if _, err := cw.WriteString(string(t.NewSha)); err != nil {
1216
+
nameBuf := make([]byte, 7)
1217
+
for i := uint64(0); i < n; i++ {
1218
+
nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000)
1197
-
// t.OldSha (string) (string)
1198
-
if len("oldSha") > 1000000 {
1199
-
return xerrors.Errorf("Value in field \"oldSha\" was too long")
1224
+
// Field doesn't exist on this type, so ignore it
1225
+
if err := cbg.ScanForLinks(cr, func(cid.Cid) {}); err != nil {
1202
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("oldSha"))); err != nil {
1205
-
if _, err := cw.WriteString(string("oldSha")); err != nil {
1231
+
switch string(nameBuf[:nameLen]) {
1232
+
// t.ByEmail ([]*tangled.GitRefUpdate_Meta_CommitCount_ByEmail_Elem) (slice)
1209
-
if len(t.OldSha) > 1000000 {
1210
-
return xerrors.Errorf("Value in field t.OldSha was too long")
1235
+
maj, extra, err = cr.ReadHeader()
1213
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.OldSha))); err != nil {
1216
-
if _, err := cw.WriteString(string(t.OldSha)); err != nil {
1241
+
return fmt.Errorf("t.ByEmail: array too large (%d)", extra)
1220
-
// t.RepoDid (string) (string)
1221
-
if len("repoDid") > 1000000 {
1222
-
return xerrors.Errorf("Value in field \"repoDid\" was too long")
1244
+
if maj != cbg.MajArray {
1245
+
return fmt.Errorf("expected cbor array")
1225
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("repoDid"))); err != nil {
1228
-
if _, err := cw.WriteString(string("repoDid")); err != nil {
1249
+
t.ByEmail = make([]*GitRefUpdate_Meta_CommitCount_ByEmail_Elem, extra)
1232
-
if len(t.RepoDid) > 1000000 {
1233
-
return xerrors.Errorf("Value in field t.RepoDid was too long")
1252
+
for i := 0; i < int(extra); i++ {
1236
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.RepoDid))); err != nil {
1239
-
if _, err := cw.WriteString(string(t.RepoDid)); err != nil {
1243
-
// t.RepoName (string) (string)
1244
-
if len("repoName") > 1000000 {
1245
-
return xerrors.Errorf("Value in field \"repoName\" was too long")
1263
+
b, err := cr.ReadByte()
1267
+
if b != cbg.CborNull[0] {
1268
+
if err := cr.UnreadByte(); err != nil {
1271
+
t.ByEmail[i] = new(GitRefUpdate_Meta_CommitCount_ByEmail_Elem)
1272
+
if err := t.ByEmail[i].UnmarshalCBOR(cr); err != nil {
1273
+
return xerrors.Errorf("unmarshaling t.ByEmail[i] pointer: %w", err)
1283
+
// Field doesn't exist on this type, so ignore it
1284
+
if err := cbg.ScanForLinks(r, func(cid.Cid) {}); err != nil {
1248
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("repoName"))); err != nil {
1292
+
func (t *GitRefUpdate_Meta_CommitCount_ByEmail_Elem) MarshalCBOR(w io.Writer) error {
1294
+
_, err := w.Write(cbg.CborNull)
1251
-
if _, err := cw.WriteString(string("repoName")); err != nil {
1298
+
cw := cbg.NewCborWriter(w)
1300
+
if _, err := cw.Write([]byte{162}); err != nil {
1255
-
if len(t.RepoName) > 1000000 {
1256
-
return xerrors.Errorf("Value in field t.RepoName was too long")
1304
+
// t.Count (int64) (int64)
1305
+
if len("count") > 1000000 {
1306
+
return xerrors.Errorf("Value in field \"count\" was too long")
1259
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.RepoName))); err != nil {
1309
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("count"))); err != nil {
1262
-
if _, err := cw.WriteString(string(t.RepoName)); err != nil {
1312
+
if _, err := cw.WriteString(string("count")); err != nil {
1266
-
// t.CommitterDid (string) (string)
1267
-
if len("committerDid") > 1000000 {
1268
-
return xerrors.Errorf("Value in field \"committerDid\" was too long")
1317
+
if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.Count)); err != nil {
1321
+
if err := cw.WriteMajorTypeHeader(cbg.MajNegativeInt, uint64(-t.Count-1)); err != nil {
1326
+
// t.Email (string) (string)
1327
+
if len("email") > 1000000 {
1328
+
return xerrors.Errorf("Value in field \"email\" was too long")
1271
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("committerDid"))); err != nil {
1331
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("email"))); err != nil {
1274
-
if _, err := cw.WriteString(string("committerDid")); err != nil {
1334
+
if _, err := cw.WriteString(string("email")); err != nil {
1278
-
if len(t.CommitterDid) > 1000000 {
1279
-
return xerrors.Errorf("Value in field t.CommitterDid was too long")
1338
+
if len(t.Email) > 1000000 {
1339
+
return xerrors.Errorf("Value in field t.Email was too long")
1282
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.CommitterDid))); err != nil {
1342
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Email))); err != nil {
1285
-
if _, err := cw.WriteString(string(t.CommitterDid)); err != nil {
1345
+
if _, err := cw.WriteString(string(t.Email)); err != nil {
1291
-
func (t *GitRefUpdate) UnmarshalCBOR(r io.Reader) (err error) {
1292
-
*t = GitRefUpdate{}
1351
+
func (t *GitRefUpdate_Meta_CommitCount_ByEmail_Elem) UnmarshalCBOR(r io.Reader) (err error) {
1352
+
*t = GitRefUpdate_Meta_CommitCount_ByEmail_Elem{}
cr := cbg.NewCborReader(r)
···
if extra > cbg.MaxLength {
1311
-
return fmt.Errorf("GitRefUpdate: map struct too large (%d)", extra)
1371
+
return fmt.Errorf("GitRefUpdate_Meta_CommitCount_ByEmail_Elem: map struct too large (%d)", extra)
1316
-
nameBuf := make([]byte, 12)
1376
+
nameBuf := make([]byte, 5)
for i := uint64(0); i < n; i++ {
nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000)
···
switch string(nameBuf[:nameLen]) {
1332
-
// t.Ref (string) (string)
1392
+
// t.Count (int64) (int64)
1336
-
sval, err := cbg.ReadStringWithMax(cr, 1000000)
1395
+
maj, extra, err := cr.ReadHeader()
1341
-
t.Ref = string(sval)
1343
-
// t.Meta (tangled.GitRefUpdate_Meta) (struct)
1348
-
b, err := cr.ReadByte()
1352
-
if b != cbg.CborNull[0] {
1353
-
if err := cr.UnreadByte(); err != nil {
1401
+
case cbg.MajUnsignedInt:
1402
+
extraI = int64(extra)
1404
+
return fmt.Errorf("int64 positive overflow")
1356
-
t.Meta = new(GitRefUpdate_Meta)
1357
-
if err := t.Meta.UnmarshalCBOR(cr); err != nil {
1358
-
return xerrors.Errorf("unmarshaling t.Meta pointer: %w", err)
1406
+
case cbg.MajNegativeInt:
1407
+
extraI = int64(extra)
1409
+
return fmt.Errorf("int64 negative overflow")
1411
+
extraI = -1 - extraI
1413
+
return fmt.Errorf("wrong type for int64 field: %d", maj)
1416
+
t.Count = int64(extraI)
1363
-
// t.LexiconTypeID (string) (string)
1418
+
// t.Email (string) (string)
sval, err := cbg.ReadStringWithMax(cr, 1000000)
···
1372
-
t.LexiconTypeID = string(sval)
1374
-
// t.NewSha (string) (string)
1378
-
sval, err := cbg.ReadStringWithMax(cr, 1000000)
1383
-
t.NewSha = string(sval)
1385
-
// t.OldSha (string) (string)
1389
-
sval, err := cbg.ReadStringWithMax(cr, 1000000)
1394
-
t.OldSha = string(sval)
1396
-
// t.RepoDid (string) (string)
1400
-
sval, err := cbg.ReadStringWithMax(cr, 1000000)
1405
-
t.RepoDid = string(sval)
1407
-
// t.RepoName (string) (string)
1411
-
sval, err := cbg.ReadStringWithMax(cr, 1000000)
1416
-
t.RepoName = string(sval)
1418
-
// t.CommitterDid (string) (string)
1419
-
case "committerDid":
1422
-
sval, err := cbg.ReadStringWithMax(cr, 1000000)
1427
-
t.CommitterDid = string(sval)
1427
+
t.Email = string(sval)
···
1802
-
func (t *PipelineStatus) MarshalCBOR(w io.Writer) error {
1802
+
func (t *Pipeline) MarshalCBOR(w io.Writer) error {
_, err := w.Write(cbg.CborNull)
cw := cbg.NewCborWriter(w)
1811
-
if t.Error == nil {
1815
-
if t.ExitCode == nil {
1819
-
if _, err := cw.Write(cbg.CborEncodeMajorType(cbg.MajMap, uint64(fieldCount))); err != nil {
1810
+
if _, err := cw.Write([]byte{163}); err != nil {
···
1835
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("sh.tangled.pipeline.status"))); err != nil {
1826
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("sh.tangled.pipeline"))); err != nil {
1838
-
if _, err := cw.WriteString(string("sh.tangled.pipeline.status")); err != nil {
1829
+
if _, err := cw.WriteString(string("sh.tangled.pipeline")); err != nil {
1842
-
// t.Error (string) (string)
1843
-
if t.Error != nil {
1845
-
if len("error") > 1000000 {
1846
-
return xerrors.Errorf("Value in field \"error\" was too long")
1849
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("error"))); err != nil {
1852
-
if _, err := cw.WriteString(string("error")); err != nil {
1856
-
if t.Error == nil {
1857
-
if _, err := cw.Write(cbg.CborNull); err != nil {
1861
-
if len(*t.Error) > 1000000 {
1862
-
return xerrors.Errorf("Value in field t.Error was too long")
1865
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Error))); err != nil {
1868
-
if _, err := cw.WriteString(string(*t.Error)); err != nil {
1874
-
// t.Status (string) (string)
1875
-
if len("status") > 1000000 {
1876
-
return xerrors.Errorf("Value in field \"status\" was too long")
1833
+
// t.Workflows ([]*tangled.Pipeline_Workflow) (slice)
1834
+
if len("workflows") > 1000000 {
1835
+
return xerrors.Errorf("Value in field \"workflows\" was too long")
1879
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("status"))); err != nil {
1838
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("workflows"))); err != nil {
1882
-
if _, err := cw.WriteString(string("status")); err != nil {
1841
+
if _, err := cw.WriteString(string("workflows")); err != nil {
1886
-
if len(t.Status) > 1000000 {
1887
-
return xerrors.Errorf("Value in field t.Status was too long")
1845
+
if len(t.Workflows) > 8192 {
1846
+
return xerrors.Errorf("Slice value in field t.Workflows was too long")
1890
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Status))); err != nil {
1893
-
if _, err := cw.WriteString(string(t.Status)); err != nil {
1849
+
if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.Workflows))); err != nil {
1897
-
// t.ExitCode (int64) (int64)
1898
-
if t.ExitCode != nil {
1900
-
if len("exitCode") > 1000000 {
1901
-
return xerrors.Errorf("Value in field \"exitCode\" was too long")
1904
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("exitCode"))); err != nil {
1907
-
if _, err := cw.WriteString(string("exitCode")); err != nil {
1852
+
for _, v := range t.Workflows {
1853
+
if err := v.MarshalCBOR(cw); err != nil {
1911
-
if t.ExitCode == nil {
1912
-
if _, err := cw.Write(cbg.CborNull); err != nil {
1916
-
if *t.ExitCode >= 0 {
1917
-
if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(*t.ExitCode)); err != nil {
1921
-
if err := cw.WriteMajorTypeHeader(cbg.MajNegativeInt, uint64(-*t.ExitCode-1)); err != nil {
1929
-
// t.Pipeline (string) (string)
1930
-
if len("pipeline") > 1000000 {
1931
-
return xerrors.Errorf("Value in field \"pipeline\" was too long")
1934
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("pipeline"))); err != nil {
1937
-
if _, err := cw.WriteString(string("pipeline")); err != nil {
1941
-
if len(t.Pipeline) > 1000000 {
1942
-
return xerrors.Errorf("Value in field t.Pipeline was too long")
1945
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Pipeline))); err != nil {
1948
-
if _, err := cw.WriteString(string(t.Pipeline)); err != nil {
1952
-
// t.Workflow (string) (string)
1953
-
if len("workflow") > 1000000 {
1954
-
return xerrors.Errorf("Value in field \"workflow\" was too long")
1957
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("workflow"))); err != nil {
1960
-
if _, err := cw.WriteString(string("workflow")); err != nil {
1964
-
if len(t.Workflow) > 1000000 {
1965
-
return xerrors.Errorf("Value in field t.Workflow was too long")
1968
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Workflow))); err != nil {
1971
-
if _, err := cw.WriteString(string(t.Workflow)); err != nil {
1975
-
// t.CreatedAt (string) (string)
1976
-
if len("createdAt") > 1000000 {
1977
-
return xerrors.Errorf("Value in field \"createdAt\" was too long")
1859
+
// t.TriggerMetadata (tangled.Pipeline_TriggerMetadata) (struct)
1860
+
if len("triggerMetadata") > 1000000 {
1861
+
return xerrors.Errorf("Value in field \"triggerMetadata\" was too long")
1980
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("createdAt"))); err != nil {
1864
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("triggerMetadata"))); err != nil {
1983
-
if _, err := cw.WriteString(string("createdAt")); err != nil {
1867
+
if _, err := cw.WriteString(string("triggerMetadata")); err != nil {
1987
-
if len(t.CreatedAt) > 1000000 {
1988
-
return xerrors.Errorf("Value in field t.CreatedAt was too long")
1991
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.CreatedAt))); err != nil {
1994
-
if _, err := cw.WriteString(string(t.CreatedAt)); err != nil {
1871
+
if err := t.TriggerMetadata.MarshalCBOR(cw); err != nil {
2000
-
func (t *PipelineStatus) UnmarshalCBOR(r io.Reader) (err error) {
2001
-
*t = PipelineStatus{}
1877
+
func (t *Pipeline) UnmarshalCBOR(r io.Reader) (err error) {
cr := cbg.NewCborReader(r)
···
if extra > cbg.MaxLength {
2020
-
return fmt.Errorf("PipelineStatus: map struct too large (%d)", extra)
1897
+
return fmt.Errorf("Pipeline: map struct too large (%d)", extra)
2025
-
nameBuf := make([]byte, 9)
1902
+
nameBuf := make([]byte, 15)
for i := uint64(0); i < n; i++ {
nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000)
···
t.LexiconTypeID = string(sval)
2052
-
// t.Error (string) (string)
2056
-
b, err := cr.ReadByte()
2060
-
if b != cbg.CborNull[0] {
2061
-
if err := cr.UnreadByte(); err != nil {
1929
+
// t.Workflows ([]*tangled.Pipeline_Workflow) (slice)
2065
-
sval, err := cbg.ReadStringWithMax(cr, 1000000)
1932
+
maj, extra, err = cr.ReadHeader()
2070
-
t.Error = (*string)(&sval)
1938
+
return fmt.Errorf("t.Workflows: array too large (%d)", extra)
2073
-
// t.Status (string) (string)
2077
-
sval, err := cbg.ReadStringWithMax(cr, 1000000)
1941
+
if maj != cbg.MajArray {
1942
+
return fmt.Errorf("expected cbor array")
2082
-
t.Status = string(sval)
1946
+
t.Workflows = make([]*Pipeline_Workflow, extra)
2084
-
// t.ExitCode (int64) (int64)
2088
-
b, err := cr.ReadByte()
2092
-
if b != cbg.CborNull[0] {
2093
-
if err := cr.UnreadByte(); err != nil {
2096
-
maj, extra, err := cr.ReadHeader()
2102
-
case cbg.MajUnsignedInt:
2103
-
extraI = int64(extra)
2105
-
return fmt.Errorf("int64 positive overflow")
1949
+
for i := 0; i < int(extra); i++ {
1960
+
b, err := cr.ReadByte()
2107
-
case cbg.MajNegativeInt:
2108
-
extraI = int64(extra)
2110
-
return fmt.Errorf("int64 negative overflow")
1964
+
if b != cbg.CborNull[0] {
1965
+
if err := cr.UnreadByte(); err != nil {
1968
+
t.Workflows[i] = new(Pipeline_Workflow)
1969
+
if err := t.Workflows[i].UnmarshalCBOR(cr); err != nil {
1970
+
return xerrors.Errorf("unmarshaling t.Workflows[i] pointer: %w", err)
2112
-
extraI = -1 - extraI
2114
-
return fmt.Errorf("wrong type for int64 field: %d", maj)
2117
-
t.ExitCode = (*int64)(&extraI)
2120
-
// t.Pipeline (string) (string)
1978
+
// t.TriggerMetadata (tangled.Pipeline_TriggerMetadata) (struct)
1979
+
case "triggerMetadata":
2124
-
sval, err := cbg.ReadStringWithMax(cr, 1000000)
2129
-
t.Pipeline = string(sval)
2131
-
// t.Workflow (string) (string)
2135
-
sval, err := cbg.ReadStringWithMax(cr, 1000000)
1983
+
b, err := cr.ReadByte()
2140
-
t.Workflow = string(sval)
2142
-
// t.CreatedAt (string) (string)
2146
-
sval, err := cbg.ReadStringWithMax(cr, 1000000)
1987
+
if b != cbg.CborNull[0] {
1988
+
if err := cr.UnreadByte(); err != nil {
1991
+
t.TriggerMetadata = new(Pipeline_TriggerMetadata)
1992
+
if err := t.TriggerMetadata.UnmarshalCBOR(cr); err != nil {
1993
+
return xerrors.Errorf("unmarshaling t.TriggerMetadata pointer: %w", err)
2151
-
t.CreatedAt = string(sval)
···
2519
-
func (t *Pipeline_ManualTriggerData_Inputs_Elem) MarshalCBOR(w io.Writer) error {
2364
+
func (t *Pipeline_ManualTriggerData) MarshalCBOR(w io.Writer) error {
_, err := w.Write(cbg.CborNull)
cw := cbg.NewCborWriter(w)
2527
-
if _, err := cw.Write([]byte{162}); err != nil {
2531
-
// t.Key (string) (string)
2532
-
if len("key") > 1000000 {
2533
-
return xerrors.Errorf("Value in field \"key\" was too long")
2373
+
if t.Inputs == nil {
2536
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("key"))); err != nil {
2539
-
if _, err := cw.WriteString(string("key")); err != nil {
2377
+
if _, err := cw.Write(cbg.CborEncodeMajorType(cbg.MajMap, uint64(fieldCount))); err != nil {
2543
-
if len(t.Key) > 1000000 {
2544
-
return xerrors.Errorf("Value in field t.Key was too long")
2381
+
// t.Inputs ([]*tangled.Pipeline_ManualTriggerData_Inputs_Elem) (slice)
2382
+
if t.Inputs != nil {
2547
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Key))); err != nil {
2550
-
if _, err := cw.WriteString(string(t.Key)); err != nil {
2384
+
if len("inputs") > 1000000 {
2385
+
return xerrors.Errorf("Value in field \"inputs\" was too long")
2554
-
// t.Value (string) (string)
2555
-
if len("value") > 1000000 {
2556
-
return xerrors.Errorf("Value in field \"value\" was too long")
2388
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("inputs"))); err != nil {
2391
+
if _, err := cw.WriteString(string("inputs")); err != nil {
2559
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("value"))); err != nil {
2562
-
if _, err := cw.WriteString(string("value")); err != nil {
2395
+
if len(t.Inputs) > 8192 {
2396
+
return xerrors.Errorf("Slice value in field t.Inputs was too long")
2566
-
if len(t.Value) > 1000000 {
2567
-
return xerrors.Errorf("Value in field t.Value was too long")
2399
+
if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.Inputs))); err != nil {
2402
+
for _, v := range t.Inputs {
2403
+
if err := v.MarshalCBOR(cw); err != nil {
2570
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Value))); err != nil {
2573
-
if _, err := cw.WriteString(string(t.Value)); err != nil {
2579
-
func (t *Pipeline_ManualTriggerData_Inputs_Elem) UnmarshalCBOR(r io.Reader) (err error) {
2580
-
*t = Pipeline_ManualTriggerData_Inputs_Elem{}
2412
+
func (t *Pipeline_ManualTriggerData) UnmarshalCBOR(r io.Reader) (err error) {
2413
+
*t = Pipeline_ManualTriggerData{}
cr := cbg.NewCborReader(r)
···
if extra > cbg.MaxLength {
2599
-
return fmt.Errorf("Pipeline_ManualTriggerData_Inputs_Elem: map struct too large (%d)", extra)
2432
+
return fmt.Errorf("Pipeline_ManualTriggerData: map struct too large (%d)", extra)
2604
-
nameBuf := make([]byte, 5)
2437
+
nameBuf := make([]byte, 6)
for i := uint64(0); i < n; i++ {
nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000)
···
switch string(nameBuf[:nameLen]) {
2620
-
// t.Key (string) (string)
2453
+
// t.Inputs ([]*tangled.Pipeline_ManualTriggerData_Inputs_Elem) (slice)
2624
-
sval, err := cbg.ReadStringWithMax(cr, 1000000)
2456
+
maj, extra, err = cr.ReadHeader()
2629
-
t.Key = string(sval)
2462
+
return fmt.Errorf("t.Inputs: array too large (%d)", extra)
2465
+
if maj != cbg.MajArray {
2466
+
return fmt.Errorf("expected cbor array")
2470
+
t.Inputs = make([]*Pipeline_ManualTriggerData_Inputs_Elem, extra)
2631
-
// t.Value (string) (string)
2473
+
for i := 0; i < int(extra); i++ {
2635
-
sval, err := cbg.ReadStringWithMax(cr, 1000000)
2484
+
b, err := cr.ReadByte()
2488
+
if b != cbg.CborNull[0] {
2489
+
if err := cr.UnreadByte(); err != nil {
2492
+
t.Inputs[i] = new(Pipeline_ManualTriggerData_Inputs_Elem)
2493
+
if err := t.Inputs[i].UnmarshalCBOR(cr); err != nil {
2494
+
return xerrors.Errorf("unmarshaling t.Inputs[i] pointer: %w", err)
2640
-
t.Value = string(sval)
···
2653
-
func (t *Pipeline_ManualTriggerData) MarshalCBOR(w io.Writer) error {
2513
+
func (t *Pipeline_ManualTriggerData_Inputs_Elem) MarshalCBOR(w io.Writer) error {
_, err := w.Write(cbg.CborNull)
cw := cbg.NewCborWriter(w)
2662
-
if t.Inputs == nil {
2521
+
if _, err := cw.Write([]byte{162}); err != nil {
2666
-
if _, err := cw.Write(cbg.CborEncodeMajorType(cbg.MajMap, uint64(fieldCount))); err != nil {
2525
+
// t.Key (string) (string)
2526
+
if len("key") > 1000000 {
2527
+
return xerrors.Errorf("Value in field \"key\" was too long")
2530
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("key"))); err != nil {
2533
+
if _, err := cw.WriteString(string("key")); err != nil {
2670
-
// t.Inputs ([]*tangled.Pipeline_ManualTriggerData_Inputs_Elem) (slice)
2671
-
if t.Inputs != nil {
2537
+
if len(t.Key) > 1000000 {
2538
+
return xerrors.Errorf("Value in field t.Key was too long")
2673
-
if len("inputs") > 1000000 {
2674
-
return xerrors.Errorf("Value in field \"inputs\" was too long")
2541
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Key))); err != nil {
2544
+
if _, err := cw.WriteString(string(t.Key)); err != nil {
2677
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("inputs"))); err != nil {
2680
-
if _, err := cw.WriteString(string("inputs")); err != nil {
2548
+
// t.Value (string) (string)
2549
+
if len("value") > 1000000 {
2550
+
return xerrors.Errorf("Value in field \"value\" was too long")
2684
-
if len(t.Inputs) > 8192 {
2685
-
return xerrors.Errorf("Slice value in field t.Inputs was too long")
2553
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("value"))); err != nil {
2556
+
if _, err := cw.WriteString(string("value")); err != nil {
2688
-
if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.Inputs))); err != nil {
2691
-
for _, v := range t.Inputs {
2692
-
if err := v.MarshalCBOR(cw); err != nil {
2560
+
if len(t.Value) > 1000000 {
2561
+
return xerrors.Errorf("Value in field t.Value was too long")
2564
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Value))); err != nil {
2567
+
if _, err := cw.WriteString(string(t.Value)); err != nil {
2701
-
func (t *Pipeline_ManualTriggerData) UnmarshalCBOR(r io.Reader) (err error) {
2702
-
*t = Pipeline_ManualTriggerData{}
2573
+
func (t *Pipeline_ManualTriggerData_Inputs_Elem) UnmarshalCBOR(r io.Reader) (err error) {
2574
+
*t = Pipeline_ManualTriggerData_Inputs_Elem{}
cr := cbg.NewCborReader(r)
···
if extra > cbg.MaxLength {
2721
-
return fmt.Errorf("Pipeline_ManualTriggerData: map struct too large (%d)", extra)
2593
+
return fmt.Errorf("Pipeline_ManualTriggerData_Inputs_Elem: map struct too large (%d)", extra)
2726
-
nameBuf := make([]byte, 6)
2598
+
nameBuf := make([]byte, 5)
for i := uint64(0); i < n; i++ {
nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000)
···
switch string(nameBuf[:nameLen]) {
2742
-
// t.Inputs ([]*tangled.Pipeline_ManualTriggerData_Inputs_Elem) (slice)
2614
+
// t.Key (string) (string)
2745
-
maj, extra, err = cr.ReadHeader()
2751
-
return fmt.Errorf("t.Inputs: array too large (%d)", extra)
2754
-
if maj != cbg.MajArray {
2755
-
return fmt.Errorf("expected cbor array")
2618
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
2759
-
t.Inputs = make([]*Pipeline_ManualTriggerData_Inputs_Elem, extra)
2623
+
t.Key = string(sval)
2625
+
// t.Value (string) (string)
2762
-
for i := 0; i < int(extra); i++ {
2629
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
2773
-
b, err := cr.ReadByte()
2777
-
if b != cbg.CborNull[0] {
2778
-
if err := cr.UnreadByte(); err != nil {
2781
-
t.Inputs[i] = new(Pipeline_ManualTriggerData_Inputs_Elem)
2782
-
if err := t.Inputs[i].UnmarshalCBOR(cr); err != nil {
2783
-
return xerrors.Errorf("unmarshaling t.Inputs[i] pointer: %w", err)
2634
+
t.Value = string(sval)
···
func (t *Pipeline_Step_Environment_Elem) MarshalCBOR(w io.Writer) error {
_, err := w.Write(cbg.CborNull)
···
3152
+
func (t *PipelineStatus) MarshalCBOR(w io.Writer) error {
3154
+
_, err := w.Write(cbg.CborNull)
3158
+
cw := cbg.NewCborWriter(w)
3161
+
if t.Error == nil {
3165
+
if t.ExitCode == nil {
3169
+
if _, err := cw.Write(cbg.CborEncodeMajorType(cbg.MajMap, uint64(fieldCount))); err != nil {
3173
+
// t.LexiconTypeID (string) (string)
3174
+
if len("$type") > 1000000 {
3175
+
return xerrors.Errorf("Value in field \"$type\" was too long")
3178
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("$type"))); err != nil {
3181
+
if _, err := cw.WriteString(string("$type")); err != nil {
3185
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("sh.tangled.pipeline.status"))); err != nil {
3188
+
if _, err := cw.WriteString(string("sh.tangled.pipeline.status")); err != nil {
3192
+
// t.Error (string) (string)
3193
+
if t.Error != nil {
3195
+
if len("error") > 1000000 {
3196
+
return xerrors.Errorf("Value in field \"error\" was too long")
3199
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("error"))); err != nil {
3202
+
if _, err := cw.WriteString(string("error")); err != nil {
3206
+
if t.Error == nil {
3207
+
if _, err := cw.Write(cbg.CborNull); err != nil {
3211
+
if len(*t.Error) > 1000000 {
3212
+
return xerrors.Errorf("Value in field t.Error was too long")
3215
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Error))); err != nil {
3218
+
if _, err := cw.WriteString(string(*t.Error)); err != nil {
3224
+
// t.Status (string) (string)
3225
+
if len("status") > 1000000 {
3226
+
return xerrors.Errorf("Value in field \"status\" was too long")
3229
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("status"))); err != nil {
3232
+
if _, err := cw.WriteString(string("status")); err != nil {
3236
+
if len(t.Status) > 1000000 {
3237
+
return xerrors.Errorf("Value in field t.Status was too long")
3240
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Status))); err != nil {
3243
+
if _, err := cw.WriteString(string(t.Status)); err != nil {
3247
+
// t.ExitCode (int64) (int64)
3248
+
if t.ExitCode != nil {
3250
+
if len("exitCode") > 1000000 {
3251
+
return xerrors.Errorf("Value in field \"exitCode\" was too long")
3254
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("exitCode"))); err != nil {
3257
+
if _, err := cw.WriteString(string("exitCode")); err != nil {
3261
+
if t.ExitCode == nil {
3262
+
if _, err := cw.Write(cbg.CborNull); err != nil {
3266
+
if *t.ExitCode >= 0 {
3267
+
if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(*t.ExitCode)); err != nil {
3271
+
if err := cw.WriteMajorTypeHeader(cbg.MajNegativeInt, uint64(-*t.ExitCode-1)); err != nil {
3279
+
// t.Pipeline (string) (string)
3280
+
if len("pipeline") > 1000000 {
3281
+
return xerrors.Errorf("Value in field \"pipeline\" was too long")
3284
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("pipeline"))); err != nil {
3287
+
if _, err := cw.WriteString(string("pipeline")); err != nil {
3291
+
if len(t.Pipeline) > 1000000 {
3292
+
return xerrors.Errorf("Value in field t.Pipeline was too long")
3295
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Pipeline))); err != nil {
3298
+
if _, err := cw.WriteString(string(t.Pipeline)); err != nil {
3302
+
// t.Workflow (string) (string)
3303
+
if len("workflow") > 1000000 {
3304
+
return xerrors.Errorf("Value in field \"workflow\" was too long")
3307
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("workflow"))); err != nil {
3310
+
if _, err := cw.WriteString(string("workflow")); err != nil {
3314
+
if len(t.Workflow) > 1000000 {
3315
+
return xerrors.Errorf("Value in field t.Workflow was too long")
3318
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Workflow))); err != nil {
3321
+
if _, err := cw.WriteString(string(t.Workflow)); err != nil {
3325
+
// t.CreatedAt (string) (string)
3326
+
if len("createdAt") > 1000000 {
3327
+
return xerrors.Errorf("Value in field \"createdAt\" was too long")
3330
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("createdAt"))); err != nil {
3333
+
if _, err := cw.WriteString(string("createdAt")); err != nil {
3337
+
if len(t.CreatedAt) > 1000000 {
3338
+
return xerrors.Errorf("Value in field t.CreatedAt was too long")
3341
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.CreatedAt))); err != nil {
3344
+
if _, err := cw.WriteString(string(t.CreatedAt)); err != nil {
3350
+
func (t *PipelineStatus) UnmarshalCBOR(r io.Reader) (err error) {
3351
+
*t = PipelineStatus{}
3353
+
cr := cbg.NewCborReader(r)
3355
+
maj, extra, err := cr.ReadHeader()
3360
+
if err == io.EOF {
3361
+
err = io.ErrUnexpectedEOF
3365
+
if maj != cbg.MajMap {
3366
+
return fmt.Errorf("cbor input should be of type map")
3369
+
if extra > cbg.MaxLength {
3370
+
return fmt.Errorf("PipelineStatus: map struct too large (%d)", extra)
3375
+
nameBuf := make([]byte, 9)
3376
+
for i := uint64(0); i < n; i++ {
3377
+
nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000)
3383
+
// Field doesn't exist on this type, so ignore it
3384
+
if err := cbg.ScanForLinks(cr, func(cid.Cid) {}); err != nil {
3390
+
switch string(nameBuf[:nameLen]) {
3391
+
// t.LexiconTypeID (string) (string)
3395
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
3400
+
t.LexiconTypeID = string(sval)
3402
+
// t.Error (string) (string)
3406
+
b, err := cr.ReadByte()
3410
+
if b != cbg.CborNull[0] {
3411
+
if err := cr.UnreadByte(); err != nil {
3415
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
3420
+
t.Error = (*string)(&sval)
3423
+
// t.Status (string) (string)
3427
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
3432
+
t.Status = string(sval)
3434
+
// t.ExitCode (int64) (int64)
3438
+
b, err := cr.ReadByte()
3442
+
if b != cbg.CborNull[0] {
3443
+
if err := cr.UnreadByte(); err != nil {
3446
+
maj, extra, err := cr.ReadHeader()
3452
+
case cbg.MajUnsignedInt:
3453
+
extraI = int64(extra)
3455
+
return fmt.Errorf("int64 positive overflow")
3457
+
case cbg.MajNegativeInt:
3458
+
extraI = int64(extra)
3460
+
return fmt.Errorf("int64 negative overflow")
3462
+
extraI = -1 - extraI
3464
+
return fmt.Errorf("wrong type for int64 field: %d", maj)
3467
+
t.ExitCode = (*int64)(&extraI)
3470
+
// t.Pipeline (string) (string)
3474
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
3479
+
t.Pipeline = string(sval)
3481
+
// t.Workflow (string) (string)
3485
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
3490
+
t.Workflow = string(sval)
3492
+
// t.CreatedAt (string) (string)
3496
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
3501
+
t.CreatedAt = string(sval)
3505
+
// Field doesn't exist on this type, so ignore it
3506
+
if err := cbg.ScanForLinks(r, func(cid.Cid) {}); err != nil {
func (t *Pipeline_Step) MarshalCBOR(w io.Writer) error {
_, err := w.Write(cbg.CborNull)
···
3991
-
func (t *Pipeline_Workflow_Environment_Elem) MarshalCBOR(w io.Writer) error {
3993
-
_, err := w.Write(cbg.CborNull)
3997
-
cw := cbg.NewCborWriter(w)
3999
-
if _, err := cw.Write([]byte{162}); err != nil {
4003
-
// t.Key (string) (string)
4004
-
if len("key") > 1000000 {
4005
-
return xerrors.Errorf("Value in field \"key\" was too long")
4008
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("key"))); err != nil {
4011
-
if _, err := cw.WriteString(string("key")); err != nil {
4015
-
if len(t.Key) > 1000000 {
4016
-
return xerrors.Errorf("Value in field t.Key was too long")
4019
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Key))); err != nil {
4022
-
if _, err := cw.WriteString(string(t.Key)); err != nil {
4026
-
// t.Value (string) (string)
4027
-
if len("value") > 1000000 {
4028
-
return xerrors.Errorf("Value in field \"value\" was too long")
4031
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("value"))); err != nil {
4034
-
if _, err := cw.WriteString(string("value")); err != nil {
4038
-
if len(t.Value) > 1000000 {
4039
-
return xerrors.Errorf("Value in field t.Value was too long")
4042
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Value))); err != nil {
4045
-
if _, err := cw.WriteString(string(t.Value)); err != nil {
4051
-
func (t *Pipeline_Workflow_Environment_Elem) UnmarshalCBOR(r io.Reader) (err error) {
4052
-
*t = Pipeline_Workflow_Environment_Elem{}
4054
-
cr := cbg.NewCborReader(r)
4056
-
maj, extra, err := cr.ReadHeader()
4061
-
if err == io.EOF {
4062
-
err = io.ErrUnexpectedEOF
4066
-
if maj != cbg.MajMap {
4067
-
return fmt.Errorf("cbor input should be of type map")
4070
-
if extra > cbg.MaxLength {
4071
-
return fmt.Errorf("Pipeline_Workflow_Environment_Elem: map struct too large (%d)", extra)
4076
-
nameBuf := make([]byte, 5)
4077
-
for i := uint64(0); i < n; i++ {
4078
-
nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000)
4084
-
// Field doesn't exist on this type, so ignore it
4085
-
if err := cbg.ScanForLinks(cr, func(cid.Cid) {}); err != nil {
4091
-
switch string(nameBuf[:nameLen]) {
4092
-
// t.Key (string) (string)
4096
-
sval, err := cbg.ReadStringWithMax(cr, 1000000)
4101
-
t.Key = string(sval)
4103
-
// t.Value (string) (string)
4107
-
sval, err := cbg.ReadStringWithMax(cr, 1000000)
4112
-
t.Value = string(sval)
4116
-
// Field doesn't exist on this type, so ignore it
4117
-
if err := cbg.ScanForLinks(r, func(cid.Cid) {}); err != nil {
func (t *Pipeline_Workflow) MarshalCBOR(w io.Writer) error {
_, err := w.Write(cbg.CborNull)
···
4476
-
func (t *Pipeline) MarshalCBOR(w io.Writer) error {
4551
+
func (t *Pipeline_Workflow_Environment_Elem) MarshalCBOR(w io.Writer) error {
_, err := w.Write(cbg.CborNull)
···
cw := cbg.NewCborWriter(w)
4484
-
if _, err := cw.Write([]byte{163}); err != nil {
4559
+
if _, err := cw.Write([]byte{162}); err != nil {
4488
-
// t.LexiconTypeID (string) (string)
4489
-
if len("$type") > 1000000 {
4490
-
return xerrors.Errorf("Value in field \"$type\" was too long")
4563
+
// t.Key (string) (string)
4564
+
if len("key") > 1000000 {
4565
+
return xerrors.Errorf("Value in field \"key\" was too long")
4493
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("$type"))); err != nil {
4568
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("key"))); err != nil {
4496
-
if _, err := cw.WriteString(string("$type")); err != nil {
4571
+
if _, err := cw.WriteString(string("key")); err != nil {
4500
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("sh.tangled.pipeline"))); err != nil {
4503
-
if _, err := cw.WriteString(string("sh.tangled.pipeline")); err != nil {
4575
+
if len(t.Key) > 1000000 {
4576
+
return xerrors.Errorf("Value in field t.Key was too long")
4507
-
// t.Workflows ([]*tangled.Pipeline_Workflow) (slice)
4508
-
if len("workflows") > 1000000 {
4509
-
return xerrors.Errorf("Value in field \"workflows\" was too long")
4512
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("workflows"))); err != nil {
4579
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Key))); err != nil {
4515
-
if _, err := cw.WriteString(string("workflows")); err != nil {
4582
+
if _, err := cw.WriteString(string(t.Key)); err != nil {
4519
-
if len(t.Workflows) > 8192 {
4520
-
return xerrors.Errorf("Slice value in field t.Workflows was too long")
4586
+
// t.Value (string) (string)
4587
+
if len("value") > 1000000 {
4588
+
return xerrors.Errorf("Value in field \"value\" was too long")
4523
-
if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.Workflows))); err != nil {
4591
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("value"))); err != nil {
4526
-
for _, v := range t.Workflows {
4527
-
if err := v.MarshalCBOR(cw); err != nil {
4594
+
if _, err := cw.WriteString(string("value")); err != nil {
4533
-
// t.TriggerMetadata (tangled.Pipeline_TriggerMetadata) (struct)
4534
-
if len("triggerMetadata") > 1000000 {
4535
-
return xerrors.Errorf("Value in field \"triggerMetadata\" was too long")
4598
+
if len(t.Value) > 1000000 {
4599
+
return xerrors.Errorf("Value in field t.Value was too long")
4538
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("triggerMetadata"))); err != nil {
4602
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Value))); err != nil {
4541
-
if _, err := cw.WriteString(string("triggerMetadata")); err != nil {
4545
-
if err := t.TriggerMetadata.MarshalCBOR(cw); err != nil {
4605
+
if _, err := cw.WriteString(string(t.Value)); err != nil {
4551
-
func (t *Pipeline) UnmarshalCBOR(r io.Reader) (err error) {
4611
+
func (t *Pipeline_Workflow_Environment_Elem) UnmarshalCBOR(r io.Reader) (err error) {
4612
+
*t = Pipeline_Workflow_Environment_Elem{}
cr := cbg.NewCborReader(r)
···
if extra > cbg.MaxLength {
4571
-
return fmt.Errorf("Pipeline: map struct too large (%d)", extra)
4631
+
return fmt.Errorf("Pipeline_Workflow_Environment_Elem: map struct too large (%d)", extra)
4576
-
nameBuf := make([]byte, 15)
4636
+
nameBuf := make([]byte, 5)
for i := uint64(0); i < n; i++ {
nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000)
···
switch string(nameBuf[:nameLen]) {
4592
-
// t.LexiconTypeID (string) (string)
4652
+
// t.Key (string) (string)
sval, err := cbg.ReadStringWithMax(cr, 1000000)
···
4601
-
t.LexiconTypeID = string(sval)
4603
-
// t.Workflows ([]*tangled.Pipeline_Workflow) (slice)
4606
-
maj, extra, err = cr.ReadHeader()
4612
-
return fmt.Errorf("t.Workflows: array too large (%d)", extra)
4615
-
if maj != cbg.MajArray {
4616
-
return fmt.Errorf("expected cbor array")
4620
-
t.Workflows = make([]*Pipeline_Workflow, extra)
4623
-
for i := 0; i < int(extra); i++ {
4634
-
b, err := cr.ReadByte()
4638
-
if b != cbg.CborNull[0] {
4639
-
if err := cr.UnreadByte(); err != nil {
4642
-
t.Workflows[i] = new(Pipeline_Workflow)
4643
-
if err := t.Workflows[i].UnmarshalCBOR(cr); err != nil {
4644
-
return xerrors.Errorf("unmarshaling t.Workflows[i] pointer: %w", err)
4661
+
t.Key = string(sval)
4652
-
// t.TriggerMetadata (tangled.Pipeline_TriggerMetadata) (struct)
4653
-
case "triggerMetadata":
4663
+
// t.Value (string) (string)
4657
-
b, err := cr.ReadByte()
4667
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
4661
-
if b != cbg.CborNull[0] {
4662
-
if err := cr.UnreadByte(); err != nil {
4665
-
t.TriggerMetadata = new(Pipeline_TriggerMetadata)
4666
-
if err := t.TriggerMetadata.UnmarshalCBOR(cr); err != nil {
4667
-
return xerrors.Errorf("unmarshaling t.TriggerMetadata pointer: %w", err)
4672
+
t.Value = string(sval)
···
4883
+
func (t *Repo) MarshalCBOR(w io.Writer) error {
4885
+
_, err := w.Write(cbg.CborNull)
4889
+
cw := cbg.NewCborWriter(w)
4892
+
if t.Description == nil {
4896
+
if t.Source == nil {
4900
+
if t.Spindle == nil {
4904
+
if _, err := cw.Write(cbg.CborEncodeMajorType(cbg.MajMap, uint64(fieldCount))); err != nil {
4908
+
// t.Knot (string) (string)
4909
+
if len("knot") > 1000000 {
4910
+
return xerrors.Errorf("Value in field \"knot\" was too long")
4913
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("knot"))); err != nil {
4916
+
if _, err := cw.WriteString(string("knot")); err != nil {
4920
+
if len(t.Knot) > 1000000 {
4921
+
return xerrors.Errorf("Value in field t.Knot was too long")
4924
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Knot))); err != nil {
4927
+
if _, err := cw.WriteString(string(t.Knot)); err != nil {
4931
+
// t.Name (string) (string)
4932
+
if len("name") > 1000000 {
4933
+
return xerrors.Errorf("Value in field \"name\" was too long")
4936
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("name"))); err != nil {
4939
+
if _, err := cw.WriteString(string("name")); err != nil {
4943
+
if len(t.Name) > 1000000 {
4944
+
return xerrors.Errorf("Value in field t.Name was too long")
4947
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Name))); err != nil {
4950
+
if _, err := cw.WriteString(string(t.Name)); err != nil {
4954
+
// t.LexiconTypeID (string) (string)
4955
+
if len("$type") > 1000000 {
4956
+
return xerrors.Errorf("Value in field \"$type\" was too long")
4959
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("$type"))); err != nil {
4962
+
if _, err := cw.WriteString(string("$type")); err != nil {
4966
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("sh.tangled.repo"))); err != nil {
4969
+
if _, err := cw.WriteString(string("sh.tangled.repo")); err != nil {
4973
+
// t.Owner (string) (string)
4974
+
if len("owner") > 1000000 {
4975
+
return xerrors.Errorf("Value in field \"owner\" was too long")
4978
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("owner"))); err != nil {
4981
+
if _, err := cw.WriteString(string("owner")); err != nil {
4985
+
if len(t.Owner) > 1000000 {
4986
+
return xerrors.Errorf("Value in field t.Owner was too long")
4989
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Owner))); err != nil {
4992
+
if _, err := cw.WriteString(string(t.Owner)); err != nil {
4996
+
// t.Source (string) (string)
4997
+
if t.Source != nil {
4999
+
if len("source") > 1000000 {
5000
+
return xerrors.Errorf("Value in field \"source\" was too long")
5003
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("source"))); err != nil {
5006
+
if _, err := cw.WriteString(string("source")); err != nil {
5010
+
if t.Source == nil {
5011
+
if _, err := cw.Write(cbg.CborNull); err != nil {
5015
+
if len(*t.Source) > 1000000 {
5016
+
return xerrors.Errorf("Value in field t.Source was too long")
5019
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Source))); err != nil {
5022
+
if _, err := cw.WriteString(string(*t.Source)); err != nil {
5028
+
// t.Spindle (string) (string)
5029
+
if t.Spindle != nil {
5031
+
if len("spindle") > 1000000 {
5032
+
return xerrors.Errorf("Value in field \"spindle\" was too long")
5035
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("spindle"))); err != nil {
5038
+
if _, err := cw.WriteString(string("spindle")); err != nil {
5042
+
if t.Spindle == nil {
5043
+
if _, err := cw.Write(cbg.CborNull); err != nil {
5047
+
if len(*t.Spindle) > 1000000 {
5048
+
return xerrors.Errorf("Value in field t.Spindle was too long")
5051
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Spindle))); err != nil {
5054
+
if _, err := cw.WriteString(string(*t.Spindle)); err != nil {
5060
+
// t.CreatedAt (string) (string)
5061
+
if len("createdAt") > 1000000 {
5062
+
return xerrors.Errorf("Value in field \"createdAt\" was too long")
5065
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("createdAt"))); err != nil {
5068
+
if _, err := cw.WriteString(string("createdAt")); err != nil {
5072
+
if len(t.CreatedAt) > 1000000 {
5073
+
return xerrors.Errorf("Value in field t.CreatedAt was too long")
5076
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.CreatedAt))); err != nil {
5079
+
if _, err := cw.WriteString(string(t.CreatedAt)); err != nil {
5083
+
// t.Description (string) (string)
5084
+
if t.Description != nil {
5086
+
if len("description") > 1000000 {
5087
+
return xerrors.Errorf("Value in field \"description\" was too long")
5090
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("description"))); err != nil {
5093
+
if _, err := cw.WriteString(string("description")); err != nil {
5097
+
if t.Description == nil {
5098
+
if _, err := cw.Write(cbg.CborNull); err != nil {
5102
+
if len(*t.Description) > 1000000 {
5103
+
return xerrors.Errorf("Value in field t.Description was too long")
5106
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Description))); err != nil {
5109
+
if _, err := cw.WriteString(string(*t.Description)); err != nil {
5117
+
func (t *Repo) UnmarshalCBOR(r io.Reader) (err error) {
5120
+
cr := cbg.NewCborReader(r)
5122
+
maj, extra, err := cr.ReadHeader()
5127
+
if err == io.EOF {
5128
+
err = io.ErrUnexpectedEOF
5132
+
if maj != cbg.MajMap {
5133
+
return fmt.Errorf("cbor input should be of type map")
5136
+
if extra > cbg.MaxLength {
5137
+
return fmt.Errorf("Repo: map struct too large (%d)", extra)
5142
+
nameBuf := make([]byte, 11)
5143
+
for i := uint64(0); i < n; i++ {
5144
+
nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000)
5150
+
// Field doesn't exist on this type, so ignore it
5151
+
if err := cbg.ScanForLinks(cr, func(cid.Cid) {}); err != nil {
5157
+
switch string(nameBuf[:nameLen]) {
5158
+
// t.Knot (string) (string)
5162
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
5167
+
t.Knot = string(sval)
5169
+
// t.Name (string) (string)
5173
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
5178
+
t.Name = string(sval)
5180
+
// t.LexiconTypeID (string) (string)
5184
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
5189
+
t.LexiconTypeID = string(sval)
5191
+
// t.Owner (string) (string)
5195
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
5200
+
t.Owner = string(sval)
5202
+
// t.Source (string) (string)
5206
+
b, err := cr.ReadByte()
5210
+
if b != cbg.CborNull[0] {
5211
+
if err := cr.UnreadByte(); err != nil {
5215
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
5220
+
t.Source = (*string)(&sval)
5223
+
// t.Spindle (string) (string)
5227
+
b, err := cr.ReadByte()
5231
+
if b != cbg.CborNull[0] {
5232
+
if err := cr.UnreadByte(); err != nil {
5236
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
5241
+
t.Spindle = (*string)(&sval)
5244
+
// t.CreatedAt (string) (string)
5248
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
5253
+
t.CreatedAt = string(sval)
5255
+
// t.Description (string) (string)
5256
+
case "description":
5259
+
b, err := cr.ReadByte()
5263
+
if b != cbg.CborNull[0] {
5264
+
if err := cr.UnreadByte(); err != nil {
5268
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
5273
+
t.Description = (*string)(&sval)
5278
+
// Field doesn't exist on this type, so ignore it
5279
+
if err := cbg.ScanForLinks(r, func(cid.Cid) {}); err != nil {
func (t *RepoArtifact) MarshalCBOR(w io.Writer) error {
_, err := w.Write(cbg.CborNull)
···
5577
+
func (t *RepoIssue) MarshalCBOR(w io.Writer) error {
5579
+
_, err := w.Write(cbg.CborNull)
5583
+
cw := cbg.NewCborWriter(w)
5586
+
if t.Body == nil {
5590
+
if _, err := cw.Write(cbg.CborEncodeMajorType(cbg.MajMap, uint64(fieldCount))); err != nil {
5594
+
// t.Body (string) (string)
5595
+
if t.Body != nil {
5597
+
if len("body") > 1000000 {
5598
+
return xerrors.Errorf("Value in field \"body\" was too long")
5601
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("body"))); err != nil {
5604
+
if _, err := cw.WriteString(string("body")); err != nil {
5608
+
if t.Body == nil {
5609
+
if _, err := cw.Write(cbg.CborNull); err != nil {
5613
+
if len(*t.Body) > 1000000 {
5614
+
return xerrors.Errorf("Value in field t.Body was too long")
5617
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Body))); err != nil {
5620
+
if _, err := cw.WriteString(string(*t.Body)); err != nil {
5626
+
// t.Repo (string) (string)
5627
+
if len("repo") > 1000000 {
5628
+
return xerrors.Errorf("Value in field \"repo\" was too long")
5631
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("repo"))); err != nil {
5634
+
if _, err := cw.WriteString(string("repo")); err != nil {
5638
+
if len(t.Repo) > 1000000 {
5639
+
return xerrors.Errorf("Value in field t.Repo was too long")
5642
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Repo))); err != nil {
5645
+
if _, err := cw.WriteString(string(t.Repo)); err != nil {
5649
+
// t.LexiconTypeID (string) (string)
5650
+
if len("$type") > 1000000 {
5651
+
return xerrors.Errorf("Value in field \"$type\" was too long")
5654
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("$type"))); err != nil {
5657
+
if _, err := cw.WriteString(string("$type")); err != nil {
5661
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("sh.tangled.repo.issue"))); err != nil {
5664
+
if _, err := cw.WriteString(string("sh.tangled.repo.issue")); err != nil {
5668
+
// t.Owner (string) (string)
5669
+
if len("owner") > 1000000 {
5670
+
return xerrors.Errorf("Value in field \"owner\" was too long")
5673
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("owner"))); err != nil {
5676
+
if _, err := cw.WriteString(string("owner")); err != nil {
5680
+
if len(t.Owner) > 1000000 {
5681
+
return xerrors.Errorf("Value in field t.Owner was too long")
5684
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Owner))); err != nil {
5687
+
if _, err := cw.WriteString(string(t.Owner)); err != nil {
5691
+
// t.Title (string) (string)
5692
+
if len("title") > 1000000 {
5693
+
return xerrors.Errorf("Value in field \"title\" was too long")
5696
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("title"))); err != nil {
5699
+
if _, err := cw.WriteString(string("title")); err != nil {
5703
+
if len(t.Title) > 1000000 {
5704
+
return xerrors.Errorf("Value in field t.Title was too long")
5707
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Title))); err != nil {
5710
+
if _, err := cw.WriteString(string(t.Title)); err != nil {
5714
+
// t.IssueId (int64) (int64)
5715
+
if len("issueId") > 1000000 {
5716
+
return xerrors.Errorf("Value in field \"issueId\" was too long")
5719
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("issueId"))); err != nil {
5722
+
if _, err := cw.WriteString(string("issueId")); err != nil {
5726
+
if t.IssueId >= 0 {
5727
+
if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.IssueId)); err != nil {
5731
+
if err := cw.WriteMajorTypeHeader(cbg.MajNegativeInt, uint64(-t.IssueId-1)); err != nil {
5736
+
// t.CreatedAt (string) (string)
5737
+
if len("createdAt") > 1000000 {
5738
+
return xerrors.Errorf("Value in field \"createdAt\" was too long")
5741
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("createdAt"))); err != nil {
5744
+
if _, err := cw.WriteString(string("createdAt")); err != nil {
5748
+
if len(t.CreatedAt) > 1000000 {
5749
+
return xerrors.Errorf("Value in field t.CreatedAt was too long")
5752
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.CreatedAt))); err != nil {
5755
+
if _, err := cw.WriteString(string(t.CreatedAt)); err != nil {
5761
+
func (t *RepoIssue) UnmarshalCBOR(r io.Reader) (err error) {
5764
+
cr := cbg.NewCborReader(r)
5766
+
maj, extra, err := cr.ReadHeader()
5771
+
if err == io.EOF {
5772
+
err = io.ErrUnexpectedEOF
5776
+
if maj != cbg.MajMap {
5777
+
return fmt.Errorf("cbor input should be of type map")
5780
+
if extra > cbg.MaxLength {
5781
+
return fmt.Errorf("RepoIssue: map struct too large (%d)", extra)
5786
+
nameBuf := make([]byte, 9)
5787
+
for i := uint64(0); i < n; i++ {
5788
+
nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000)
5794
+
// Field doesn't exist on this type, so ignore it
5795
+
if err := cbg.ScanForLinks(cr, func(cid.Cid) {}); err != nil {
5801
+
switch string(nameBuf[:nameLen]) {
5802
+
// t.Body (string) (string)
5806
+
b, err := cr.ReadByte()
5810
+
if b != cbg.CborNull[0] {
5811
+
if err := cr.UnreadByte(); err != nil {
5815
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
5820
+
t.Body = (*string)(&sval)
5823
+
// t.Repo (string) (string)
5827
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
5832
+
t.Repo = string(sval)
5834
+
// t.LexiconTypeID (string) (string)
5838
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
5843
+
t.LexiconTypeID = string(sval)
5845
+
// t.Owner (string) (string)
5849
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
5854
+
t.Owner = string(sval)
5856
+
// t.Title (string) (string)
5860
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
5865
+
t.Title = string(sval)
5867
+
// t.IssueId (int64) (int64)
5870
+
maj, extra, err := cr.ReadHeader()
5876
+
case cbg.MajUnsignedInt:
5877
+
extraI = int64(extra)
5879
+
return fmt.Errorf("int64 positive overflow")
5881
+
case cbg.MajNegativeInt:
5882
+
extraI = int64(extra)
5884
+
return fmt.Errorf("int64 negative overflow")
5886
+
extraI = -1 - extraI
5888
+
return fmt.Errorf("wrong type for int64 field: %d", maj)
5891
+
t.IssueId = int64(extraI)
5893
+
// t.CreatedAt (string) (string)
5897
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
5902
+
t.CreatedAt = string(sval)
5906
+
// Field doesn't exist on this type, so ignore it
5907
+
if err := cbg.ScanForLinks(r, func(cid.Cid) {}); err != nil {
func (t *RepoIssueComment) MarshalCBOR(w io.Writer) error {
_, err := w.Write(cbg.CborNull)
···
5720
-
func (t *RepoIssue) MarshalCBOR(w io.Writer) error {
6464
+
func (t *RepoPull) MarshalCBOR(w io.Writer) error {
_, err := w.Write(cbg.CborNull)
cw := cbg.NewCborWriter(w)
6477
+
if t.Source == nil {
···
5769
-
// t.Repo (string) (string)
5770
-
if len("repo") > 1000000 {
5771
-
return xerrors.Errorf("Value in field \"repo\" was too long")
5774
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("repo"))); err != nil {
5777
-
if _, err := cw.WriteString(string("repo")); err != nil {
5781
-
if len(t.Repo) > 1000000 {
5782
-
return xerrors.Errorf("Value in field t.Repo was too long")
5785
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Repo))); err != nil {
5788
-
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")
···
5804
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("sh.tangled.repo.issue"))); err != nil {
6529
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("sh.tangled.repo.pull"))); err != nil {
5807
-
if _, err := cw.WriteString(string("sh.tangled.repo.issue")); err != nil {
6532
+
if _, err := cw.WriteString(string("sh.tangled.repo.pull")); err != nil {
5811
-
// t.Owner (string) (string)
5812
-
if len("owner") > 1000000 {
5813
-
return xerrors.Errorf("Value in field \"owner\" was too long")
6536
+
// t.Patch (string) (string)
6537
+
if len("patch") > 1000000 {
6538
+
return xerrors.Errorf("Value in field \"patch\" was too long")
5816
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("owner"))); err != nil {
6541
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("patch"))); err != nil {
5819
-
if _, err := cw.WriteString(string("owner")); err != nil {
6544
+
if _, err := cw.WriteString(string("patch")); err != nil {
5823
-
if len(t.Owner) > 1000000 {
5824
-
return xerrors.Errorf("Value in field t.Owner was too long")
6548
+
if len(t.Patch) > 1000000 {
6549
+
return xerrors.Errorf("Value in field t.Patch was too long")
5827
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Owner))); err != nil {
6552
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Patch))); err != nil {
5830
-
if _, err := cw.WriteString(string(t.Owner)); err != nil {
6555
+
if _, err := cw.WriteString(string(t.Patch)); err != nil {
···
5857
-
// t.IssueId (int64) (int64)
5858
-
if len("issueId") > 1000000 {
5859
-
return xerrors.Errorf("Value in field \"issueId\" was too long")
6582
+
// t.PullId (int64) (int64)
6583
+
if len("pullId") > 1000000 {
6584
+
return xerrors.Errorf("Value in field \"pullId\" was too long")
5862
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("issueId"))); err != nil {
6587
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("pullId"))); err != nil {
5865
-
if _, err := cw.WriteString(string("issueId")); err != nil {
6590
+
if _, err := cw.WriteString(string("pullId")); err != nil {
5869
-
if t.IssueId >= 0 {
5870
-
if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.IssueId)); err != nil {
6594
+
if t.PullId >= 0 {
6595
+
if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.PullId)); err != nil {
5874
-
if err := cw.WriteMajorTypeHeader(cbg.MajNegativeInt, uint64(-t.IssueId-1)); err != nil {
6599
+
if err := cw.WriteMajorTypeHeader(cbg.MajNegativeInt, uint64(-t.PullId-1)); err != nil {
6604
+
// t.Source (tangled.RepoPull_Source) (struct)
6605
+
if t.Source != nil {
6607
+
if len("source") > 1000000 {
6608
+
return xerrors.Errorf("Value in field \"source\" was too long")
6611
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("source"))); err != nil {
6614
+
if _, err := cw.WriteString(string("source")); err != nil {
6618
+
if err := t.Source.MarshalCBOR(cw); err != nil {
···
if _, err := cw.WriteString(string(t.CreatedAt)); err != nil {
6646
+
// t.TargetRepo (string) (string)
6647
+
if len("targetRepo") > 1000000 {
6648
+
return xerrors.Errorf("Value in field \"targetRepo\" was too long")
6651
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("targetRepo"))); err != nil {
6654
+
if _, err := cw.WriteString(string("targetRepo")); err != nil {
6658
+
if len(t.TargetRepo) > 1000000 {
6659
+
return xerrors.Errorf("Value in field t.TargetRepo was too long")
6662
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.TargetRepo))); err != nil {
6665
+
if _, err := cw.WriteString(string(t.TargetRepo)); err != nil {
6669
+
// t.TargetBranch (string) (string)
6670
+
if len("targetBranch") > 1000000 {
6671
+
return xerrors.Errorf("Value in field \"targetBranch\" was too long")
6674
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("targetBranch"))); err != nil {
6677
+
if _, err := cw.WriteString(string("targetBranch")); err != nil {
6681
+
if len(t.TargetBranch) > 1000000 {
6682
+
return xerrors.Errorf("Value in field t.TargetBranch was too long")
6685
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.TargetBranch))); err != nil {
6688
+
if _, err := cw.WriteString(string(t.TargetBranch)); err != nil {
5904
-
func (t *RepoIssue) UnmarshalCBOR(r io.Reader) (err error) {
6694
+
func (t *RepoPull) UnmarshalCBOR(r io.Reader) (err error) {
cr := cbg.NewCborReader(r)
···
if extra > cbg.MaxLength {
5924
-
return fmt.Errorf("RepoIssue: map struct too large (%d)", extra)
6714
+
return fmt.Errorf("RepoPull: map struct too large (%d)", extra)
5929
-
nameBuf := make([]byte, 9)
6719
+
nameBuf := make([]byte, 12)
for i := uint64(0); i < n; i++ {
nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000)
···
t.Body = (*string)(&sval)
5966
-
// t.Repo (string) (string)
5970
-
sval, err := cbg.ReadStringWithMax(cr, 1000000)
5975
-
t.Repo = string(sval)
// t.LexiconTypeID (string) (string)
···
t.LexiconTypeID = string(sval)
5988
-
// t.Owner (string) (string)
6767
+
// t.Patch (string) (string)
sval, err := cbg.ReadStringWithMax(cr, 1000000)
···
5997
-
t.Owner = string(sval)
6776
+
t.Patch = string(sval)
// t.Title (string) (string)
···
6010
-
// t.IssueId (int64) (int64)
6789
+
// t.PullId (int64) (int64)
maj, extra, err := cr.ReadHeader()
···
return fmt.Errorf("wrong type for int64 field: %d", maj)
6034
-
t.IssueId = int64(extraI)
6813
+
t.PullId = int64(extraI)
6815
+
// t.Source (tangled.RepoPull_Source) (struct)
6820
+
b, err := cr.ReadByte()
6824
+
if b != cbg.CborNull[0] {
6825
+
if err := cr.UnreadByte(); err != nil {
6828
+
t.Source = new(RepoPull_Source)
6829
+
if err := t.Source.UnmarshalCBOR(cr); err != nil {
6830
+
return xerrors.Errorf("unmarshaling t.Source pointer: %w", err)
// t.CreatedAt (string) (string)
···
t.CreatedAt = string(sval)
6846
+
// t.TargetRepo (string) (string)
6847
+
case "targetRepo":
6850
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
6855
+
t.TargetRepo = string(sval)
6857
+
// t.TargetBranch (string) (string)
6858
+
case "targetBranch":
6861
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
6866
+
t.TargetBranch = string(sval)
···
6443
-
func (t *RepoPullStatus) MarshalCBOR(w io.Writer) error {
6445
-
_, err := w.Write(cbg.CborNull)
6449
-
cw := cbg.NewCborWriter(w)
6451
-
if _, err := cw.Write([]byte{163}); err != nil {
6455
-
// t.Pull (string) (string)
6456
-
if len("pull") > 1000000 {
6457
-
return xerrors.Errorf("Value in field \"pull\" was too long")
6460
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("pull"))); err != nil {
6463
-
if _, err := cw.WriteString(string("pull")); err != nil {
6467
-
if len(t.Pull) > 1000000 {
6468
-
return xerrors.Errorf("Value in field t.Pull was too long")
6471
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Pull))); err != nil {
6474
-
if _, err := cw.WriteString(string(t.Pull)); err != nil {
6478
-
// t.LexiconTypeID (string) (string)
6479
-
if len("$type") > 1000000 {
6480
-
return xerrors.Errorf("Value in field \"$type\" was too long")
6483
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("$type"))); err != nil {
6486
-
if _, err := cw.WriteString(string("$type")); err != nil {
6490
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("sh.tangled.repo.pull.status"))); err != nil {
6493
-
if _, err := cw.WriteString(string("sh.tangled.repo.pull.status")); err != nil {
6497
-
// t.Status (string) (string)
6498
-
if len("status") > 1000000 {
6499
-
return xerrors.Errorf("Value in field \"status\" was too long")
6502
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("status"))); err != nil {
6505
-
if _, err := cw.WriteString(string("status")); err != nil {
6509
-
if len(t.Status) > 1000000 {
6510
-
return xerrors.Errorf("Value in field t.Status was too long")
6513
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Status))); err != nil {
6516
-
if _, err := cw.WriteString(string(t.Status)); err != nil {
6522
-
func (t *RepoPullStatus) UnmarshalCBOR(r io.Reader) (err error) {
6523
-
*t = RepoPullStatus{}
6525
-
cr := cbg.NewCborReader(r)
6527
-
maj, extra, err := cr.ReadHeader()
6532
-
if err == io.EOF {
6533
-
err = io.ErrUnexpectedEOF
6537
-
if maj != cbg.MajMap {
6538
-
return fmt.Errorf("cbor input should be of type map")
6541
-
if extra > cbg.MaxLength {
6542
-
return fmt.Errorf("RepoPullStatus: map struct too large (%d)", extra)
6547
-
nameBuf := make([]byte, 6)
6548
-
for i := uint64(0); i < n; i++ {
6549
-
nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000)
6555
-
// Field doesn't exist on this type, so ignore it
6556
-
if err := cbg.ScanForLinks(cr, func(cid.Cid) {}); err != nil {
6562
-
switch string(nameBuf[:nameLen]) {
6563
-
// t.Pull (string) (string)
6567
-
sval, err := cbg.ReadStringWithMax(cr, 1000000)
6572
-
t.Pull = string(sval)
6574
-
// t.LexiconTypeID (string) (string)
6578
-
sval, err := cbg.ReadStringWithMax(cr, 1000000)
6583
-
t.LexiconTypeID = string(sval)
6585
-
// t.Status (string) (string)
6589
-
sval, err := cbg.ReadStringWithMax(cr, 1000000)
6594
-
t.Status = string(sval)
6598
-
// Field doesn't exist on this type, so ignore it
6599
-
if err := cbg.ScanForLinks(r, func(cid.Cid) {}); err != nil {
func (t *RepoPull_Source) MarshalCBOR(w io.Writer) error {
_, err := w.Write(cbg.CborNull)
···
6765
-
func (t *RepoPull) MarshalCBOR(w io.Writer) error {
7422
+
func (t *RepoPullStatus) MarshalCBOR(w io.Writer) error {
_, err := w.Write(cbg.CborNull)
cw := cbg.NewCborWriter(w)
6774
-
if t.Body == nil {
6778
-
if t.Source == nil {
6782
-
if _, err := cw.Write(cbg.CborEncodeMajorType(cbg.MajMap, uint64(fieldCount))); err != nil {
7430
+
if _, err := cw.Write([]byte{163}); err != nil {
6786
-
// t.Body (string) (string)
6787
-
if t.Body != nil {
6789
-
if len("body") > 1000000 {
6790
-
return xerrors.Errorf("Value in field \"body\" was too long")
6793
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("body"))); err != nil {
6796
-
if _, err := cw.WriteString(string("body")); err != nil {
6800
-
if t.Body == nil {
6801
-
if _, err := cw.Write(cbg.CborNull); err != nil {
6805
-
if len(*t.Body) > 1000000 {
6806
-
return xerrors.Errorf("Value in field t.Body was too long")
6809
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Body))); err != nil {
6812
-
if _, err := cw.WriteString(string(*t.Body)); err != nil {
7434
+
// t.Pull (string) (string)
7435
+
if len("pull") > 1000000 {
7436
+
return xerrors.Errorf("Value in field \"pull\" was too long")
6818
-
// t.LexiconTypeID (string) (string)
6819
-
if len("$type") > 1000000 {
6820
-
return xerrors.Errorf("Value in field \"$type\" was too long")
6823
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("$type"))); err != nil {
6826
-
if _, err := cw.WriteString(string("$type")); err != nil {
6830
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("sh.tangled.repo.pull"))); err != nil {
6833
-
if _, err := cw.WriteString(string("sh.tangled.repo.pull")); err != nil {
6837
-
// t.Patch (string) (string)
6838
-
if len("patch") > 1000000 {
6839
-
return xerrors.Errorf("Value in field \"patch\" was too long")
6842
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("patch"))); err != nil {
6845
-
if _, err := cw.WriteString(string("patch")); err != nil {
6849
-
if len(t.Patch) > 1000000 {
6850
-
return xerrors.Errorf("Value in field t.Patch was too long")
6853
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Patch))); err != nil {
6856
-
if _, err := cw.WriteString(string(t.Patch)); err != nil {
6860
-
// t.Title (string) (string)
6861
-
if len("title") > 1000000 {
6862
-
return xerrors.Errorf("Value in field \"title\" was too long")
6865
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("title"))); err != nil {
6868
-
if _, err := cw.WriteString(string("title")); err != nil {
6872
-
if len(t.Title) > 1000000 {
6873
-
return xerrors.Errorf("Value in field t.Title was too long")
6876
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Title))); err != nil {
6879
-
if _, err := cw.WriteString(string(t.Title)); err != nil {
6883
-
// t.PullId (int64) (int64)
6884
-
if len("pullId") > 1000000 {
6885
-
return xerrors.Errorf("Value in field \"pullId\" was too long")
6888
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("pullId"))); err != nil {
7439
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("pull"))); err != nil {
6891
-
if _, err := cw.WriteString(string("pullId")); err != nil {
6895
-
if t.PullId >= 0 {
6896
-
if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.PullId)); err != nil {
6900
-
if err := cw.WriteMajorTypeHeader(cbg.MajNegativeInt, uint64(-t.PullId-1)); err != nil {
6905
-
// t.Source (tangled.RepoPull_Source) (struct)
6906
-
if t.Source != nil {
6908
-
if len("source") > 1000000 {
6909
-
return xerrors.Errorf("Value in field \"source\" was too long")
6912
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("source"))); err != nil {
6915
-
if _, err := cw.WriteString(string("source")); err != nil {
6919
-
if err := t.Source.MarshalCBOR(cw); err != nil {
6924
-
// t.CreatedAt (string) (string)
6925
-
if len("createdAt") > 1000000 {
6926
-
return xerrors.Errorf("Value in field \"createdAt\" was too long")
6929
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("createdAt"))); err != nil {
6932
-
if _, err := cw.WriteString(string("createdAt")); err != nil {
7442
+
if _, err := cw.WriteString(string("pull")); err != nil {
6936
-
if len(t.CreatedAt) > 1000000 {
6937
-
return xerrors.Errorf("Value in field t.CreatedAt was too long")
7446
+
if len(t.Pull) > 1000000 {
7447
+
return xerrors.Errorf("Value in field t.Pull was too long")
6940
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.CreatedAt))); err != nil {
7450
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Pull))); err != nil {
6943
-
if _, err := cw.WriteString(string(t.CreatedAt)); err != nil {
7453
+
if _, err := cw.WriteString(string(t.Pull)); err != nil {
6947
-
// t.TargetRepo (string) (string)
6948
-
if len("targetRepo") > 1000000 {
6949
-
return xerrors.Errorf("Value in field \"targetRepo\" was too long")
7457
+
// t.LexiconTypeID (string) (string)
7458
+
if len("$type") > 1000000 {
7459
+
return xerrors.Errorf("Value in field \"$type\" was too long")
6952
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("targetRepo"))); err != nil {
7462
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("$type"))); err != nil {
6955
-
if _, err := cw.WriteString(string("targetRepo")); err != nil {
7465
+
if _, err := cw.WriteString(string("$type")); err != nil {
6959
-
if len(t.TargetRepo) > 1000000 {
6960
-
return xerrors.Errorf("Value in field t.TargetRepo was too long")
6963
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.TargetRepo))); err != nil {
7469
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("sh.tangled.repo.pull.status"))); err != nil {
6966
-
if _, err := cw.WriteString(string(t.TargetRepo)); err != nil {
7472
+
if _, err := cw.WriteString(string("sh.tangled.repo.pull.status")); err != nil {
6970
-
// t.TargetBranch (string) (string)
6971
-
if len("targetBranch") > 1000000 {
6972
-
return xerrors.Errorf("Value in field \"targetBranch\" was too long")
7476
+
// t.Status (string) (string)
7477
+
if len("status") > 1000000 {
7478
+
return xerrors.Errorf("Value in field \"status\" was too long")
6975
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("targetBranch"))); err != nil {
7481
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("status"))); err != nil {
6978
-
if _, err := cw.WriteString(string("targetBranch")); err != nil {
7484
+
if _, err := cw.WriteString(string("status")); err != nil {
6982
-
if len(t.TargetBranch) > 1000000 {
6983
-
return xerrors.Errorf("Value in field t.TargetBranch was too long")
7488
+
if len(t.Status) > 1000000 {
7489
+
return xerrors.Errorf("Value in field t.Status was too long")
6986
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.TargetBranch))); err != nil {
7492
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Status))); err != nil {
6989
-
if _, err := cw.WriteString(string(t.TargetBranch)); err != nil {
7495
+
if _, err := cw.WriteString(string(t.Status)); err != nil {
6995
-
func (t *RepoPull) UnmarshalCBOR(r io.Reader) (err error) {
7501
+
func (t *RepoPullStatus) UnmarshalCBOR(r io.Reader) (err error) {
7502
+
*t = RepoPullStatus{}
cr := cbg.NewCborReader(r)
···
if extra > cbg.MaxLength {
7015
-
return fmt.Errorf("RepoPull: map struct too large (%d)", extra)
7521
+
return fmt.Errorf("RepoPullStatus: map struct too large (%d)", extra)
7020
-
nameBuf := make([]byte, 12)
7526
+
nameBuf := make([]byte, 6)
for i := uint64(0); i < n; i++ {
nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000)
···
switch string(nameBuf[:nameLen]) {
7036
-
// t.Body (string) (string)
7542
+
// t.Pull (string) (string)
7040
-
b, err := cr.ReadByte()
7546
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
7044
-
if b != cbg.CborNull[0] {
7045
-
if err := cr.UnreadByte(); err != nil {
7049
-
sval, err := cbg.ReadStringWithMax(cr, 1000000)
7054
-
t.Body = (*string)(&sval)
7551
+
t.Pull = string(sval)
// t.LexiconTypeID (string) (string)
···
t.LexiconTypeID = string(sval)
7068
-
// t.Patch (string) (string)
7072
-
sval, err := cbg.ReadStringWithMax(cr, 1000000)
7077
-
t.Patch = string(sval)
7079
-
// t.Title (string) (string)
7083
-
sval, err := cbg.ReadStringWithMax(cr, 1000000)
7088
-
t.Title = string(sval)
7090
-
// t.PullId (int64) (int64)
7093
-
maj, extra, err := cr.ReadHeader()
7099
-
case cbg.MajUnsignedInt:
7100
-
extraI = int64(extra)
7102
-
return fmt.Errorf("int64 positive overflow")
7104
-
case cbg.MajNegativeInt:
7105
-
extraI = int64(extra)
7107
-
return fmt.Errorf("int64 negative overflow")
7109
-
extraI = -1 - extraI
7111
-
return fmt.Errorf("wrong type for int64 field: %d", maj)
7114
-
t.PullId = int64(extraI)
7116
-
// t.Source (tangled.RepoPull_Source) (struct)
7121
-
b, err := cr.ReadByte()
7125
-
if b != cbg.CborNull[0] {
7126
-
if err := cr.UnreadByte(); err != nil {
7129
-
t.Source = new(RepoPull_Source)
7130
-
if err := t.Source.UnmarshalCBOR(cr); err != nil {
7131
-
return xerrors.Errorf("unmarshaling t.Source pointer: %w", err)
7136
-
// t.CreatedAt (string) (string)
7140
-
sval, err := cbg.ReadStringWithMax(cr, 1000000)
7145
-
t.CreatedAt = string(sval)
7147
-
// t.TargetRepo (string) (string)
7148
-
case "targetRepo":
7564
+
// t.Status (string) (string)
sval, err := cbg.ReadStringWithMax(cr, 1000000)
···
7156
-
t.TargetRepo = string(sval)
7158
-
// t.TargetBranch (string) (string)
7159
-
case "targetBranch":
7162
-
sval, err := cbg.ReadStringWithMax(cr, 1000000)
7167
-
t.TargetBranch = string(sval)
7573
+
t.Status = string(sval)
···
7180
-
func (t *Repo) MarshalCBOR(w io.Writer) error {
7586
+
func (t *Spindle) MarshalCBOR(w io.Writer) error {
_, err := w.Write(cbg.CborNull)
cw := cbg.NewCborWriter(w)
7189
-
if t.Description == nil {
7193
-
if t.Source == nil {
7197
-
if t.Spindle == nil {
7201
-
if _, err := cw.Write(cbg.CborEncodeMajorType(cbg.MajMap, uint64(fieldCount))); err != nil {
7205
-
// t.Knot (string) (string)
7206
-
if len("knot") > 1000000 {
7207
-
return xerrors.Errorf("Value in field \"knot\" was too long")
7210
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("knot"))); err != nil {
7213
-
if _, err := cw.WriteString(string("knot")); err != nil {
7217
-
if len(t.Knot) > 1000000 {
7218
-
return xerrors.Errorf("Value in field t.Knot was too long")
7221
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Knot))); err != nil {
7224
-
if _, err := cw.WriteString(string(t.Knot)); err != nil {
7228
-
// t.Name (string) (string)
7229
-
if len("name") > 1000000 {
7230
-
return xerrors.Errorf("Value in field \"name\" was too long")
7233
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("name"))); err != nil {
7236
-
if _, err := cw.WriteString(string("name")); err != nil {
7240
-
if len(t.Name) > 1000000 {
7241
-
return xerrors.Errorf("Value in field t.Name was too long")
7244
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Name))); err != nil {
7247
-
if _, err := cw.WriteString(string(t.Name)); err != nil {
7594
+
if _, err := cw.Write([]byte{162}); err != nil {
···
7263
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("sh.tangled.repo"))); err != nil {
7610
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("sh.tangled.spindle"))); err != nil {
7266
-
if _, err := cw.WriteString(string("sh.tangled.repo")); err != nil {
7613
+
if _, err := cw.WriteString(string("sh.tangled.spindle")); err != nil {
7270
-
// t.Owner (string) (string)
7271
-
if len("owner") > 1000000 {
7272
-
return xerrors.Errorf("Value in field \"owner\" was too long")
7275
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("owner"))); err != nil {
7278
-
if _, err := cw.WriteString(string("owner")); err != nil {
7282
-
if len(t.Owner) > 1000000 {
7283
-
return xerrors.Errorf("Value in field t.Owner was too long")
7286
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Owner))); err != nil {
7289
-
if _, err := cw.WriteString(string(t.Owner)); err != nil {
7293
-
// t.Source (string) (string)
7294
-
if t.Source != nil {
7296
-
if len("source") > 1000000 {
7297
-
return xerrors.Errorf("Value in field \"source\" was too long")
7300
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("source"))); err != nil {
7303
-
if _, err := cw.WriteString(string("source")); err != nil {
7307
-
if t.Source == nil {
7308
-
if _, err := cw.Write(cbg.CborNull); err != nil {
7312
-
if len(*t.Source) > 1000000 {
7313
-
return xerrors.Errorf("Value in field t.Source was too long")
7316
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Source))); err != nil {
7319
-
if _, err := cw.WriteString(string(*t.Source)); err != nil {
7325
-
// t.Spindle (string) (string)
7326
-
if t.Spindle != nil {
7328
-
if len("spindle") > 1000000 {
7329
-
return xerrors.Errorf("Value in field \"spindle\" was too long")
7332
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("spindle"))); err != nil {
7335
-
if _, err := cw.WriteString(string("spindle")); err != nil {
7339
-
if t.Spindle == nil {
7340
-
if _, err := cw.Write(cbg.CborNull); err != nil {
7344
-
if len(*t.Spindle) > 1000000 {
7345
-
return xerrors.Errorf("Value in field t.Spindle was too long")
7348
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Spindle))); err != nil {
7351
-
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 {
7380
-
// t.Description (string) (string)
7381
-
if t.Description != nil {
7383
-
if len("description") > 1000000 {
7384
-
return xerrors.Errorf("Value in field \"description\" was too long")
7387
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("description"))); err != nil {
7390
-
if _, err := cw.WriteString(string("description")); err != nil {
7394
-
if t.Description == nil {
7395
-
if _, err := cw.Write(cbg.CborNull); err != nil {
7399
-
if len(*t.Description) > 1000000 {
7400
-
return xerrors.Errorf("Value in field t.Description was too long")
7403
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Description))); err != nil {
7406
-
if _, err := cw.WriteString(string(*t.Description)); err != nil {
7414
-
func (t *Repo) UnmarshalCBOR(r io.Reader) (err error) {
7642
+
func (t *Spindle) UnmarshalCBOR(r io.Reader) (err error) {
cr := cbg.NewCborReader(r)
···
if extra > cbg.MaxLength {
7434
-
return fmt.Errorf("Repo: map struct too large (%d)", extra)
7662
+
return fmt.Errorf("Spindle: map struct too large (%d)", extra)
7439
-
nameBuf := make([]byte, 11)
7667
+
nameBuf := make([]byte, 9)
for i := uint64(0); i < n; i++ {
nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000)
···
switch string(nameBuf[:nameLen]) {
7455
-
// t.Knot (string) (string)
7459
-
sval, err := cbg.ReadStringWithMax(cr, 1000000)
7464
-
t.Knot = string(sval)
7466
-
// t.Name (string) (string)
7470
-
sval, err := cbg.ReadStringWithMax(cr, 1000000)
7475
-
t.Name = string(sval)
7477
-
// t.LexiconTypeID (string) (string)
7683
+
// t.LexiconTypeID (string) (string)
···
t.LexiconTypeID = string(sval)
7488
-
// t.Owner (string) (string)
7492
-
sval, err := cbg.ReadStringWithMax(cr, 1000000)
7497
-
t.Owner = string(sval)
7499
-
// t.Source (string) (string)
7503
-
b, err := cr.ReadByte()
7507
-
if b != cbg.CborNull[0] {
7508
-
if err := cr.UnreadByte(); err != nil {
7512
-
sval, err := cbg.ReadStringWithMax(cr, 1000000)
7517
-
t.Source = (*string)(&sval)
7520
-
// t.Spindle (string) (string)
7524
-
b, err := cr.ReadByte()
7528
-
if b != cbg.CborNull[0] {
7529
-
if err := cr.UnreadByte(); err != nil {
7533
-
sval, err := cbg.ReadStringWithMax(cr, 1000000)
7538
-
t.Spindle = (*string)(&sval)
// t.CreatedAt (string) (string)
···
t.CreatedAt = string(sval)
7552
-
// t.Description (string) (string)
7553
-
case "description":
7556
-
b, err := cr.ReadByte()
7560
-
if b != cbg.CborNull[0] {
7561
-
if err := cr.UnreadByte(); err != nil {
7565
-
sval, err := cbg.ReadStringWithMax(cr, 1000000)
7570
-
t.Description = (*string)(&sval)