forked from tangled.org/core
this repo has no description

lexicons: setup sh.tangled.spindle.member

Signed-off-by: Anirudh Oppiliappan <anirudh@tangled.sh>

anirudh.fi 9d70af5e 094b3606

verified
Changed files
+1714 -1428
api
cmd
spindle
lexicons
spindle
+1640 -1418
api/tangled/cbor_gen.go
···
return nil
}
-
func (t *GitRefUpdate) MarshalCBOR(w io.Writer) error {
+
func (t *GitRefUpdate_Meta_CommitCount_ByEmail_Elem) MarshalCBOR(w io.Writer) error {
if t == nil {
_, err := w.Write(cbg.CborNull)
return err
···
cw := cbg.NewCborWriter(w)
-
if _, err := cw.Write([]byte{168}); err != nil {
+
if _, err := cw.Write([]byte{162}); err != nil {
return err
}
-
// t.Ref (string) (string)
-
if len("ref") > 1000000 {
-
return xerrors.Errorf("Value in field \"ref\" was too long")
+
// t.Count (int64) (int64)
+
if len("count") > 1000000 {
+
return xerrors.Errorf("Value in field \"count\" was too long")
}
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("ref"))); err != nil {
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("count"))); err != nil {
return err
}
-
if _, err := cw.WriteString(string("ref")); err != nil {
+
if _, err := cw.WriteString(string("count")); err != nil {
return err
}
-
if len(t.Ref) > 1000000 {
-
return xerrors.Errorf("Value in field t.Ref was too long")
+
if t.Count >= 0 {
+
if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.Count)); err != nil {
+
return err
+
}
+
} else {
+
if err := cw.WriteMajorTypeHeader(cbg.MajNegativeInt, uint64(-t.Count-1)); err != nil {
+
return err
+
}
}
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Ref))); err != nil {
+
// t.Email (string) (string)
+
if len("email") > 1000000 {
+
return xerrors.Errorf("Value in field \"email\" was too long")
+
}
+
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("email"))); err != nil {
return err
}
-
if _, err := cw.WriteString(string(t.Ref)); err != nil {
+
if _, err := cw.WriteString(string("email")); err != nil {
return err
}
-
// t.Meta (tangled.GitRefUpdate_Meta) (struct)
-
if len("meta") > 1000000 {
-
return xerrors.Errorf("Value in field \"meta\" was too long")
+
if len(t.Email) > 1000000 {
+
return xerrors.Errorf("Value in field t.Email was too long")
}
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("meta"))); err != nil {
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Email))); err != nil {
return err
}
-
if _, err := cw.WriteString(string("meta")); err != nil {
+
if _, err := cw.WriteString(string(t.Email)); err != nil {
return err
}
+
return nil
+
}
-
if err := t.Meta.MarshalCBOR(cw); err != nil {
-
return err
-
}
+
func (t *GitRefUpdate_Meta_CommitCount_ByEmail_Elem) UnmarshalCBOR(r io.Reader) (err error) {
+
*t = GitRefUpdate_Meta_CommitCount_ByEmail_Elem{}
-
// t.LexiconTypeID (string) (string)
-
if len("$type") > 1000000 {
-
return xerrors.Errorf("Value in field \"$type\" was too long")
-
}
+
cr := cbg.NewCborReader(r)
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("$type"))); err != nil {
-
return err
-
}
-
if _, err := cw.WriteString(string("$type")); err != nil {
+
maj, extra, err := cr.ReadHeader()
+
if err != nil {
return err
}
+
defer func() {
+
if err == io.EOF {
+
err = io.ErrUnexpectedEOF
+
}
+
}()
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("sh.tangled.git.refUpdate"))); err != nil {
-
return err
-
}
-
if _, err := cw.WriteString(string("sh.tangled.git.refUpdate")); err != nil {
-
return err
+
if maj != cbg.MajMap {
+
return fmt.Errorf("cbor input should be of type map")
}
-
// t.NewSha (string) (string)
-
if len("newSha") > 1000000 {
-
return xerrors.Errorf("Value in field \"newSha\" was too long")
+
if extra > cbg.MaxLength {
+
return fmt.Errorf("GitRefUpdate_Meta_CommitCount_ByEmail_Elem: map struct too large (%d)", extra)
}
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("newSha"))); err != nil {
-
return err
-
}
-
if _, err := cw.WriteString(string("newSha")); err != nil {
-
return err
-
}
+
n := extra
-
if len(t.NewSha) > 1000000 {
-
return xerrors.Errorf("Value in field t.NewSha was too long")
-
}
+
nameBuf := make([]byte, 5)
+
for i := uint64(0); i < n; i++ {
+
nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000)
+
if err != nil {
+
return err
+
}
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.NewSha))); err != nil {
-
return err
-
}
-
if _, err := cw.WriteString(string(t.NewSha)); err != nil {
-
return err
-
}
+
if !ok {
+
// Field doesn't exist on this type, so ignore it
+
if err := cbg.ScanForLinks(cr, func(cid.Cid) {}); err != nil {
+
return err
+
}
+
continue
+
}
-
// t.OldSha (string) (string)
-
if len("oldSha") > 1000000 {
-
return xerrors.Errorf("Value in field \"oldSha\" was too long")
-
}
+
switch string(nameBuf[:nameLen]) {
+
// t.Count (int64) (int64)
+
case "count":
+
{
+
maj, extra, err := cr.ReadHeader()
+
if err != nil {
+
return err
+
}
+
var extraI int64
+
switch maj {
+
case cbg.MajUnsignedInt:
+
extraI = int64(extra)
+
if extraI < 0 {
+
return fmt.Errorf("int64 positive overflow")
+
}
+
case cbg.MajNegativeInt:
+
extraI = int64(extra)
+
if extraI < 0 {
+
return fmt.Errorf("int64 negative overflow")
+
}
+
extraI = -1 - extraI
+
default:
+
return fmt.Errorf("wrong type for int64 field: %d", maj)
+
}
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("oldSha"))); err != nil {
-
return err
-
}
-
if _, err := cw.WriteString(string("oldSha")); err != nil {
-
return err
-
}
+
t.Count = int64(extraI)
+
}
+
// t.Email (string) (string)
+
case "email":
-
if len(t.OldSha) > 1000000 {
-
return xerrors.Errorf("Value in field t.OldSha was too long")
-
}
+
{
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
+
if err != nil {
+
return err
+
}
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.OldSha))); err != nil {
-
return err
-
}
-
if _, err := cw.WriteString(string(t.OldSha)); err != nil {
-
return err
-
}
+
t.Email = string(sval)
+
}
-
// t.RepoDid (string) (string)
-
if len("repoDid") > 1000000 {
-
return xerrors.Errorf("Value in field \"repoDid\" was too long")
+
default:
+
// Field doesn't exist on this type, so ignore it
+
if err := cbg.ScanForLinks(r, func(cid.Cid) {}); err != nil {
+
return err
+
}
+
}
}
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("repoDid"))); err != nil {
-
return err
-
}
-
if _, err := cw.WriteString(string("repoDid")); err != nil {
+
return nil
+
}
+
func (t *GitRefUpdate_Meta_CommitCount) MarshalCBOR(w io.Writer) error {
+
if t == nil {
+
_, err := w.Write(cbg.CborNull)
return err
}
-
if len(t.RepoDid) > 1000000 {
-
return xerrors.Errorf("Value in field t.RepoDid was too long")
-
}
+
cw := cbg.NewCborWriter(w)
+
fieldCount := 1
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.RepoDid))); err != nil {
-
return err
-
}
-
if _, err := cw.WriteString(string(t.RepoDid)); err != nil {
-
return err
+
if t.ByEmail == nil {
+
fieldCount--
}
-
// t.RepoName (string) (string)
-
if len("repoName") > 1000000 {
-
return xerrors.Errorf("Value in field \"repoName\" was too long")
-
}
-
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("repoName"))); err != nil {
-
return err
-
}
-
if _, err := cw.WriteString(string("repoName")); err != nil {
+
if _, err := cw.Write(cbg.CborEncodeMajorType(cbg.MajMap, uint64(fieldCount))); err != nil {
return err
}
-
if len(t.RepoName) > 1000000 {
-
return xerrors.Errorf("Value in field t.RepoName was too long")
-
}
+
// t.ByEmail ([]*tangled.GitRefUpdate_Meta_CommitCount_ByEmail_Elem) (slice)
+
if t.ByEmail != nil {
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.RepoName))); err != nil {
-
return err
-
}
-
if _, err := cw.WriteString(string(t.RepoName)); err != nil {
-
return err
-
}
+
if len("byEmail") > 1000000 {
+
return xerrors.Errorf("Value in field \"byEmail\" was too long")
+
}
-
// t.CommitterDid (string) (string)
-
if len("committerDid") > 1000000 {
-
return xerrors.Errorf("Value in field \"committerDid\" was too long")
-
}
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("byEmail"))); err != nil {
+
return err
+
}
+
if _, err := cw.WriteString(string("byEmail")); err != nil {
+
return err
+
}
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("committerDid"))); err != nil {
-
return err
-
}
-
if _, err := cw.WriteString(string("committerDid")); err != nil {
-
return err
-
}
+
if len(t.ByEmail) > 8192 {
+
return xerrors.Errorf("Slice value in field t.ByEmail was too long")
+
}
-
if len(t.CommitterDid) > 1000000 {
-
return xerrors.Errorf("Value in field t.CommitterDid was too long")
-
}
+
if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.ByEmail))); err != nil {
+
return err
+
}
+
for _, v := range t.ByEmail {
+
if err := v.MarshalCBOR(cw); err != nil {
+
return err
+
}
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.CommitterDid))); err != nil {
-
return err
-
}
-
if _, err := cw.WriteString(string(t.CommitterDid)); err != nil {
-
return err
+
}
}
return nil
}
-
func (t *GitRefUpdate) UnmarshalCBOR(r io.Reader) (err error) {
-
*t = GitRefUpdate{}
+
func (t *GitRefUpdate_Meta_CommitCount) UnmarshalCBOR(r io.Reader) (err error) {
+
*t = GitRefUpdate_Meta_CommitCount{}
cr := cbg.NewCborReader(r)
···
}
if extra > cbg.MaxLength {
-
return fmt.Errorf("GitRefUpdate: map struct too large (%d)", extra)
+
return fmt.Errorf("GitRefUpdate_Meta_CommitCount: map struct too large (%d)", extra)
}
n := extra
-
nameBuf := make([]byte, 12)
+
nameBuf := make([]byte, 7)
for i := uint64(0); i < n; i++ {
nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000)
if err != nil {
···
}
switch string(nameBuf[:nameLen]) {
-
// t.Ref (string) (string)
-
case "ref":
-
-
{
-
sval, err := cbg.ReadStringWithMax(cr, 1000000)
-
if err != nil {
-
return err
-
}
+
// t.ByEmail ([]*tangled.GitRefUpdate_Meta_CommitCount_ByEmail_Elem) (slice)
+
case "byEmail":
-
t.Ref = string(sval)
+
maj, extra, err = cr.ReadHeader()
+
if err != nil {
+
return err
}
-
// t.Meta (tangled.GitRefUpdate_Meta) (struct)
-
case "meta":
-
{
-
-
b, err := cr.ReadByte()
-
if err != nil {
-
return err
-
}
-
if b != cbg.CborNull[0] {
-
if err := cr.UnreadByte(); err != nil {
-
return err
-
}
-
t.Meta = new(GitRefUpdate_Meta)
-
if err := t.Meta.UnmarshalCBOR(cr); err != nil {
-
return xerrors.Errorf("unmarshaling t.Meta pointer: %w", err)
-
}
-
}
-
+
if extra > 8192 {
+
return fmt.Errorf("t.ByEmail: array too large (%d)", extra)
}
-
// t.LexiconTypeID (string) (string)
-
case "$type":
-
-
{
-
sval, err := cbg.ReadStringWithMax(cr, 1000000)
-
if err != nil {
-
return err
-
}
-
t.LexiconTypeID = string(sval)
+
if maj != cbg.MajArray {
+
return fmt.Errorf("expected cbor array")
}
-
// t.NewSha (string) (string)
-
case "newSha":
-
{
-
sval, err := cbg.ReadStringWithMax(cr, 1000000)
-
if err != nil {
-
return err
-
}
-
-
t.NewSha = string(sval)
+
if extra > 0 {
+
t.ByEmail = make([]*GitRefUpdate_Meta_CommitCount_ByEmail_Elem, extra)
}
-
// t.OldSha (string) (string)
-
case "oldSha":
-
{
-
sval, err := cbg.ReadStringWithMax(cr, 1000000)
-
if err != nil {
-
return err
-
}
+
for i := 0; i < int(extra); i++ {
+
{
+
var maj byte
+
var extra uint64
+
var err error
+
_ = maj
+
_ = extra
+
_ = err
-
t.OldSha = string(sval)
-
}
-
// t.RepoDid (string) (string)
-
case "repoDid":
+
{
-
{
-
sval, err := cbg.ReadStringWithMax(cr, 1000000)
-
if err != nil {
-
return err
-
}
-
-
t.RepoDid = string(sval)
-
}
-
// t.RepoName (string) (string)
-
case "repoName":
-
-
{
-
sval, err := cbg.ReadStringWithMax(cr, 1000000)
-
if err != nil {
-
return err
-
}
+
b, err := cr.ReadByte()
+
if err != nil {
+
return err
+
}
+
if b != cbg.CborNull[0] {
+
if err := cr.UnreadByte(); err != nil {
+
return err
+
}
+
t.ByEmail[i] = new(GitRefUpdate_Meta_CommitCount_ByEmail_Elem)
+
if err := t.ByEmail[i].UnmarshalCBOR(cr); err != nil {
+
return xerrors.Errorf("unmarshaling t.ByEmail[i] pointer: %w", err)
+
}
+
}
-
t.RepoName = string(sval)
-
}
-
// t.CommitterDid (string) (string)
-
case "committerDid":
+
}
-
{
-
sval, err := cbg.ReadStringWithMax(cr, 1000000)
-
if err != nil {
-
return err
}
-
-
t.CommitterDid = string(sval)
}
default:
···
return nil
-
func (t *GitRefUpdate_Meta_CommitCount) MarshalCBOR(w io.Writer) error {
+
func (t *GitRefUpdate) MarshalCBOR(w io.Writer) error {
if t == nil {
_, err := w.Write(cbg.CborNull)
return err
cw := cbg.NewCborWriter(w)
-
fieldCount := 1
-
if t.ByEmail == nil {
-
fieldCount--
+
if _, err := cw.Write([]byte{168}); err != nil {
+
return err
+
}
+
+
// t.Ref (string) (string)
+
if len("ref") > 1000000 {
+
return xerrors.Errorf("Value in field \"ref\" was too long")
-
if _, err := cw.Write(cbg.CborEncodeMajorType(cbg.MajMap, uint64(fieldCount))); err != nil {
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("ref"))); err != nil {
+
return err
+
}
+
if _, err := cw.WriteString(string("ref")); err != nil {
return err
-
// t.ByEmail ([]*tangled.GitRefUpdate_Meta_CommitCount_ByEmail_Elem) (slice)
-
if t.ByEmail != nil {
+
if len(t.Ref) > 1000000 {
+
return xerrors.Errorf("Value in field t.Ref was too long")
+
}
-
if len("byEmail") > 1000000 {
-
return xerrors.Errorf("Value in field \"byEmail\" was too long")
-
}
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Ref))); err != nil {
+
return err
+
}
+
if _, err := cw.WriteString(string(t.Ref)); err != nil {
+
return err
+
}
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("byEmail"))); err != nil {
-
return err
-
}
-
if _, err := cw.WriteString(string("byEmail")); err != nil {
-
return err
-
}
-
-
if len(t.ByEmail) > 8192 {
-
return xerrors.Errorf("Slice value in field t.ByEmail was too long")
-
}
+
// t.Meta (tangled.GitRefUpdate_Meta) (struct)
+
if len("meta") > 1000000 {
+
return xerrors.Errorf("Value in field \"meta\" was too long")
+
}
-
if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.ByEmail))); err != nil {
-
return err
-
}
-
for _, v := range t.ByEmail {
-
if err := v.MarshalCBOR(cw); err != nil {
-
return err
-
}
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("meta"))); err != nil {
+
return err
+
}
+
if _, err := cw.WriteString(string("meta")); err != nil {
+
return err
+
}
-
}
+
if err := t.Meta.MarshalCBOR(cw); err != nil {
+
return err
-
return nil
-
}
-
func (t *GitRefUpdate_Meta_CommitCount) UnmarshalCBOR(r io.Reader) (err error) {
-
*t = GitRefUpdate_Meta_CommitCount{}
+
// t.LexiconTypeID (string) (string)
+
if len("$type") > 1000000 {
+
return xerrors.Errorf("Value in field \"$type\" was too long")
+
}
-
cr := cbg.NewCborReader(r)
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("$type"))); err != nil {
+
return err
+
}
+
if _, err := cw.WriteString(string("$type")); err != nil {
+
return err
+
}
-
maj, extra, err := cr.ReadHeader()
-
if err != nil {
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("sh.tangled.git.refUpdate"))); err != nil {
+
return err
+
}
+
if _, err := cw.WriteString(string("sh.tangled.git.refUpdate")); err != nil {
return err
-
defer func() {
-
if err == io.EOF {
-
err = io.ErrUnexpectedEOF
-
}
-
}()
-
if maj != cbg.MajMap {
-
return fmt.Errorf("cbor input should be of type map")
+
// t.NewSha (string) (string)
+
if len("newSha") > 1000000 {
+
return xerrors.Errorf("Value in field \"newSha\" was too long")
-
if extra > cbg.MaxLength {
-
return fmt.Errorf("GitRefUpdate_Meta_CommitCount: map struct too large (%d)", extra)
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("newSha"))); err != nil {
+
return err
+
}
+
if _, err := cw.WriteString(string("newSha")); err != nil {
+
return err
-
n := extra
+
if len(t.NewSha) > 1000000 {
+
return xerrors.Errorf("Value in field t.NewSha was too long")
+
}
-
nameBuf := make([]byte, 7)
-
for i := uint64(0); i < n; i++ {
-
nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000)
-
if err != nil {
-
return err
-
}
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.NewSha))); err != nil {
+
return err
+
}
+
if _, err := cw.WriteString(string(t.NewSha)); err != nil {
+
return err
+
}
-
if !ok {
-
// Field doesn't exist on this type, so ignore it
-
if err := cbg.ScanForLinks(cr, func(cid.Cid) {}); err != nil {
-
return err
-
}
-
continue
-
}
+
// t.OldSha (string) (string)
+
if len("oldSha") > 1000000 {
+
return xerrors.Errorf("Value in field \"oldSha\" was too long")
+
}
-
switch string(nameBuf[:nameLen]) {
-
// t.ByEmail ([]*tangled.GitRefUpdate_Meta_CommitCount_ByEmail_Elem) (slice)
-
case "byEmail":
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("oldSha"))); err != nil {
+
return err
+
}
+
if _, err := cw.WriteString(string("oldSha")); err != nil {
+
return err
+
}
-
maj, extra, err = cr.ReadHeader()
-
if err != nil {
-
return err
-
}
+
if len(t.OldSha) > 1000000 {
+
return xerrors.Errorf("Value in field t.OldSha was too long")
+
}
-
if extra > 8192 {
-
return fmt.Errorf("t.ByEmail: array too large (%d)", extra)
-
}
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.OldSha))); err != nil {
+
return err
+
}
+
if _, err := cw.WriteString(string(t.OldSha)); err != nil {
+
return err
+
}
-
if maj != cbg.MajArray {
-
return fmt.Errorf("expected cbor array")
-
}
+
// t.RepoDid (string) (string)
+
if len("repoDid") > 1000000 {
+
return xerrors.Errorf("Value in field \"repoDid\" was too long")
+
}
-
if extra > 0 {
-
t.ByEmail = make([]*GitRefUpdate_Meta_CommitCount_ByEmail_Elem, extra)
-
}
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("repoDid"))); err != nil {
+
return err
+
}
+
if _, err := cw.WriteString(string("repoDid")); err != nil {
+
return err
+
}
-
for i := 0; i < int(extra); i++ {
-
{
-
var maj byte
-
var extra uint64
-
var err error
-
_ = maj
-
_ = extra
-
_ = err
+
if len(t.RepoDid) > 1000000 {
+
return xerrors.Errorf("Value in field t.RepoDid was too long")
+
}
-
{
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.RepoDid))); err != nil {
+
return err
+
}
+
if _, err := cw.WriteString(string(t.RepoDid)); err != nil {
+
return err
+
}
-
b, err := cr.ReadByte()
-
if err != nil {
-
return err
-
}
-
if b != cbg.CborNull[0] {
-
if err := cr.UnreadByte(); err != nil {
-
return err
-
}
-
t.ByEmail[i] = new(GitRefUpdate_Meta_CommitCount_ByEmail_Elem)
-
if err := t.ByEmail[i].UnmarshalCBOR(cr); err != nil {
-
return xerrors.Errorf("unmarshaling t.ByEmail[i] pointer: %w", err)
-
}
-
}
-
-
}
-
-
}
-
}
-
-
default:
-
// Field doesn't exist on this type, so ignore it
-
if err := cbg.ScanForLinks(r, func(cid.Cid) {}); err != nil {
-
return err
-
}
-
}
+
// t.RepoName (string) (string)
+
if len("repoName") > 1000000 {
+
return xerrors.Errorf("Value in field \"repoName\" was too long")
-
return nil
-
}
-
func (t *GitRefUpdate_Meta_CommitCount_ByEmail_Elem) MarshalCBOR(w io.Writer) error {
-
if t == nil {
-
_, err := w.Write(cbg.CborNull)
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("repoName"))); err != nil {
return err
-
-
cw := cbg.NewCborWriter(w)
-
-
if _, err := cw.Write([]byte{162}); err != nil {
+
if _, err := cw.WriteString(string("repoName")); err != nil {
return err
-
// t.Count (int64) (int64)
-
if len("count") > 1000000 {
-
return xerrors.Errorf("Value in field \"count\" was too long")
+
if len(t.RepoName) > 1000000 {
+
return xerrors.Errorf("Value in field t.RepoName was too long")
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("count"))); err != nil {
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.RepoName))); err != nil {
return err
-
if _, err := cw.WriteString(string("count")); err != nil {
+
if _, err := cw.WriteString(string(t.RepoName)); err != nil {
return err
-
if t.Count >= 0 {
-
if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.Count)); err != nil {
-
return err
-
}
-
} else {
-
if err := cw.WriteMajorTypeHeader(cbg.MajNegativeInt, uint64(-t.Count-1)); err != nil {
-
return err
-
}
+
// t.CommitterDid (string) (string)
+
if len("committerDid") > 1000000 {
+
return xerrors.Errorf("Value in field \"committerDid\" was too long")
-
// t.Email (string) (string)
-
if len("email") > 1000000 {
-
return xerrors.Errorf("Value in field \"email\" was too long")
-
}
-
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("email"))); err != nil {
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("committerDid"))); err != nil {
return err
-
if _, err := cw.WriteString(string("email")); err != nil {
+
if _, err := cw.WriteString(string("committerDid")); err != nil {
return err
-
if len(t.Email) > 1000000 {
-
return xerrors.Errorf("Value in field t.Email was too long")
+
if len(t.CommitterDid) > 1000000 {
+
return xerrors.Errorf("Value in field t.CommitterDid was too long")
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Email))); err != nil {
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.CommitterDid))); err != nil {
return err
-
if _, err := cw.WriteString(string(t.Email)); err != nil {
+
if _, err := cw.WriteString(string(t.CommitterDid)); err != nil {
return err
return nil
-
func (t *GitRefUpdate_Meta_CommitCount_ByEmail_Elem) UnmarshalCBOR(r io.Reader) (err error) {
-
*t = GitRefUpdate_Meta_CommitCount_ByEmail_Elem{}
+
func (t *GitRefUpdate) UnmarshalCBOR(r io.Reader) (err error) {
+
*t = GitRefUpdate{}
cr := cbg.NewCborReader(r)
···
if extra > cbg.MaxLength {
-
return fmt.Errorf("GitRefUpdate_Meta_CommitCount_ByEmail_Elem: map struct too large (%d)", extra)
+
return fmt.Errorf("GitRefUpdate: map struct too large (%d)", extra)
n := extra
-
nameBuf := make([]byte, 5)
+
nameBuf := make([]byte, 12)
for i := uint64(0); i < n; i++ {
nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000)
if err != nil {
···
switch string(nameBuf[:nameLen]) {
-
// t.Count (int64) (int64)
-
case "count":
+
// t.Ref (string) (string)
+
case "ref":
+
+
{
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
+
if err != nil {
+
return err
+
}
+
+
t.Ref = string(sval)
+
}
+
// t.Meta (tangled.GitRefUpdate_Meta) (struct)
+
case "meta":
+
-
maj, extra, err := cr.ReadHeader()
+
+
b, err := cr.ReadByte()
if err != nil {
return err
-
var extraI int64
-
switch maj {
-
case cbg.MajUnsignedInt:
-
extraI = int64(extra)
-
if extraI < 0 {
-
return fmt.Errorf("int64 positive overflow")
+
if b != cbg.CborNull[0] {
+
if err := cr.UnreadByte(); err != nil {
+
return err
-
case cbg.MajNegativeInt:
-
extraI = int64(extra)
-
if extraI < 0 {
-
return fmt.Errorf("int64 negative overflow")
+
t.Meta = new(GitRefUpdate_Meta)
+
if err := t.Meta.UnmarshalCBOR(cr); err != nil {
+
return xerrors.Errorf("unmarshaling t.Meta pointer: %w", err)
-
extraI = -1 - extraI
-
default:
-
return fmt.Errorf("wrong type for int64 field: %d", maj)
+
}
+
+
}
+
// t.LexiconTypeID (string) (string)
+
case "$type":
+
+
{
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
+
if err != nil {
+
return err
+
}
+
+
t.LexiconTypeID = string(sval)
+
}
+
// t.NewSha (string) (string)
+
case "newSha":
+
+
{
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
+
if err != nil {
+
return err
-
t.Count = int64(extraI)
+
t.NewSha = string(sval)
-
// t.Email (string) (string)
-
case "email":
+
// t.OldSha (string) (string)
+
case "oldSha":
sval, err := cbg.ReadStringWithMax(cr, 1000000)
···
return err
-
t.Email = string(sval)
+
t.OldSha = string(sval)
+
}
+
// t.RepoDid (string) (string)
+
case "repoDid":
+
+
{
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
+
if err != nil {
+
return err
+
}
+
+
t.RepoDid = string(sval)
+
}
+
// t.RepoName (string) (string)
+
case "repoName":
+
+
{
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
+
if err != nil {
+
return err
+
}
+
+
t.RepoName = string(sval)
+
}
+
// t.CommitterDid (string) (string)
+
case "committerDid":
+
+
{
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
+
if err != nil {
+
return err
+
}
+
+
t.CommitterDid = string(sval)
default:
···
return nil
-
func (t *Pipeline) MarshalCBOR(w io.Writer) error {
-
if t == nil {
-
_, err := w.Write(cbg.CborNull)
-
return err
-
}
-
-
cw := cbg.NewCborWriter(w)
-
-
if _, err := cw.Write([]byte{163}); err != nil {
-
return err
-
}
-
-
// t.LexiconTypeID (string) (string)
-
if len("$type") > 1000000 {
-
return xerrors.Errorf("Value in field \"$type\" was too long")
-
}
-
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("$type"))); err != nil {
-
return err
-
}
-
if _, err := cw.WriteString(string("$type")); err != nil {
-
return err
-
}
-
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("sh.tangled.pipeline"))); err != nil {
-
return err
-
}
-
if _, err := cw.WriteString(string("sh.tangled.pipeline")); err != nil {
-
return err
-
}
-
-
// t.Workflows ([]*tangled.Pipeline_Workflow) (slice)
-
if len("workflows") > 1000000 {
-
return xerrors.Errorf("Value in field \"workflows\" was too long")
-
}
-
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("workflows"))); err != nil {
-
return err
-
}
-
if _, err := cw.WriteString(string("workflows")); err != nil {
-
return err
-
}
-
-
if len(t.Workflows) > 8192 {
-
return xerrors.Errorf("Slice value in field t.Workflows was too long")
-
}
-
-
if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.Workflows))); err != nil {
-
return err
-
}
-
for _, v := range t.Workflows {
-
if err := v.MarshalCBOR(cw); err != nil {
-
return err
-
}
-
-
}
-
-
// t.TriggerMetadata (tangled.Pipeline_TriggerMetadata) (struct)
-
if len("triggerMetadata") > 1000000 {
-
return xerrors.Errorf("Value in field \"triggerMetadata\" was too long")
-
}
-
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("triggerMetadata"))); err != nil {
-
return err
-
}
-
if _, err := cw.WriteString(string("triggerMetadata")); err != nil {
-
return err
-
}
-
-
if err := t.TriggerMetadata.MarshalCBOR(cw); err != nil {
-
return err
-
}
-
return nil
-
}
-
-
func (t *Pipeline) UnmarshalCBOR(r io.Reader) (err error) {
-
*t = Pipeline{}
-
-
cr := cbg.NewCborReader(r)
-
-
maj, extra, err := cr.ReadHeader()
-
if err != nil {
-
return err
-
}
-
defer func() {
-
if err == io.EOF {
-
err = io.ErrUnexpectedEOF
-
}
-
}()
-
-
if maj != cbg.MajMap {
-
return fmt.Errorf("cbor input should be of type map")
-
}
-
-
if extra > cbg.MaxLength {
-
return fmt.Errorf("Pipeline: map struct too large (%d)", extra)
-
}
-
-
n := extra
-
-
nameBuf := make([]byte, 15)
-
for i := uint64(0); i < n; i++ {
-
nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000)
-
if err != nil {
-
return err
-
}
-
-
if !ok {
-
// Field doesn't exist on this type, so ignore it
-
if err := cbg.ScanForLinks(cr, func(cid.Cid) {}); err != nil {
-
return err
-
}
-
continue
-
}
-
-
switch string(nameBuf[:nameLen]) {
-
// t.LexiconTypeID (string) (string)
-
case "$type":
-
-
{
-
sval, err := cbg.ReadStringWithMax(cr, 1000000)
-
if err != nil {
-
return err
-
}
-
-
t.LexiconTypeID = string(sval)
-
}
-
// t.Workflows ([]*tangled.Pipeline_Workflow) (slice)
-
case "workflows":
-
-
maj, extra, err = cr.ReadHeader()
-
if err != nil {
-
return err
-
}
-
-
if extra > 8192 {
-
return fmt.Errorf("t.Workflows: array too large (%d)", extra)
-
}
-
-
if maj != cbg.MajArray {
-
return fmt.Errorf("expected cbor array")
-
}
-
-
if extra > 0 {
-
t.Workflows = make([]*Pipeline_Workflow, extra)
-
}
-
-
for i := 0; i < int(extra); i++ {
-
{
-
var maj byte
-
var extra uint64
-
var err error
-
_ = maj
-
_ = extra
-
_ = err
-
-
{
-
-
b, err := cr.ReadByte()
-
if err != nil {
-
return err
-
}
-
if b != cbg.CborNull[0] {
-
if err := cr.UnreadByte(); err != nil {
-
return err
-
}
-
t.Workflows[i] = new(Pipeline_Workflow)
-
if err := t.Workflows[i].UnmarshalCBOR(cr); err != nil {
-
return xerrors.Errorf("unmarshaling t.Workflows[i] pointer: %w", err)
-
}
-
}
-
-
}
-
-
}
-
}
-
// t.TriggerMetadata (tangled.Pipeline_TriggerMetadata) (struct)
-
case "triggerMetadata":
-
-
{
-
-
b, err := cr.ReadByte()
-
if err != nil {
-
return err
-
}
-
if b != cbg.CborNull[0] {
-
if err := cr.UnreadByte(); err != nil {
-
return err
-
}
-
t.TriggerMetadata = new(Pipeline_TriggerMetadata)
-
if err := t.TriggerMetadata.UnmarshalCBOR(cr); err != nil {
-
return xerrors.Errorf("unmarshaling t.TriggerMetadata pointer: %w", err)
-
}
-
}
-
-
}
-
-
default:
-
// Field doesn't exist on this type, so ignore it
-
if err := cbg.ScanForLinks(r, func(cid.Cid) {}); err != nil {
-
return err
-
}
-
}
-
}
-
-
return nil
-
}
func (t *Pipeline_CloneOpts) MarshalCBOR(w io.Writer) error {
if t == nil {
_, err := w.Write(cbg.CborNull)
···
return nil
-
func (t *Pipeline_ManualTriggerData) MarshalCBOR(w io.Writer) error {
+
func (t *Pipeline_ManualTriggerData_Inputs_Elem) MarshalCBOR(w io.Writer) error {
if t == nil {
_, err := w.Write(cbg.CborNull)
return err
cw := cbg.NewCborWriter(w)
-
fieldCount := 1
-
if t.Inputs == nil {
-
fieldCount--
+
if _, err := cw.Write([]byte{162}); err != nil {
+
return err
-
if _, err := cw.Write(cbg.CborEncodeMajorType(cbg.MajMap, uint64(fieldCount))); err != nil {
+
// t.Key (string) (string)
+
if len("key") > 1000000 {
+
return xerrors.Errorf("Value in field \"key\" was too long")
+
}
+
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("key"))); err != nil {
+
return err
+
}
+
if _, err := cw.WriteString(string("key")); err != nil {
return err
-
// t.Inputs ([]*tangled.Pipeline_ManualTriggerData_Inputs_Elem) (slice)
-
if t.Inputs != nil {
+
if len(t.Key) > 1000000 {
+
return xerrors.Errorf("Value in field t.Key was too long")
+
}
-
if len("inputs") > 1000000 {
-
return xerrors.Errorf("Value in field \"inputs\" was too long")
-
}
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Key))); err != nil {
+
return err
+
}
+
if _, err := cw.WriteString(string(t.Key)); err != nil {
+
return err
+
}
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("inputs"))); err != nil {
-
return err
-
}
-
if _, err := cw.WriteString(string("inputs")); err != nil {
-
return err
-
}
+
// t.Value (string) (string)
+
if len("value") > 1000000 {
+
return xerrors.Errorf("Value in field \"value\" was too long")
+
}
-
if len(t.Inputs) > 8192 {
-
return xerrors.Errorf("Slice value in field t.Inputs was too long")
-
}
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("value"))); err != nil {
+
return err
+
}
+
if _, err := cw.WriteString(string("value")); err != nil {
+
return err
+
}
-
if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.Inputs))); err != nil {
-
return err
-
}
-
for _, v := range t.Inputs {
-
if err := v.MarshalCBOR(cw); err != nil {
-
return err
-
}
+
if len(t.Value) > 1000000 {
+
return xerrors.Errorf("Value in field t.Value was too long")
+
}
-
}
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Value))); err != nil {
+
return err
+
}
+
if _, err := cw.WriteString(string(t.Value)); err != nil {
+
return err
return nil
-
func (t *Pipeline_ManualTriggerData) UnmarshalCBOR(r io.Reader) (err error) {
-
*t = Pipeline_ManualTriggerData{}
+
func (t *Pipeline_ManualTriggerData_Inputs_Elem) UnmarshalCBOR(r io.Reader) (err error) {
+
*t = Pipeline_ManualTriggerData_Inputs_Elem{}
cr := cbg.NewCborReader(r)
···
if extra > cbg.MaxLength {
-
return fmt.Errorf("Pipeline_ManualTriggerData: map struct too large (%d)", extra)
+
return fmt.Errorf("Pipeline_ManualTriggerData_Inputs_Elem: map struct too large (%d)", extra)
n := extra
-
nameBuf := make([]byte, 6)
+
nameBuf := make([]byte, 5)
for i := uint64(0); i < n; i++ {
nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000)
if err != nil {
···
switch string(nameBuf[:nameLen]) {
-
// t.Inputs ([]*tangled.Pipeline_ManualTriggerData_Inputs_Elem) (slice)
-
case "inputs":
+
// t.Key (string) (string)
+
case "key":
-
maj, extra, err = cr.ReadHeader()
-
if err != nil {
-
return err
-
}
+
{
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
+
if err != nil {
+
return err
+
}
-
if extra > 8192 {
-
return fmt.Errorf("t.Inputs: array too large (%d)", extra)
+
t.Key = string(sval)
+
// t.Value (string) (string)
+
case "value":
-
if maj != cbg.MajArray {
-
return fmt.Errorf("expected cbor array")
-
}
+
{
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
+
if err != nil {
+
return err
+
}
-
if extra > 0 {
-
t.Inputs = make([]*Pipeline_ManualTriggerData_Inputs_Elem, extra)
-
}
-
-
for i := 0; i < int(extra); i++ {
-
{
-
var maj byte
-
var extra uint64
-
var err error
-
_ = maj
-
_ = extra
-
_ = err
-
-
{
-
-
b, err := cr.ReadByte()
-
if err != nil {
-
return err
-
}
-
if b != cbg.CborNull[0] {
-
if err := cr.UnreadByte(); err != nil {
-
return err
-
}
-
t.Inputs[i] = new(Pipeline_ManualTriggerData_Inputs_Elem)
-
if err := t.Inputs[i].UnmarshalCBOR(cr); err != nil {
-
return xerrors.Errorf("unmarshaling t.Inputs[i] pointer: %w", err)
-
}
-
}
-
-
}
-
-
}
+
t.Value = string(sval)
default:
···
return nil
-
func (t *Pipeline_ManualTriggerData_Inputs_Elem) MarshalCBOR(w io.Writer) error {
+
func (t *Pipeline_ManualTriggerData) MarshalCBOR(w io.Writer) error {
if t == nil {
_, err := w.Write(cbg.CborNull)
return err
cw := cbg.NewCborWriter(w)
-
-
if _, err := cw.Write([]byte{162}); err != nil {
-
return err
-
}
+
fieldCount := 1
-
// t.Key (string) (string)
-
if len("key") > 1000000 {
-
return xerrors.Errorf("Value in field \"key\" was too long")
+
if t.Inputs == nil {
+
fieldCount--
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("key"))); err != nil {
-
return err
-
}
-
if _, err := cw.WriteString(string("key")); err != nil {
+
if _, err := cw.Write(cbg.CborEncodeMajorType(cbg.MajMap, uint64(fieldCount))); err != nil {
return err
-
if len(t.Key) > 1000000 {
-
return xerrors.Errorf("Value in field t.Key was too long")
-
}
+
// t.Inputs ([]*tangled.Pipeline_ManualTriggerData_Inputs_Elem) (slice)
+
if t.Inputs != nil {
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Key))); err != nil {
-
return err
-
}
-
if _, err := cw.WriteString(string(t.Key)); err != nil {
-
return err
-
}
+
if len("inputs") > 1000000 {
+
return xerrors.Errorf("Value in field \"inputs\" was too long")
+
}
-
// t.Value (string) (string)
-
if len("value") > 1000000 {
-
return xerrors.Errorf("Value in field \"value\" was too long")
-
}
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("inputs"))); err != nil {
+
return err
+
}
+
if _, err := cw.WriteString(string("inputs")); err != nil {
+
return err
+
}
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("value"))); err != nil {
-
return err
-
}
-
if _, err := cw.WriteString(string("value")); err != nil {
-
return err
-
}
+
if len(t.Inputs) > 8192 {
+
return xerrors.Errorf("Slice value in field t.Inputs was too long")
+
}
-
if len(t.Value) > 1000000 {
-
return xerrors.Errorf("Value in field t.Value was too long")
-
}
+
if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.Inputs))); err != nil {
+
return err
+
}
+
for _, v := range t.Inputs {
+
if err := v.MarshalCBOR(cw); err != nil {
+
return err
+
}
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Value))); err != nil {
-
return err
-
}
-
if _, err := cw.WriteString(string(t.Value)); err != nil {
-
return err
+
}
return nil
-
func (t *Pipeline_ManualTriggerData_Inputs_Elem) UnmarshalCBOR(r io.Reader) (err error) {
-
*t = Pipeline_ManualTriggerData_Inputs_Elem{}
+
func (t *Pipeline_ManualTriggerData) UnmarshalCBOR(r io.Reader) (err error) {
+
*t = Pipeline_ManualTriggerData{}
cr := cbg.NewCborReader(r)
···
if extra > cbg.MaxLength {
-
return fmt.Errorf("Pipeline_ManualTriggerData_Inputs_Elem: map struct too large (%d)", extra)
+
return fmt.Errorf("Pipeline_ManualTriggerData: map struct too large (%d)", extra)
n := extra
-
nameBuf := make([]byte, 5)
+
nameBuf := make([]byte, 6)
for i := uint64(0); i < n; i++ {
nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000)
if err != nil {
···
switch string(nameBuf[:nameLen]) {
-
// t.Key (string) (string)
-
case "key":
+
// t.Inputs ([]*tangled.Pipeline_ManualTriggerData_Inputs_Elem) (slice)
+
case "inputs":
-
{
-
sval, err := cbg.ReadStringWithMax(cr, 1000000)
-
if err != nil {
-
return err
-
}
+
maj, extra, err = cr.ReadHeader()
+
if err != nil {
+
return err
+
}
-
t.Key = string(sval)
+
if extra > 8192 {
+
return fmt.Errorf("t.Inputs: array too large (%d)", extra)
-
// t.Value (string) (string)
-
case "value":
-
{
-
sval, err := cbg.ReadStringWithMax(cr, 1000000)
-
if err != nil {
-
return err
-
}
+
if maj != cbg.MajArray {
+
return fmt.Errorf("expected cbor array")
+
}
-
t.Value = string(sval)
+
if extra > 0 {
+
t.Inputs = make([]*Pipeline_ManualTriggerData_Inputs_Elem, extra)
+
}
+
+
for i := 0; i < int(extra); i++ {
+
{
+
var maj byte
+
var extra uint64
+
var err error
+
_ = maj
+
_ = extra
+
_ = err
+
+
{
+
+
b, err := cr.ReadByte()
+
if err != nil {
+
return err
+
}
+
if b != cbg.CborNull[0] {
+
if err := cr.UnreadByte(); err != nil {
+
return err
+
}
+
t.Inputs[i] = new(Pipeline_ManualTriggerData_Inputs_Elem)
+
if err := t.Inputs[i].UnmarshalCBOR(cr); err != nil {
+
return xerrors.Errorf("unmarshaling t.Inputs[i] pointer: %w", err)
+
}
+
}
+
+
}
+
+
}
default:
···
return nil
+
func (t *Pipeline_Workflow_Environment_Elem) MarshalCBOR(w io.Writer) error {
+
if t == nil {
+
_, err := w.Write(cbg.CborNull)
+
return err
+
}
+
+
cw := cbg.NewCborWriter(w)
+
+
if _, err := cw.Write([]byte{162}); err != nil {
+
return err
+
}
+
+
// t.Key (string) (string)
+
if len("key") > 1000000 {
+
return xerrors.Errorf("Value in field \"key\" was too long")
+
}
+
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("key"))); err != nil {
+
return err
+
}
+
if _, err := cw.WriteString(string("key")); err != nil {
+
return err
+
}
+
+
if len(t.Key) > 1000000 {
+
return xerrors.Errorf("Value in field t.Key was too long")
+
}
+
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Key))); err != nil {
+
return err
+
}
+
if _, err := cw.WriteString(string(t.Key)); err != nil {
+
return err
+
}
+
+
// t.Value (string) (string)
+
if len("value") > 1000000 {
+
return xerrors.Errorf("Value in field \"value\" was too long")
+
}
+
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("value"))); err != nil {
+
return err
+
}
+
if _, err := cw.WriteString(string("value")); err != nil {
+
return err
+
}
+
+
if len(t.Value) > 1000000 {
+
return xerrors.Errorf("Value in field t.Value was too long")
+
}
+
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Value))); err != nil {
+
return err
+
}
+
if _, err := cw.WriteString(string(t.Value)); err != nil {
+
return err
+
}
+
return nil
+
}
+
+
func (t *Pipeline_Workflow_Environment_Elem) UnmarshalCBOR(r io.Reader) (err error) {
+
*t = Pipeline_Workflow_Environment_Elem{}
+
+
cr := cbg.NewCborReader(r)
+
+
maj, extra, err := cr.ReadHeader()
+
if err != nil {
+
return err
+
}
+
defer func() {
+
if err == io.EOF {
+
err = io.ErrUnexpectedEOF
+
}
+
}()
+
+
if maj != cbg.MajMap {
+
return fmt.Errorf("cbor input should be of type map")
+
}
+
+
if extra > cbg.MaxLength {
+
return fmt.Errorf("Pipeline_Workflow_Environment_Elem: map struct too large (%d)", extra)
+
}
+
+
n := extra
+
+
nameBuf := make([]byte, 5)
+
for i := uint64(0); i < n; i++ {
+
nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000)
+
if err != nil {
+
return err
+
}
+
+
if !ok {
+
// Field doesn't exist on this type, so ignore it
+
if err := cbg.ScanForLinks(cr, func(cid.Cid) {}); err != nil {
+
return err
+
}
+
continue
+
}
+
+
switch string(nameBuf[:nameLen]) {
+
// t.Key (string) (string)
+
case "key":
+
+
{
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
+
if err != nil {
+
return err
+
}
+
+
t.Key = string(sval)
+
}
+
// t.Value (string) (string)
+
case "value":
+
+
{
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
+
if err != nil {
+
return err
+
}
+
+
t.Value = string(sval)
+
}
+
+
default:
+
// Field doesn't exist on this type, so ignore it
+
if err := cbg.ScanForLinks(r, func(cid.Cid) {}); err != nil {
+
return err
+
}
+
}
+
}
+
+
return nil
+
}
func (t *Pipeline_Workflow) MarshalCBOR(w io.Writer) error {
if t == nil {
_, err := w.Write(cbg.CborNull)
···
return nil
-
func (t *Pipeline_Workflow_Environment_Elem) MarshalCBOR(w io.Writer) error {
+
func (t *Pipeline) MarshalCBOR(w io.Writer) error {
if t == nil {
_, err := w.Write(cbg.CborNull)
return err
···
cw := cbg.NewCborWriter(w)
-
if _, err := cw.Write([]byte{162}); err != nil {
+
if _, err := cw.Write([]byte{163}); err != nil {
return err
-
// t.Key (string) (string)
-
if len("key") > 1000000 {
-
return xerrors.Errorf("Value in field \"key\" was too long")
+
// t.LexiconTypeID (string) (string)
+
if len("$type") > 1000000 {
+
return xerrors.Errorf("Value in field \"$type\" was too long")
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("key"))); err != nil {
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("$type"))); err != nil {
return err
-
if _, err := cw.WriteString(string("key")); err != nil {
+
if _, err := cw.WriteString(string("$type")); err != nil {
+
return err
+
}
+
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("sh.tangled.pipeline"))); err != nil {
+
return err
+
}
+
if _, err := cw.WriteString(string("sh.tangled.pipeline")); err != nil {
return err
-
if len(t.Key) > 1000000 {
-
return xerrors.Errorf("Value in field t.Key was too long")
+
// t.Workflows ([]*tangled.Pipeline_Workflow) (slice)
+
if len("workflows") > 1000000 {
+
return xerrors.Errorf("Value in field \"workflows\" was too long")
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Key))); err != nil {
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("workflows"))); err != nil {
return err
-
if _, err := cw.WriteString(string(t.Key)); err != nil {
+
if _, err := cw.WriteString(string("workflows")); err != nil {
return err
-
// t.Value (string) (string)
-
if len("value") > 1000000 {
-
return xerrors.Errorf("Value in field \"value\" was too long")
+
if len(t.Workflows) > 8192 {
+
return xerrors.Errorf("Slice value in field t.Workflows was too long")
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("value"))); err != nil {
+
if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.Workflows))); err != nil {
return err
-
if _, err := cw.WriteString(string("value")); err != nil {
-
return err
+
for _, v := range t.Workflows {
+
if err := v.MarshalCBOR(cw); err != nil {
+
return err
+
}
+
-
if len(t.Value) > 1000000 {
-
return xerrors.Errorf("Value in field t.Value was too long")
+
// t.TriggerMetadata (tangled.Pipeline_TriggerMetadata) (struct)
+
if len("triggerMetadata") > 1000000 {
+
return xerrors.Errorf("Value in field \"triggerMetadata\" was too long")
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Value))); err != nil {
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("triggerMetadata"))); err != nil {
+
return err
+
}
+
if _, err := cw.WriteString(string("triggerMetadata")); err != nil {
return err
-
if _, err := cw.WriteString(string(t.Value)); err != nil {
+
+
if err := t.TriggerMetadata.MarshalCBOR(cw); err != nil {
return err
return nil
-
func (t *Pipeline_Workflow_Environment_Elem) UnmarshalCBOR(r io.Reader) (err error) {
-
*t = Pipeline_Workflow_Environment_Elem{}
+
func (t *Pipeline) UnmarshalCBOR(r io.Reader) (err error) {
+
*t = Pipeline{}
cr := cbg.NewCborReader(r)
···
if extra > cbg.MaxLength {
-
return fmt.Errorf("Pipeline_Workflow_Environment_Elem: map struct too large (%d)", extra)
+
return fmt.Errorf("Pipeline: map struct too large (%d)", extra)
n := extra
-
nameBuf := make([]byte, 5)
+
nameBuf := make([]byte, 15)
for i := uint64(0); i < n; i++ {
nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000)
if err != nil {
···
switch string(nameBuf[:nameLen]) {
-
// t.Key (string) (string)
-
case "key":
+
// t.LexiconTypeID (string) (string)
+
case "$type":
sval, err := cbg.ReadStringWithMax(cr, 1000000)
···
return err
-
t.Key = string(sval)
+
t.LexiconTypeID = string(sval)
+
}
+
// t.Workflows ([]*tangled.Pipeline_Workflow) (slice)
+
case "workflows":
+
+
maj, extra, err = cr.ReadHeader()
+
if err != nil {
+
return err
+
}
+
+
if extra > 8192 {
+
return fmt.Errorf("t.Workflows: array too large (%d)", extra)
+
}
+
+
if maj != cbg.MajArray {
+
return fmt.Errorf("expected cbor array")
+
}
+
+
if extra > 0 {
+
t.Workflows = make([]*Pipeline_Workflow, extra)
-
// t.Value (string) (string)
-
case "value":
+
+
for i := 0; i < int(extra); i++ {
+
{
+
var maj byte
+
var extra uint64
+
var err error
+
_ = maj
+
_ = extra
+
_ = err
+
+
{
+
+
b, err := cr.ReadByte()
+
if err != nil {
+
return err
+
}
+
if b != cbg.CborNull[0] {
+
if err := cr.UnreadByte(); err != nil {
+
return err
+
}
+
t.Workflows[i] = new(Pipeline_Workflow)
+
if err := t.Workflows[i].UnmarshalCBOR(cr); err != nil {
+
return xerrors.Errorf("unmarshaling t.Workflows[i] pointer: %w", err)
+
}
+
}
+
+
}
+
+
}
+
}
+
// t.TriggerMetadata (tangled.Pipeline_TriggerMetadata) (struct)
+
case "triggerMetadata":
-
sval, err := cbg.ReadStringWithMax(cr, 1000000)
+
+
b, err := cr.ReadByte()
if err != nil {
return err
+
if b != cbg.CborNull[0] {
+
if err := cr.UnreadByte(); err != nil {
+
return err
+
}
+
t.TriggerMetadata = new(Pipeline_TriggerMetadata)
+
if err := t.TriggerMetadata.UnmarshalCBOR(cr); err != nil {
+
return xerrors.Errorf("unmarshaling t.TriggerMetadata pointer: %w", err)
+
}
+
}
-
t.Value = string(sval)
default:
···
return nil
-
func (t *Repo) MarshalCBOR(w io.Writer) error {
+
func (t *RepoArtifact) MarshalCBOR(w io.Writer) error {
if t == nil {
_, err := w.Write(cbg.CborNull)
return err
cw := cbg.NewCborWriter(w)
-
fieldCount := 7
+
fieldCount := 6
-
if t.Description == nil {
-
fieldCount--
-
}
-
-
if t.Source == nil {
+
if t.Tag == nil {
fieldCount--
···
return err
-
// t.Knot (string) (string)
-
if len("knot") > 1000000 {
-
return xerrors.Errorf("Value in field \"knot\" was too long")
-
}
+
// t.Tag (util.LexBytes) (slice)
+
if t.Tag != nil {
+
+
if len("tag") > 1000000 {
+
return xerrors.Errorf("Value in field \"tag\" was too long")
+
}
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("knot"))); err != nil {
-
return err
-
}
-
if _, err := cw.WriteString(string("knot")); err != nil {
-
return err
-
}
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("tag"))); err != nil {
+
return err
+
}
+
if _, err := cw.WriteString(string("tag")); err != nil {
+
return err
+
}
-
if len(t.Knot) > 1000000 {
-
return xerrors.Errorf("Value in field t.Knot was too long")
-
}
+
if len(t.Tag) > 2097152 {
+
return xerrors.Errorf("Byte array in field t.Tag was too long")
+
}
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Knot))); err != nil {
-
return err
-
}
-
if _, err := cw.WriteString(string(t.Knot)); err != nil {
-
return err
+
if err := cw.WriteMajorTypeHeader(cbg.MajByteString, uint64(len(t.Tag))); err != nil {
+
return err
+
}
+
+
if _, err := cw.Write(t.Tag); err != nil {
+
return err
+
}
+
// t.Name (string) (string)
···
return err
-
// t.LexiconTypeID (string) (string)
-
if len("$type") > 1000000 {
-
return xerrors.Errorf("Value in field \"$type\" was too long")
+
// t.Repo (string) (string)
+
if len("repo") > 1000000 {
+
return xerrors.Errorf("Value in field \"repo\" was too long")
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("$type"))); err != nil {
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("repo"))); err != nil {
return err
-
if _, err := cw.WriteString(string("$type")); err != nil {
+
if _, err := cw.WriteString(string("repo")); err != nil {
return err
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("sh.tangled.repo"))); err != nil {
+
if len(t.Repo) > 1000000 {
+
return xerrors.Errorf("Value in field t.Repo was too long")
+
}
+
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Repo))); err != nil {
return err
-
if _, err := cw.WriteString(string("sh.tangled.repo")); err != nil {
+
if _, err := cw.WriteString(string(t.Repo)); err != nil {
return err
-
// t.Owner (string) (string)
-
if len("owner") > 1000000 {
-
return xerrors.Errorf("Value in field \"owner\" was too long")
+
// t.LexiconTypeID (string) (string)
+
if len("$type") > 1000000 {
+
return xerrors.Errorf("Value in field \"$type\" was too long")
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("owner"))); err != nil {
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("$type"))); err != nil {
return err
-
if _, err := cw.WriteString(string("owner")); err != nil {
+
if _, err := cw.WriteString(string("$type")); err != nil {
return err
-
if len(t.Owner) > 1000000 {
-
return xerrors.Errorf("Value in field t.Owner was too long")
-
}
-
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Owner))); err != nil {
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("sh.tangled.repo.artifact"))); err != nil {
return err
-
if _, err := cw.WriteString(string(t.Owner)); err != nil {
+
if _, err := cw.WriteString(string("sh.tangled.repo.artifact")); err != nil {
return err
-
// t.Source (string) (string)
-
if t.Source != nil {
-
-
if len("source") > 1000000 {
-
return xerrors.Errorf("Value in field \"source\" was too long")
-
}
-
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("source"))); err != nil {
-
return err
-
}
-
if _, err := cw.WriteString(string("source")); err != nil {
-
return err
-
}
+
// t.Artifact (util.LexBlob) (struct)
+
if len("artifact") > 1000000 {
+
return xerrors.Errorf("Value in field \"artifact\" was too long")
+
}
-
if t.Source == nil {
-
if _, err := cw.Write(cbg.CborNull); err != nil {
-
return err
-
}
-
} else {
-
if len(*t.Source) > 1000000 {
-
return xerrors.Errorf("Value in field t.Source was too long")
-
}
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("artifact"))); err != nil {
+
return err
+
}
+
if _, err := cw.WriteString(string("artifact")); err != nil {
+
return err
+
}
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Source))); err != nil {
-
return err
-
}
-
if _, err := cw.WriteString(string(*t.Source)); err != nil {
-
return err
-
}
-
}
+
if err := t.Artifact.MarshalCBOR(cw); err != nil {
+
return err
// t.CreatedAt (string) (string)
···
if _, err := cw.WriteString(string(t.CreatedAt)); err != nil {
return err
-
-
// t.Description (string) (string)
-
if t.Description != nil {
-
-
if len("description") > 1000000 {
-
return xerrors.Errorf("Value in field \"description\" was too long")
-
}
-
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("description"))); err != nil {
-
return err
-
}
-
if _, err := cw.WriteString(string("description")); err != nil {
-
return err
-
}
-
-
if t.Description == nil {
-
if _, err := cw.Write(cbg.CborNull); err != nil {
-
return err
-
}
-
} else {
-
if len(*t.Description) > 1000000 {
-
return xerrors.Errorf("Value in field t.Description was too long")
-
}
-
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Description))); err != nil {
-
return err
-
}
-
if _, err := cw.WriteString(string(*t.Description)); err != nil {
-
return err
-
}
-
}
-
}
return nil
-
func (t *Repo) UnmarshalCBOR(r io.Reader) (err error) {
-
*t = Repo{}
+
func (t *RepoArtifact) UnmarshalCBOR(r io.Reader) (err error) {
+
*t = RepoArtifact{}
cr := cbg.NewCborReader(r)
···
if extra > cbg.MaxLength {
-
return fmt.Errorf("Repo: map struct too large (%d)", extra)
+
return fmt.Errorf("RepoArtifact: map struct too large (%d)", extra)
n := extra
-
nameBuf := make([]byte, 11)
+
nameBuf := make([]byte, 9)
for i := uint64(0); i < n; i++ {
nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000)
if err != nil {
···
switch string(nameBuf[:nameLen]) {
-
// t.Knot (string) (string)
-
case "knot":
+
// t.Tag (util.LexBytes) (slice)
+
case "tag":
-
{
-
sval, err := cbg.ReadStringWithMax(cr, 1000000)
-
if err != nil {
-
return err
-
}
+
maj, extra, err = cr.ReadHeader()
+
if err != nil {
+
return err
+
}
-
t.Knot = string(sval)
+
if extra > 2097152 {
+
return fmt.Errorf("t.Tag: byte array too large (%d)", extra)
+
if maj != cbg.MajByteString {
+
return fmt.Errorf("expected byte array")
+
}
+
+
if extra > 0 {
+
t.Tag = make([]uint8, extra)
+
}
+
+
if _, err := io.ReadFull(cr, t.Tag); err != nil {
+
return err
+
}
+
// t.Name (string) (string)
case "name":
···
t.Name = string(sval)
-
// t.LexiconTypeID (string) (string)
-
case "$type":
+
// t.Repo (string) (string)
+
case "repo":
sval, err := cbg.ReadStringWithMax(cr, 1000000)
···
return err
-
t.LexiconTypeID = string(sval)
+
t.Repo = string(sval)
-
// t.Owner (string) (string)
-
case "owner":
+
// t.LexiconTypeID (string) (string)
+
case "$type":
sval, err := cbg.ReadStringWithMax(cr, 1000000)
···
return err
-
t.Owner = string(sval)
+
t.LexiconTypeID = string(sval)
-
// t.Source (string) (string)
-
case "source":
+
// t.Artifact (util.LexBlob) (struct)
+
case "artifact":
+
b, err := cr.ReadByte()
if err != nil {
return err
···
if err := cr.UnreadByte(); err != nil {
return err
-
-
sval, err := cbg.ReadStringWithMax(cr, 1000000)
-
if err != nil {
-
return err
+
t.Artifact = new(util.LexBlob)
+
if err := t.Artifact.UnmarshalCBOR(cr); err != nil {
+
return xerrors.Errorf("unmarshaling t.Artifact pointer: %w", err)
+
}
-
t.Source = (*string)(&sval)
-
}
// t.CreatedAt (string) (string)
case "createdAt":
···
t.CreatedAt = string(sval)
-
// t.Description (string) (string)
-
case "description":
-
-
{
-
b, err := cr.ReadByte()
-
if err != nil {
-
return err
-
}
-
if b != cbg.CborNull[0] {
-
if err := cr.UnreadByte(); err != nil {
-
return err
-
}
-
-
sval, err := cbg.ReadStringWithMax(cr, 1000000)
-
if err != nil {
-
return err
-
}
-
-
t.Description = (*string)(&sval)
-
}
-
}
default:
// Field doesn't exist on this type, so ignore it
···
return nil
-
func (t *RepoArtifact) MarshalCBOR(w io.Writer) error {
+
func (t *RepoIssueComment) MarshalCBOR(w io.Writer) error {
if t == nil {
_, err := w.Write(cbg.CborNull)
return err
cw := cbg.NewCborWriter(w)
-
fieldCount := 6
+
fieldCount := 7
-
if t.Tag == nil {
+
if t.CommentId == nil {
fieldCount--
-
if _, err := cw.Write(cbg.CborEncodeMajorType(cbg.MajMap, uint64(fieldCount))); err != nil {
-
return err
+
if t.Owner == nil {
+
fieldCount--
-
// t.Tag (util.LexBytes) (slice)
-
if t.Tag != nil {
-
-
if len("tag") > 1000000 {
-
return xerrors.Errorf("Value in field \"tag\" was too long")
-
}
-
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("tag"))); err != nil {
-
return err
-
}
-
if _, err := cw.WriteString(string("tag")); err != nil {
-
return err
-
}
-
-
if len(t.Tag) > 2097152 {
-
return xerrors.Errorf("Byte array in field t.Tag was too long")
-
}
-
-
if err := cw.WriteMajorTypeHeader(cbg.MajByteString, uint64(len(t.Tag))); err != nil {
-
return err
-
}
-
-
if _, err := cw.Write(t.Tag); err != nil {
-
return err
-
}
+
if t.Repo == nil {
+
fieldCount--
+
}
+
if _, err := cw.Write(cbg.CborEncodeMajorType(cbg.MajMap, uint64(fieldCount))); err != nil {
+
return err
-
// t.Name (string) (string)
-
if len("name") > 1000000 {
-
return xerrors.Errorf("Value in field \"name\" was too long")
+
// t.Body (string) (string)
+
if len("body") > 1000000 {
+
return xerrors.Errorf("Value in field \"body\" was too long")
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("name"))); err != nil {
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("body"))); err != nil {
return err
-
if _, err := cw.WriteString(string("name")); err != nil {
+
if _, err := cw.WriteString(string("body")); err != nil {
return err
-
if len(t.Name) > 1000000 {
-
return xerrors.Errorf("Value in field t.Name was too long")
+
if len(t.Body) > 1000000 {
+
return xerrors.Errorf("Value in field t.Body was too long")
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Name))); err != nil {
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Body))); err != nil {
return err
-
if _, err := cw.WriteString(string(t.Name)); err != nil {
+
if _, err := cw.WriteString(string(t.Body)); err != nil {
return err
// t.Repo (string) (string)
-
if len("repo") > 1000000 {
-
return xerrors.Errorf("Value in field \"repo\" was too long")
-
}
+
if t.Repo != nil {
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("repo"))); err != nil {
-
return err
-
}
-
if _, err := cw.WriteString(string("repo")); err != nil {
-
return err
-
}
+
if len("repo") > 1000000 {
+
return xerrors.Errorf("Value in field \"repo\" was too long")
+
}
-
if len(t.Repo) > 1000000 {
-
return xerrors.Errorf("Value in field t.Repo was too long")
-
}
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("repo"))); err != nil {
+
return err
+
}
+
if _, err := cw.WriteString(string("repo")); err != nil {
+
return err
+
}
+
+
if t.Repo == nil {
+
if _, err := cw.Write(cbg.CborNull); err != nil {
+
return err
+
}
+
} else {
+
if len(*t.Repo) > 1000000 {
+
return xerrors.Errorf("Value in field t.Repo was too long")
+
}
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Repo))); err != nil {
-
return err
-
}
-
if _, err := cw.WriteString(string(t.Repo)); err != nil {
-
return err
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Repo))); err != nil {
+
return err
+
}
+
if _, err := cw.WriteString(string(*t.Repo)); err != nil {
+
return err
+
}
+
}
// t.LexiconTypeID (string) (string)
···
return err
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("sh.tangled.repo.artifact"))); err != nil {
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("sh.tangled.repo.issue.comment"))); err != nil {
return err
-
if _, err := cw.WriteString(string("sh.tangled.repo.artifact")); err != nil {
+
if _, err := cw.WriteString(string("sh.tangled.repo.issue.comment")); err != nil {
return err
-
// t.Artifact (util.LexBlob) (struct)
-
if len("artifact") > 1000000 {
-
return xerrors.Errorf("Value in field \"artifact\" was too long")
+
// t.Issue (string) (string)
+
if len("issue") > 1000000 {
+
return xerrors.Errorf("Value in field \"issue\" was too long")
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("artifact"))); err != nil {
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("issue"))); err != nil {
return err
-
if _, err := cw.WriteString(string("artifact")); err != nil {
+
if _, err := cw.WriteString(string("issue")); err != nil {
return err
-
if err := t.Artifact.MarshalCBOR(cw); err != nil {
+
if len(t.Issue) > 1000000 {
+
return xerrors.Errorf("Value in field t.Issue was too long")
+
}
+
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Issue))); err != nil {
+
return err
+
}
+
if _, err := cw.WriteString(string(t.Issue)); err != nil {
return err
+
// t.Owner (string) (string)
+
if t.Owner != nil {
+
+
if len("owner") > 1000000 {
+
return xerrors.Errorf("Value in field \"owner\" was too long")
+
}
+
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("owner"))); err != nil {
+
return err
+
}
+
if _, err := cw.WriteString(string("owner")); err != nil {
+
return err
+
}
+
+
if t.Owner == nil {
+
if _, err := cw.Write(cbg.CborNull); err != nil {
+
return err
+
}
+
} else {
+
if len(*t.Owner) > 1000000 {
+
return xerrors.Errorf("Value in field t.Owner was too long")
+
}
+
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Owner))); err != nil {
+
return err
+
}
+
if _, err := cw.WriteString(string(*t.Owner)); err != nil {
+
return err
+
}
+
}
+
}
+
+
// t.CommentId (int64) (int64)
+
if t.CommentId != nil {
+
+
if len("commentId") > 1000000 {
+
return xerrors.Errorf("Value in field \"commentId\" was too long")
+
}
+
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("commentId"))); err != nil {
+
return err
+
}
+
if _, err := cw.WriteString(string("commentId")); err != nil {
+
return err
+
}
+
+
if t.CommentId == nil {
+
if _, err := cw.Write(cbg.CborNull); err != nil {
+
return err
+
}
+
} else {
+
if *t.CommentId >= 0 {
+
if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(*t.CommentId)); err != nil {
+
return err
+
}
+
} else {
+
if err := cw.WriteMajorTypeHeader(cbg.MajNegativeInt, uint64(-*t.CommentId-1)); err != nil {
+
return err
+
}
+
}
+
}
+
+
}
+
// t.CreatedAt (string) (string)
if len("createdAt") > 1000000 {
return xerrors.Errorf("Value in field \"createdAt\" was too long")
···
return nil
-
func (t *RepoArtifact) UnmarshalCBOR(r io.Reader) (err error) {
-
*t = RepoArtifact{}
+
func (t *RepoIssueComment) UnmarshalCBOR(r io.Reader) (err error) {
+
*t = RepoIssueComment{}
cr := cbg.NewCborReader(r)
···
if extra > cbg.MaxLength {
-
return fmt.Errorf("RepoArtifact: map struct too large (%d)", extra)
+
return fmt.Errorf("RepoIssueComment: map struct too large (%d)", extra)
n := extra
···
switch string(nameBuf[:nameLen]) {
-
// t.Tag (util.LexBytes) (slice)
-
case "tag":
-
-
maj, extra, err = cr.ReadHeader()
-
if err != nil {
-
return err
-
}
-
-
if extra > 2097152 {
-
return fmt.Errorf("t.Tag: byte array too large (%d)", extra)
-
}
-
if maj != cbg.MajByteString {
-
return fmt.Errorf("expected byte array")
-
}
-
-
if extra > 0 {
-
t.Tag = make([]uint8, extra)
-
}
-
-
if _, err := io.ReadFull(cr, t.Tag); err != nil {
-
return err
-
}
-
-
// t.Name (string) (string)
-
case "name":
+
// t.Body (string) (string)
+
case "body":
sval, err := cbg.ReadStringWithMax(cr, 1000000)
···
return err
-
t.Name = string(sval)
+
t.Body = string(sval)
// t.Repo (string) (string)
case "repo":
-
sval, err := cbg.ReadStringWithMax(cr, 1000000)
+
b, err := cr.ReadByte()
if err != nil {
return err
+
if b != cbg.CborNull[0] {
+
if err := cr.UnreadByte(); err != nil {
+
return err
+
}
-
t.Repo = string(sval)
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
+
if err != nil {
+
return err
+
}
+
+
t.Repo = (*string)(&sval)
+
}
// t.LexiconTypeID (string) (string)
case "$type":
···
t.LexiconTypeID = string(sval)
-
// t.Artifact (util.LexBlob) (struct)
-
case "artifact":
+
// t.Issue (string) (string)
+
case "issue":
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
+
if err != nil {
+
return err
+
}
+
t.Issue = string(sval)
+
}
+
// t.Owner (string) (string)
+
case "owner":
+
+
{
b, err := cr.ReadByte()
if err != nil {
return err
···
if err := cr.UnreadByte(); err != nil {
return err
-
t.Artifact = new(util.LexBlob)
-
if err := t.Artifact.UnmarshalCBOR(cr); err != nil {
-
return xerrors.Errorf("unmarshaling t.Artifact pointer: %w", err)
+
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
+
if err != nil {
+
return err
+
+
t.Owner = (*string)(&sval)
+
}
+
// t.CommentId (int64) (int64)
+
case "commentId":
+
{
+
b, err := cr.ReadByte()
+
if err != nil {
+
return err
+
}
+
if b != cbg.CborNull[0] {
+
if err := cr.UnreadByte(); err != nil {
+
return err
+
}
+
maj, extra, err := cr.ReadHeader()
+
if err != nil {
+
return err
+
}
+
var extraI int64
+
switch maj {
+
case cbg.MajUnsignedInt:
+
extraI = int64(extra)
+
if extraI < 0 {
+
return fmt.Errorf("int64 positive overflow")
+
}
+
case cbg.MajNegativeInt:
+
extraI = int64(extra)
+
if extraI < 0 {
+
return fmt.Errorf("int64 negative overflow")
+
}
+
extraI = -1 - extraI
+
default:
+
return fmt.Errorf("wrong type for int64 field: %d", maj)
+
}
+
+
t.CommentId = (*int64)(&extraI)
+
}
// t.CreatedAt (string) (string)
case "createdAt":
···
return nil
+
func (t *RepoIssueState) MarshalCBOR(w io.Writer) error {
+
if t == nil {
+
_, err := w.Write(cbg.CborNull)
+
return err
+
}
+
+
cw := cbg.NewCborWriter(w)
+
+
if _, err := cw.Write([]byte{163}); err != nil {
+
return err
+
}
+
+
// t.LexiconTypeID (string) (string)
+
if len("$type") > 1000000 {
+
return xerrors.Errorf("Value in field \"$type\" was too long")
+
}
+
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("$type"))); err != nil {
+
return err
+
}
+
if _, err := cw.WriteString(string("$type")); err != nil {
+
return err
+
}
+
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("sh.tangled.repo.issue.state"))); err != nil {
+
return err
+
}
+
if _, err := cw.WriteString(string("sh.tangled.repo.issue.state")); err != nil {
+
return err
+
}
+
+
// t.Issue (string) (string)
+
if len("issue") > 1000000 {
+
return xerrors.Errorf("Value in field \"issue\" was too long")
+
}
+
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("issue"))); err != nil {
+
return err
+
}
+
if _, err := cw.WriteString(string("issue")); err != nil {
+
return err
+
}
+
+
if len(t.Issue) > 1000000 {
+
return xerrors.Errorf("Value in field t.Issue was too long")
+
}
+
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Issue))); err != nil {
+
return err
+
}
+
if _, err := cw.WriteString(string(t.Issue)); err != nil {
+
return err
+
}
+
+
// t.State (string) (string)
+
if len("state") > 1000000 {
+
return xerrors.Errorf("Value in field \"state\" was too long")
+
}
+
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("state"))); err != nil {
+
return err
+
}
+
if _, err := cw.WriteString(string("state")); err != nil {
+
return err
+
}
+
+
if len(t.State) > 1000000 {
+
return xerrors.Errorf("Value in field t.State was too long")
+
}
+
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.State))); err != nil {
+
return err
+
}
+
if _, err := cw.WriteString(string(t.State)); err != nil {
+
return err
+
}
+
return nil
+
}
+
+
func (t *RepoIssueState) UnmarshalCBOR(r io.Reader) (err error) {
+
*t = RepoIssueState{}
+
+
cr := cbg.NewCborReader(r)
+
+
maj, extra, err := cr.ReadHeader()
+
if err != nil {
+
return err
+
}
+
defer func() {
+
if err == io.EOF {
+
err = io.ErrUnexpectedEOF
+
}
+
}()
+
+
if maj != cbg.MajMap {
+
return fmt.Errorf("cbor input should be of type map")
+
}
+
+
if extra > cbg.MaxLength {
+
return fmt.Errorf("RepoIssueState: map struct too large (%d)", extra)
+
}
+
+
n := extra
+
+
nameBuf := make([]byte, 5)
+
for i := uint64(0); i < n; i++ {
+
nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000)
+
if err != nil {
+
return err
+
}
+
+
if !ok {
+
// Field doesn't exist on this type, so ignore it
+
if err := cbg.ScanForLinks(cr, func(cid.Cid) {}); err != nil {
+
return err
+
}
+
continue
+
}
+
+
switch string(nameBuf[:nameLen]) {
+
// t.LexiconTypeID (string) (string)
+
case "$type":
+
+
{
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
+
if err != nil {
+
return err
+
}
+
+
t.LexiconTypeID = string(sval)
+
}
+
// t.Issue (string) (string)
+
case "issue":
+
+
{
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
+
if err != nil {
+
return err
+
}
+
+
t.Issue = string(sval)
+
}
+
// t.State (string) (string)
+
case "state":
+
+
{
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
+
if err != nil {
+
return err
+
}
+
+
t.State = string(sval)
+
}
+
+
default:
+
// Field doesn't exist on this type, so ignore it
+
if err := cbg.ScanForLinks(r, func(cid.Cid) {}); err != nil {
+
return err
+
}
+
}
+
}
+
+
return nil
+
}
func (t *RepoIssue) MarshalCBOR(w io.Writer) error {
if t == nil {
_, err := w.Write(cbg.CborNull)
···
return nil
-
func (t *RepoIssueComment) MarshalCBOR(w io.Writer) error {
+
func (t *RepoPullComment) MarshalCBOR(w io.Writer) error {
if t == nil {
_, err := w.Write(cbg.CborNull)
return err
···
return err
+
// t.Pull (string) (string)
+
if len("pull") > 1000000 {
+
return xerrors.Errorf("Value in field \"pull\" was too long")
+
}
+
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("pull"))); err != nil {
+
return err
+
}
+
if _, err := cw.WriteString(string("pull")); err != nil {
+
return err
+
}
+
+
if len(t.Pull) > 1000000 {
+
return xerrors.Errorf("Value in field t.Pull was too long")
+
}
+
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Pull))); err != nil {
+
return err
+
}
+
if _, err := cw.WriteString(string(t.Pull)); err != nil {
+
return err
+
}
+
// t.Repo (string) (string)
if t.Repo != nil {
···
return err
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("sh.tangled.repo.issue.comment"))); err != nil {
-
return err
-
}
-
if _, err := cw.WriteString(string("sh.tangled.repo.issue.comment")); err != nil {
-
return err
-
}
-
-
// t.Issue (string) (string)
-
if len("issue") > 1000000 {
-
return xerrors.Errorf("Value in field \"issue\" was too long")
-
}
-
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("issue"))); err != nil {
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("sh.tangled.repo.pull.comment"))); err != nil {
return err
-
if _, err := cw.WriteString(string("issue")); err != nil {
-
return err
-
}
-
-
if len(t.Issue) > 1000000 {
-
return xerrors.Errorf("Value in field t.Issue was too long")
-
}
-
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Issue))); err != nil {
-
return err
-
}
-
if _, err := cw.WriteString(string(t.Issue)); err != nil {
+
if _, err := cw.WriteString(string("sh.tangled.repo.pull.comment")); err != nil {
return err
···
return nil
-
func (t *RepoIssueComment) UnmarshalCBOR(r io.Reader) (err error) {
-
*t = RepoIssueComment{}
+
func (t *RepoPullComment) UnmarshalCBOR(r io.Reader) (err error) {
+
*t = RepoPullComment{}
cr := cbg.NewCborReader(r)
···
if extra > cbg.MaxLength {
-
return fmt.Errorf("RepoIssueComment: map struct too large (%d)", extra)
+
return fmt.Errorf("RepoPullComment: map struct too large (%d)", extra)
n := extra
···
t.Body = string(sval)
+
// t.Pull (string) (string)
+
case "pull":
+
+
{
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
+
if err != nil {
+
return err
+
}
+
+
t.Pull = string(sval)
+
}
// t.Repo (string) (string)
case "repo":
···
t.LexiconTypeID = string(sval)
-
}
-
// t.Issue (string) (string)
-
case "issue":
-
-
{
-
sval, err := cbg.ReadStringWithMax(cr, 1000000)
-
if err != nil {
-
return err
-
}
-
-
t.Issue = string(sval)
// t.Owner (string) (string)
case "owner":
···
return nil
-
func (t *RepoIssueState) MarshalCBOR(w io.Writer) error {
+
func (t *RepoPullStatus) MarshalCBOR(w io.Writer) error {
if t == nil {
_, err := w.Write(cbg.CborNull)
return err
···
return err
-
// t.LexiconTypeID (string) (string)
-
if len("$type") > 1000000 {
-
return xerrors.Errorf("Value in field \"$type\" was too long")
+
// t.Pull (string) (string)
+
if len("pull") > 1000000 {
+
return xerrors.Errorf("Value in field \"pull\" was too long")
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("$type"))); err != nil {
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("pull"))); err != nil {
return err
-
if _, err := cw.WriteString(string("$type")); err != nil {
+
if _, err := cw.WriteString(string("pull")); err != nil {
return err
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("sh.tangled.repo.issue.state"))); err != nil {
+
if len(t.Pull) > 1000000 {
+
return xerrors.Errorf("Value in field t.Pull was too long")
+
}
+
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Pull))); err != nil {
return err
-
if _, err := cw.WriteString(string("sh.tangled.repo.issue.state")); err != nil {
+
if _, err := cw.WriteString(string(t.Pull)); err != nil {
return err
-
// t.Issue (string) (string)
-
if len("issue") > 1000000 {
-
return xerrors.Errorf("Value in field \"issue\" was too long")
+
// t.LexiconTypeID (string) (string)
+
if len("$type") > 1000000 {
+
return xerrors.Errorf("Value in field \"$type\" was too long")
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("issue"))); err != nil {
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("$type"))); err != nil {
return err
-
if _, err := cw.WriteString(string("issue")); err != nil {
+
if _, err := cw.WriteString(string("$type")); err != nil {
return err
-
if len(t.Issue) > 1000000 {
-
return xerrors.Errorf("Value in field t.Issue was too long")
-
}
-
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Issue))); err != nil {
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("sh.tangled.repo.pull.status"))); err != nil {
return err
-
if _, err := cw.WriteString(string(t.Issue)); err != nil {
+
if _, err := cw.WriteString(string("sh.tangled.repo.pull.status")); err != nil {
return err
-
// t.State (string) (string)
-
if len("state") > 1000000 {
-
return xerrors.Errorf("Value in field \"state\" was too long")
+
// t.Status (string) (string)
+
if len("status") > 1000000 {
+
return xerrors.Errorf("Value in field \"status\" was too long")
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("state"))); err != nil {
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("status"))); err != nil {
return err
-
if _, err := cw.WriteString(string("state")); err != nil {
+
if _, err := cw.WriteString(string("status")); err != nil {
return err
-
if len(t.State) > 1000000 {
-
return xerrors.Errorf("Value in field t.State was too long")
+
if len(t.Status) > 1000000 {
+
return xerrors.Errorf("Value in field t.Status was too long")
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.State))); err != nil {
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Status))); err != nil {
return err
-
if _, err := cw.WriteString(string(t.State)); err != nil {
+
if _, err := cw.WriteString(string(t.Status)); err != nil {
return err
return nil
-
func (t *RepoIssueState) UnmarshalCBOR(r io.Reader) (err error) {
-
*t = RepoIssueState{}
+
func (t *RepoPullStatus) UnmarshalCBOR(r io.Reader) (err error) {
+
*t = RepoPullStatus{}
cr := cbg.NewCborReader(r)
···
if extra > cbg.MaxLength {
-
return fmt.Errorf("RepoIssueState: map struct too large (%d)", extra)
+
return fmt.Errorf("RepoPullStatus: map struct too large (%d)", extra)
n := extra
-
nameBuf := make([]byte, 5)
+
nameBuf := make([]byte, 6)
for i := uint64(0); i < n; i++ {
nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000)
if err != nil {
···
switch string(nameBuf[:nameLen]) {
-
// t.LexiconTypeID (string) (string)
+
// t.Pull (string) (string)
+
case "pull":
+
+
{
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
+
if err != nil {
+
return err
+
}
+
+
t.Pull = string(sval)
+
}
+
// t.LexiconTypeID (string) (string)
case "$type":
···
t.LexiconTypeID = string(sval)
-
// t.Issue (string) (string)
-
case "issue":
+
// t.Status (string) (string)
+
case "status":
sval, err := cbg.ReadStringWithMax(cr, 1000000)
···
return err
-
t.Issue = string(sval)
+
t.Status = string(sval)
+
}
+
+
default:
+
// Field doesn't exist on this type, so ignore it
+
if err := cbg.ScanForLinks(r, func(cid.Cid) {}); err != nil {
+
return err
+
}
+
}
+
}
+
+
return nil
+
}
+
func (t *RepoPull_Source) MarshalCBOR(w io.Writer) error {
+
if t == nil {
+
_, err := w.Write(cbg.CborNull)
+
return err
+
}
+
+
cw := cbg.NewCborWriter(w)
+
fieldCount := 2
+
+
if t.Repo == nil {
+
fieldCount--
+
}
+
+
if _, err := cw.Write(cbg.CborEncodeMajorType(cbg.MajMap, uint64(fieldCount))); err != nil {
+
return err
+
}
+
+
// t.Repo (string) (string)
+
if t.Repo != nil {
+
+
if len("repo") > 1000000 {
+
return xerrors.Errorf("Value in field \"repo\" was too long")
+
}
+
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("repo"))); err != nil {
+
return err
+
}
+
if _, err := cw.WriteString(string("repo")); err != nil {
+
return err
+
}
+
+
if t.Repo == nil {
+
if _, err := cw.Write(cbg.CborNull); err != nil {
+
return err
+
}
+
} else {
+
if len(*t.Repo) > 1000000 {
+
return xerrors.Errorf("Value in field t.Repo was too long")
+
}
+
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Repo))); err != nil {
+
return err
+
}
+
if _, err := cw.WriteString(string(*t.Repo)); err != nil {
+
return err
+
}
+
}
+
}
+
+
// t.Branch (string) (string)
+
if len("branch") > 1000000 {
+
return xerrors.Errorf("Value in field \"branch\" was too long")
+
}
+
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("branch"))); err != nil {
+
return err
+
}
+
if _, err := cw.WriteString(string("branch")); err != nil {
+
return err
+
}
+
+
if len(t.Branch) > 1000000 {
+
return xerrors.Errorf("Value in field t.Branch was too long")
+
}
+
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Branch))); err != nil {
+
return err
+
}
+
if _, err := cw.WriteString(string(t.Branch)); err != nil {
+
return err
+
}
+
return nil
+
}
+
+
func (t *RepoPull_Source) UnmarshalCBOR(r io.Reader) (err error) {
+
*t = RepoPull_Source{}
+
+
cr := cbg.NewCborReader(r)
+
+
maj, extra, err := cr.ReadHeader()
+
if err != nil {
+
return err
+
}
+
defer func() {
+
if err == io.EOF {
+
err = io.ErrUnexpectedEOF
+
}
+
}()
+
+
if maj != cbg.MajMap {
+
return fmt.Errorf("cbor input should be of type map")
+
}
+
+
if extra > cbg.MaxLength {
+
return fmt.Errorf("RepoPull_Source: map struct too large (%d)", extra)
+
}
+
+
n := extra
+
+
nameBuf := make([]byte, 6)
+
for i := uint64(0); i < n; i++ {
+
nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000)
+
if err != nil {
+
return err
+
}
+
+
if !ok {
+
// Field doesn't exist on this type, so ignore it
+
if err := cbg.ScanForLinks(cr, func(cid.Cid) {}); err != nil {
+
return err
-
// t.State (string) (string)
-
case "state":
+
continue
+
}
+
+
switch string(nameBuf[:nameLen]) {
+
// t.Repo (string) (string)
+
case "repo":
+
+
{
+
b, err := cr.ReadByte()
+
if err != nil {
+
return err
+
}
+
if b != cbg.CborNull[0] {
+
if err := cr.UnreadByte(); err != nil {
+
return err
+
}
+
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
+
if err != nil {
+
return err
+
}
+
+
t.Repo = (*string)(&sval)
+
}
+
}
+
// t.Branch (string) (string)
+
case "branch":
sval, err := cbg.ReadStringWithMax(cr, 1000000)
···
return err
-
t.State = string(sval)
+
t.Branch = string(sval)
default:
···
return nil
-
func (t *RepoPullComment) MarshalCBOR(w io.Writer) error {
+
func (t *Repo) MarshalCBOR(w io.Writer) error {
if t == nil {
_, err := w.Write(cbg.CborNull)
return err
···
cw := cbg.NewCborWriter(w)
fieldCount := 7
-
if t.CommentId == nil {
+
if t.Description == nil {
fieldCount--
-
if t.Owner == nil {
-
fieldCount--
-
}
-
-
if t.Repo == nil {
+
if t.Source == nil {
fieldCount--
···
return err
-
// t.Body (string) (string)
-
if len("body") > 1000000 {
-
return xerrors.Errorf("Value in field \"body\" was too long")
+
// t.Knot (string) (string)
+
if len("knot") > 1000000 {
+
return xerrors.Errorf("Value in field \"knot\" was too long")
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("body"))); err != nil {
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("knot"))); err != nil {
return err
-
if _, err := cw.WriteString(string("body")); err != nil {
+
if _, err := cw.WriteString(string("knot")); err != nil {
return err
-
if len(t.Body) > 1000000 {
-
return xerrors.Errorf("Value in field t.Body was too long")
+
if len(t.Knot) > 1000000 {
+
return xerrors.Errorf("Value in field t.Knot was too long")
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Body))); err != nil {
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Knot))); err != nil {
return err
-
if _, err := cw.WriteString(string(t.Body)); err != nil {
+
if _, err := cw.WriteString(string(t.Knot)); err != nil {
return err
-
// t.Pull (string) (string)
-
if len("pull") > 1000000 {
-
return xerrors.Errorf("Value in field \"pull\" was too long")
+
// t.Name (string) (string)
+
if len("name") > 1000000 {
+
return xerrors.Errorf("Value in field \"name\" was too long")
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("pull"))); err != nil {
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("name"))); err != nil {
return err
-
if _, err := cw.WriteString(string("pull")); err != nil {
+
if _, err := cw.WriteString(string("name")); err != nil {
return err
-
if len(t.Pull) > 1000000 {
-
return xerrors.Errorf("Value in field t.Pull was too long")
+
if len(t.Name) > 1000000 {
+
return xerrors.Errorf("Value in field t.Name was too long")
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Pull))); err != nil {
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Name))); err != nil {
return err
-
if _, err := cw.WriteString(string(t.Pull)); err != nil {
+
if _, err := cw.WriteString(string(t.Name)); err != nil {
return err
-
// t.Repo (string) (string)
-
if t.Repo != nil {
-
-
if len("repo") > 1000000 {
-
return xerrors.Errorf("Value in field \"repo\" was too long")
-
}
-
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("repo"))); err != nil {
-
return err
-
}
-
if _, err := cw.WriteString(string("repo")); err != nil {
-
return err
-
}
-
-
if t.Repo == nil {
-
if _, err := cw.Write(cbg.CborNull); err != nil {
-
return err
-
}
-
} else {
-
if len(*t.Repo) > 1000000 {
-
return xerrors.Errorf("Value in field t.Repo was too long")
-
}
-
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Repo))); err != nil {
-
return err
-
}
-
if _, err := cw.WriteString(string(*t.Repo)); err != nil {
-
return err
-
}
-
}
-
}
-
// t.LexiconTypeID (string) (string)
if len("$type") > 1000000 {
return xerrors.Errorf("Value in field \"$type\" was too long")
···
return err
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("sh.tangled.repo.pull.comment"))); err != nil {
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("sh.tangled.repo"))); err != nil {
return err
-
if _, err := cw.WriteString(string("sh.tangled.repo.pull.comment")); err != nil {
+
if _, err := cw.WriteString(string("sh.tangled.repo")); err != nil {
return err
// t.Owner (string) (string)
-
if t.Owner != nil {
-
-
if len("owner") > 1000000 {
-
return xerrors.Errorf("Value in field \"owner\" was too long")
-
}
+
if len("owner") > 1000000 {
+
return xerrors.Errorf("Value in field \"owner\" was too long")
+
}
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("owner"))); err != nil {
-
return err
-
}
-
if _, err := cw.WriteString(string("owner")); err != nil {
-
return err
-
}
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("owner"))); err != nil {
+
return err
+
}
+
if _, err := cw.WriteString(string("owner")); err != nil {
+
return err
+
}
-
if t.Owner == nil {
-
if _, err := cw.Write(cbg.CborNull); err != nil {
-
return err
-
}
-
} else {
-
if len(*t.Owner) > 1000000 {
-
return xerrors.Errorf("Value in field t.Owner was too long")
-
}
+
if len(t.Owner) > 1000000 {
+
return xerrors.Errorf("Value in field t.Owner was too long")
+
}
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Owner))); err != nil {
-
return err
-
}
-
if _, err := cw.WriteString(string(*t.Owner)); err != nil {
-
return err
-
}
-
}
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Owner))); err != nil {
+
return err
+
}
+
if _, err := cw.WriteString(string(t.Owner)); err != nil {
+
return err
-
// t.CommentId (int64) (int64)
-
if t.CommentId != nil {
+
// t.Source (string) (string)
+
if t.Source != nil {
-
if len("commentId") > 1000000 {
-
return xerrors.Errorf("Value in field \"commentId\" was too long")
+
if len("source") > 1000000 {
+
return xerrors.Errorf("Value in field \"source\" was too long")
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("commentId"))); err != nil {
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("source"))); err != nil {
return err
-
if _, err := cw.WriteString(string("commentId")); err != nil {
+
if _, err := cw.WriteString(string("source")); err != nil {
return err
-
if t.CommentId == nil {
+
if t.Source == nil {
if _, err := cw.Write(cbg.CborNull); err != nil {
return err
} else {
-
if *t.CommentId >= 0 {
-
if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(*t.CommentId)); err != nil {
-
return err
-
}
-
} else {
-
if err := cw.WriteMajorTypeHeader(cbg.MajNegativeInt, uint64(-*t.CommentId-1)); err != nil {
-
return err
-
}
+
if len(*t.Source) > 1000000 {
+
return xerrors.Errorf("Value in field t.Source was too long")
+
}
+
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Source))); err != nil {
+
return err
+
}
+
if _, err := cw.WriteString(string(*t.Source)); err != nil {
+
return err
-
// t.CreatedAt (string) (string)
···
if _, err := cw.WriteString(string(t.CreatedAt)); err != nil {
return err
+
+
// t.Description (string) (string)
+
if t.Description != nil {
+
+
if len("description") > 1000000 {
+
return xerrors.Errorf("Value in field \"description\" was too long")
+
}
+
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("description"))); err != nil {
+
return err
+
}
+
if _, err := cw.WriteString(string("description")); err != nil {
+
return err
+
}
+
+
if t.Description == nil {
+
if _, err := cw.Write(cbg.CborNull); err != nil {
+
return err
+
}
+
} else {
+
if len(*t.Description) > 1000000 {
+
return xerrors.Errorf("Value in field t.Description was too long")
+
}
+
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Description))); err != nil {
+
return err
+
}
+
if _, err := cw.WriteString(string(*t.Description)); err != nil {
+
return err
+
}
+
}
+
}
return nil
-
func (t *RepoPullComment) UnmarshalCBOR(r io.Reader) (err error) {
-
*t = RepoPullComment{}
+
func (t *Repo) UnmarshalCBOR(r io.Reader) (err error) {
+
*t = Repo{}
cr := cbg.NewCborReader(r)
···
if extra > cbg.MaxLength {
-
return fmt.Errorf("RepoPullComment: map struct too large (%d)", extra)
+
return fmt.Errorf("Repo: map struct too large (%d)", extra)
n := extra
-
nameBuf := make([]byte, 9)
+
nameBuf := make([]byte, 11)
for i := uint64(0); i < n; i++ {
nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000)
if err != nil {
···
switch string(nameBuf[:nameLen]) {
-
// t.Body (string) (string)
-
case "body":
+
// t.Knot (string) (string)
+
case "knot":
sval, err := cbg.ReadStringWithMax(cr, 1000000)
···
return err
-
t.Body = string(sval)
+
t.Knot = string(sval)
-
// t.Pull (string) (string)
-
case "pull":
+
// t.Name (string) (string)
+
case "name":
sval, err := cbg.ReadStringWithMax(cr, 1000000)
···
return err
-
t.Pull = string(sval)
+
t.Name = string(sval)
-
// t.Repo (string) (string)
-
case "repo":
+
// t.LexiconTypeID (string) (string)
+
case "$type":
-
b, err := cr.ReadByte()
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
if err != nil {
return err
-
if b != cbg.CborNull[0] {
-
if err := cr.UnreadByte(); err != nil {
-
return err
-
}
-
sval, err := cbg.ReadStringWithMax(cr, 1000000)
-
if err != nil {
-
return err
-
}
-
-
t.Repo = (*string)(&sval)
-
}
+
t.LexiconTypeID = string(sval)
-
// t.LexiconTypeID (string) (string)
-
case "$type":
+
// t.Owner (string) (string)
+
case "owner":
sval, err := cbg.ReadStringWithMax(cr, 1000000)
···
return err
-
t.LexiconTypeID = string(sval)
+
t.Owner = string(sval)
-
// t.Owner (string) (string)
-
case "owner":
+
// t.Source (string) (string)
+
case "source":
b, err := cr.ReadByte()
···
return err
-
t.Owner = (*string)(&sval)
+
t.Source = (*string)(&sval)
-
// t.CommentId (int64) (int64)
-
case "commentId":
+
// t.CreatedAt (string) (string)
+
case "createdAt":
+
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
+
if err != nil {
+
return err
+
}
+
t.CreatedAt = string(sval)
+
}
+
// t.Description (string) (string)
+
case "description":
+
+
{
b, err := cr.ReadByte()
if err != nil {
return err
···
if err := cr.UnreadByte(); err != nil {
return err
-
maj, extra, err := cr.ReadHeader()
+
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
if err != nil {
return err
-
var extraI int64
-
switch maj {
-
case cbg.MajUnsignedInt:
-
extraI = int64(extra)
-
if extraI < 0 {
-
return fmt.Errorf("int64 positive overflow")
-
}
-
case cbg.MajNegativeInt:
-
extraI = int64(extra)
-
if extraI < 0 {
-
return fmt.Errorf("int64 negative overflow")
-
}
-
extraI = -1 - extraI
-
default:
-
return fmt.Errorf("wrong type for int64 field: %d", maj)
-
}
-
t.CommentId = (*int64)(&extraI)
-
}
-
}
-
// t.CreatedAt (string) (string)
-
case "createdAt":
-
-
{
-
sval, err := cbg.ReadStringWithMax(cr, 1000000)
-
if err != nil {
-
return err
+
t.Description = (*string)(&sval)
-
-
t.CreatedAt = string(sval)
default:
···
return nil
-
func (t *RepoPull_Source) MarshalCBOR(w io.Writer) error {
+
func (t *SpindleMember) MarshalCBOR(w io.Writer) error {
if t == nil {
_, err := w.Write(cbg.CborNull)
return err
cw := cbg.NewCborWriter(w)
-
fieldCount := 2
+
fieldCount := 4
-
if t.Repo == nil {
+
if t.Instance == nil {
fieldCount--
···
return err
-
// t.Repo (string) (string)
-
if t.Repo != nil {
-
-
if len("repo") > 1000000 {
-
return xerrors.Errorf("Value in field \"repo\" was too long")
-
}
-
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("repo"))); err != nil {
-
return err
-
}
-
if _, err := cw.WriteString(string("repo")); err != nil {
-
return err
-
}
+
// t.LexiconTypeID (string) (string)
+
if len("$type") > 1000000 {
+
return xerrors.Errorf("Value in field \"$type\" was too long")
+
}
-
if t.Repo == nil {
-
if _, err := cw.Write(cbg.CborNull); err != nil {
-
return err
-
}
-
} else {
-
if len(*t.Repo) > 1000000 {
-
return xerrors.Errorf("Value in field t.Repo was too long")
-
}
-
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Repo))); err != nil {
-
return err
-
}
-
if _, err := cw.WriteString(string(*t.Repo)); err != nil {
-
return err
-
}
-
}
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("$type"))); err != nil {
+
return err
-
-
// t.Branch (string) (string)
-
if len("branch") > 1000000 {
-
return xerrors.Errorf("Value in field \"branch\" was too long")
+
if _, err := cw.WriteString(string("$type")); err != nil {
+
return err
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("branch"))); err != nil {
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("sh.tangled.spindle.member"))); err != nil {
return err
-
if _, err := cw.WriteString(string("branch")); err != nil {
+
if _, err := cw.WriteString(string("sh.tangled.spindle.member")); err != nil {
return err
-
if len(t.Branch) > 1000000 {
-
return xerrors.Errorf("Value in field t.Branch was too long")
+
// t.Subject (string) (string)
+
if len("subject") > 1000000 {
+
return xerrors.Errorf("Value in field \"subject\" was too long")
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Branch))); err != nil {
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("subject"))); err != nil {
return err
-
if _, err := cw.WriteString(string(t.Branch)); err != nil {
+
if _, err := cw.WriteString(string("subject")); err != nil {
return err
-
return nil
-
}
-
func (t *RepoPull_Source) UnmarshalCBOR(r io.Reader) (err error) {
-
*t = RepoPull_Source{}
-
-
cr := cbg.NewCborReader(r)
+
if len(t.Subject) > 1000000 {
+
return xerrors.Errorf("Value in field t.Subject was too long")
+
}
-
maj, extra, err := cr.ReadHeader()
-
if err != nil {
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Subject))); err != nil {
return err
-
defer func() {
-
if err == io.EOF {
-
err = io.ErrUnexpectedEOF
-
}
-
}()
-
-
if maj != cbg.MajMap {
-
return fmt.Errorf("cbor input should be of type map")
+
if _, err := cw.WriteString(string(t.Subject)); err != nil {
+
return err
-
if extra > cbg.MaxLength {
-
return fmt.Errorf("RepoPull_Source: map struct too large (%d)", extra)
-
}
+
// t.Instance (string) (string)
+
if t.Instance != nil {
-
n := extra
+
if len("instance") > 1000000 {
+
return xerrors.Errorf("Value in field \"instance\" was too long")
+
}
-
nameBuf := make([]byte, 6)
-
for i := uint64(0); i < n; i++ {
-
nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000)
-
if err != nil {
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("instance"))); err != nil {
+
return err
+
}
+
if _, err := cw.WriteString(string("instance")); err != nil {
return err
-
if !ok {
-
// Field doesn't exist on this type, so ignore it
-
if err := cbg.ScanForLinks(cr, func(cid.Cid) {}); err != nil {
+
if t.Instance == nil {
+
if _, err := cw.Write(cbg.CborNull); err != nil {
return err
-
continue
-
}
-
-
switch string(nameBuf[:nameLen]) {
-
// t.Repo (string) (string)
-
case "repo":
-
-
{
-
b, err := cr.ReadByte()
-
if err != nil {
-
return err
-
}
-
if b != cbg.CborNull[0] {
-
if err := cr.UnreadByte(); err != nil {
-
return err
-
}
-
-
sval, err := cbg.ReadStringWithMax(cr, 1000000)
-
if err != nil {
-
return err
-
}
-
-
t.Repo = (*string)(&sval)
-
}
+
} else {
+
if len(*t.Instance) > 1000000 {
+
return xerrors.Errorf("Value in field t.Instance was too long")
-
// t.Branch (string) (string)
-
case "branch":
-
{
-
sval, err := cbg.ReadStringWithMax(cr, 1000000)
-
if err != nil {
-
return err
-
}
-
-
t.Branch = string(sval)
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Instance))); err != nil {
+
return err
-
-
default:
-
// Field doesn't exist on this type, so ignore it
-
if err := cbg.ScanForLinks(r, func(cid.Cid) {}); err != nil {
+
if _, err := cw.WriteString(string(*t.Instance)); err != nil {
return err
-
return nil
-
}
-
func (t *RepoPullStatus) MarshalCBOR(w io.Writer) error {
-
if t == nil {
-
_, err := w.Write(cbg.CborNull)
-
return err
-
}
-
-
cw := cbg.NewCborWriter(w)
-
-
if _, err := cw.Write([]byte{163}); err != nil {
-
return err
-
}
-
-
// t.Pull (string) (string)
-
if len("pull") > 1000000 {
-
return xerrors.Errorf("Value in field \"pull\" was too long")
+
// t.CreatedAt (string) (string)
+
if len("createdAt") > 1000000 {
+
return xerrors.Errorf("Value in field \"createdAt\" was too long")
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("pull"))); err != nil {
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("createdAt"))); err != nil {
return err
-
if _, err := cw.WriteString(string("pull")); err != nil {
+
if _, err := cw.WriteString(string("createdAt")); err != nil {
return err
-
if len(t.Pull) > 1000000 {
-
return xerrors.Errorf("Value in field t.Pull was too long")
+
if len(t.CreatedAt) > 1000000 {
+
return xerrors.Errorf("Value in field t.CreatedAt was too long")
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Pull))); err != nil {
-
return err
-
}
-
if _, err := cw.WriteString(string(t.Pull)); err != nil {
-
return err
-
}
-
-
// t.LexiconTypeID (string) (string)
-
if len("$type") > 1000000 {
-
return xerrors.Errorf("Value in field \"$type\" was too long")
-
}
-
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("$type"))); err != nil {
-
return err
-
}
-
if _, err := cw.WriteString(string("$type")); err != nil {
-
return err
-
}
-
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("sh.tangled.repo.pull.status"))); err != nil {
-
return err
-
}
-
if _, err := cw.WriteString(string("sh.tangled.repo.pull.status")); err != nil {
-
return err
-
}
-
-
// t.Status (string) (string)
-
if len("status") > 1000000 {
-
return xerrors.Errorf("Value in field \"status\" was too long")
-
}
-
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("status"))); err != nil {
-
return err
-
}
-
if _, err := cw.WriteString(string("status")); err != nil {
-
return err
-
}
-
-
if len(t.Status) > 1000000 {
-
return xerrors.Errorf("Value in field t.Status was too long")
-
}
-
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Status))); err != nil {
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.CreatedAt))); err != nil {
return err
-
if _, err := cw.WriteString(string(t.Status)); err != nil {
+
if _, err := cw.WriteString(string(t.CreatedAt)); err != nil {
return err
return nil
-
func (t *RepoPullStatus) UnmarshalCBOR(r io.Reader) (err error) {
-
*t = RepoPullStatus{}
+
func (t *SpindleMember) UnmarshalCBOR(r io.Reader) (err error) {
+
*t = SpindleMember{}
cr := cbg.NewCborReader(r)
···
if extra > cbg.MaxLength {
-
return fmt.Errorf("RepoPullStatus: map struct too large (%d)", extra)
+
return fmt.Errorf("SpindleMember: map struct too large (%d)", extra)
n := extra
-
nameBuf := make([]byte, 6)
+
nameBuf := make([]byte, 9)
for i := uint64(0); i < n; i++ {
nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000)
if err != nil {
···
switch string(nameBuf[:nameLen]) {
-
// t.Pull (string) (string)
-
case "pull":
+
// t.LexiconTypeID (string) (string)
+
case "$type":
sval, err := cbg.ReadStringWithMax(cr, 1000000)
···
return err
-
t.Pull = string(sval)
+
t.LexiconTypeID = string(sval)
-
// t.LexiconTypeID (string) (string)
-
case "$type":
+
// t.Subject (string) (string)
+
case "subject":
sval, err := cbg.ReadStringWithMax(cr, 1000000)
···
return err
-
t.LexiconTypeID = string(sval)
+
t.Subject = string(sval)
+
}
+
// t.Instance (string) (string)
+
case "instance":
+
+
{
+
b, err := cr.ReadByte()
+
if err != nil {
+
return err
+
}
+
if b != cbg.CborNull[0] {
+
if err := cr.UnreadByte(); err != nil {
+
return err
+
}
+
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
+
if err != nil {
+
return err
+
}
+
+
t.Instance = (*string)(&sval)
+
}
-
// t.Status (string) (string)
-
case "status":
+
// t.CreatedAt (string) (string)
+
case "createdAt":
sval, err := cbg.ReadStringWithMax(cr, 1000000)
···
return err
-
t.Status = string(sval)
+
t.CreatedAt = string(sval)
default:
+25
api/tangled/spindlemember.go
···
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
+
+
package tangled
+
+
// schema: sh.tangled.spindle.member
+
+
import (
+
"github.com/bluesky-social/indigo/lex/util"
+
)
+
+
const (
+
SpindleMemberNSID = "sh.tangled.spindle.member"
+
)
+
+
func init() {
+
util.RegisterType("sh.tangled.spindle.member", &SpindleMember{})
+
} //
+
// RECORDTYPE: SpindleMember
+
type SpindleMember struct {
+
LexiconTypeID string `json:"$type,const=sh.tangled.spindle.member" cborgen:"$type,const=sh.tangled.spindle.member"`
+
CreatedAt string `json:"createdAt" cborgen:"createdAt"`
+
// instance: spindle instance that the subject is now a member of
+
Instance *string `json:"instance,omitempty" cborgen:"instance,omitempty"`
+
Subject string `json:"subject" cborgen:"subject"`
+
}
+11 -10
cmd/gen.go
···
"tangled",
tangled.ActorProfile{},
tangled.FeedStar{},
-
tangled.GitRefUpdate{},
-
tangled.GitRefUpdate_Meta{},
-
tangled.GitRefUpdate_Meta_CommitCount{},
tangled.GitRefUpdate_Meta_CommitCount_ByEmail_Elem{},
+
tangled.GitRefUpdate_Meta_CommitCount{},
+
tangled.GitRefUpdate_Meta{},
+
tangled.GitRefUpdate{},
tangled.GraphFollow{},
tangled.KnotMember{},
-
tangled.Pipeline{},
tangled.Pipeline_CloneOpts{},
tangled.Pipeline_Dependencies_Elem{},
+
tangled.Pipeline_ManualTriggerData_Inputs_Elem{},
tangled.Pipeline_ManualTriggerData{},
-
tangled.Pipeline_ManualTriggerData_Inputs_Elem{},
tangled.Pipeline_PullRequestTriggerData{},
tangled.Pipeline_PushTriggerData{},
tangled.Pipeline_Step{},
tangled.Pipeline_TriggerMetadata{},
tangled.Pipeline_TriggerRepo{},
+
tangled.Pipeline_Workflow_Environment_Elem{},
tangled.Pipeline_Workflow{},
-
tangled.Pipeline_Workflow_Environment_Elem{},
+
tangled.Pipeline{},
tangled.PublicKey{},
-
tangled.Repo{},
tangled.RepoArtifact{},
-
tangled.RepoIssue{},
tangled.RepoIssueComment{},
tangled.RepoIssueState{},
-
tangled.RepoPull{},
+
tangled.RepoIssue{},
tangled.RepoPullComment{},
+
tangled.RepoPullStatus{},
tangled.RepoPull_Source{},
-
tangled.RepoPullStatus{},
+
tangled.RepoPull{},
+
tangled.Repo{},
+
tangled.SpindleMember{},
); err != nil {
panic(err)
}
+4
cmd/spindle/main.go
···
+
package main
+
+
func main() {
+
}
+34
lexicons/spindle/member.json
···
+
{
+
"lexicon": 1,
+
"id": "sh.tangled.spindle.member",
+
"needsCbor": true,
+
"needsType": true,
+
"defs": {
+
"main": {
+
"type": "record",
+
"key": "tid",
+
"record": {
+
"type": "object",
+
"required": [
+
"subject",
+
"domain",
+
"createdAt"
+
],
+
"properties": {
+
"subject": {
+
"type": "string",
+
"format": "did"
+
},
+
"instance": {
+
"type": "string",
+
"description": "spindle instance that the subject is now a member of"
+
},
+
"createdAt": {
+
"type": "string",
+
"format": "datetime"
+
}
+
}
+
}
+
}
+
}
+
}