Something went wrong. Try again.
Monorepo for Tangled
Something went wrong. Try again.
37 kB · 1714 lines
Go
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715// Code generated by github.com/whyrusleeping/cbor-gen. DO NOT EDIT.
package org_tangled
import ( "fmt" "io" "math" "sort"
cid "github.com/ipfs/go-cid" cbg "github.com/whyrusleeping/cbor-gen" xerrors "golang.org/x/xerrors")
var _ = xerrors.Errorfvar _ = cid.Undefvar _ = math.Evar _ = sort.Sort
func (t *CiSubscribePipelineLogs_Control) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err }
cw := cbg.NewCborWriter(w) fieldCount := 7
if t.Command == nil { fieldCount-- }
if t.Kind == nil { fieldCount-- }
if t.Status == nil { fieldCount-- }
if _, err := cw.Write(cbg.CborEncodeMajorType(cbg.MajMap, uint64(fieldCount))); err != nil { return err }
// t.Kind (string) (string) if t.Kind != nil {
if len("kind") > 1000000 { return xerrors.Errorf("Value in field \"kind\" was too long") }
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("kind"))); err != nil { return err } if _, err := cw.WriteString(string("kind")); err != nil { return err }
if t.Kind == nil { if _, err := cw.Write(cbg.CborNull); err != nil { return err } } else { if len(*t.Kind) > 1000000 { return xerrors.Errorf("Value in field t.Kind was too long") }
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Kind))); err != nil { return err } if _, err := cw.WriteString(string(*t.Kind)); err != nil { return err } } }
// t.Step (int64) (int64) if len("step") > 1000000 { return xerrors.Errorf("Value in field \"step\" was too long") }
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("step"))); err != nil { return err } if _, err := cw.WriteString(string("step")); err != nil { return err }
if t.Step >= 0 { if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.Step)); err != nil { return err } } else { if err := cw.WriteMajorTypeHeader(cbg.MajNegativeInt, uint64(-t.Step-1)); err != nil { return err } }
// t.Time (string) (string) if len("time") > 1000000 { return xerrors.Errorf("Value in field \"time\" was too long") }
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("time"))); err != nil { return err } if _, err := cw.WriteString(string("time")); err != nil { return err }
if len(t.Time) > 1000000 { return xerrors.Errorf("Value in field t.Time was too long") }
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Time))); err != nil { return err } if _, err := cw.WriteString(string(t.Time)); err != nil { return err }
// t.Status (string) (string) if t.Status != nil {
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 t.Status == nil { if _, err := cw.Write(cbg.CborNull); err != nil { return err } } else { 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 { return err } if _, err := cw.WriteString(string(*t.Status)); err != nil { return err } } }
// t.Command (string) (string) if t.Command != nil {
if len("command") > 1000000 { return xerrors.Errorf("Value in field \"command\" was too long") }
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("command"))); err != nil { return err } if _, err := cw.WriteString(string("command")); err != nil { return err }
if t.Command == nil { if _, err := cw.Write(cbg.CborNull); err != nil { return err } } else { if len(*t.Command) > 1000000 { return xerrors.Errorf("Value in field t.Command was too long") }
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Command))); err != nil { return err } if _, err := cw.WriteString(string(*t.Command)); err != nil { return err } } }
// t.Content (string) (string) if len("content") > 1000000 { return xerrors.Errorf("Value in field \"content\" was too long") }
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("content"))); err != nil { return err } if _, err := cw.WriteString(string("content")); err != nil { return err }
if len(t.Content) > 1000000 { return xerrors.Errorf("Value in field t.Content was too long") }
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Content))); err != nil { return err } if _, err := cw.WriteString(string(t.Content)); err != nil { return err }
// t.Workflow (string) (string) if len("workflow") > 1000000 { return xerrors.Errorf("Value in field \"workflow\" was too long") }
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("workflow"))); err != nil { return err } if _, err := cw.WriteString(string("workflow")); err != nil { return err }
if len(t.Workflow) > 1000000 { return xerrors.Errorf("Value in field t.Workflow was too long") }
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Workflow))); err != nil { return err } if _, err := cw.WriteString(string(t.Workflow)); err != nil { return err } return nil}
func (t *CiSubscribePipelineLogs_Control) UnmarshalCBOR(r io.Reader) (err error) { *t = CiSubscribePipelineLogs_Control{}
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("CiSubscribePipelineLogs_Control: map struct too large (%d)", extra) }
n := extra
nameBuf := make([]byte, 8) 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.Kind (string) (string) case "kind":
{ 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.Kind = (*string)(&sval) } } // t.Step (int64) (int64) case "step": { 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.Step = int64(extraI) } // t.Time (string) (string) case "time":
{ sval, err := cbg.ReadStringWithMax(cr, 1000000) if err != nil { return err }
t.Time = string(sval) } // t.Status (string) (string) case "status":
{ 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.Status = (*string)(&sval) } } // t.Command (string) (string) case "command":
{ 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.Command = (*string)(&sval) } } // t.Content (string) (string) case "content":
{ sval, err := cbg.ReadStringWithMax(cr, 1000000) if err != nil { return err }
t.Content = string(sval) } // t.Workflow (string) (string) case "workflow":
{ sval, err := cbg.ReadStringWithMax(cr, 1000000) if err != nil { return err }
t.Workflow = 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 *CiSubscribePipelineLogs_Data) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err }
cw := cbg.NewCborWriter(w)
if _, err := cw.Write([]byte{165}); err != nil { return err }
// t.Step (int64) (int64) if len("step") > 1000000 { return xerrors.Errorf("Value in field \"step\" was too long") }
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("step"))); err != nil { return err } if _, err := cw.WriteString(string("step")); err != nil { return err }
if t.Step >= 0 { if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.Step)); err != nil { return err } } else { if err := cw.WriteMajorTypeHeader(cbg.MajNegativeInt, uint64(-t.Step-1)); err != nil { return err } }
// t.Time (string) (string) if len("time") > 1000000 { return xerrors.Errorf("Value in field \"time\" was too long") }
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("time"))); err != nil { return err } if _, err := cw.WriteString(string("time")); err != nil { return err }
if len(t.Time) > 1000000 { return xerrors.Errorf("Value in field t.Time was too long") }
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Time))); err != nil { return err } if _, err := cw.WriteString(string(t.Time)); err != nil { return err }
// t.Stream (string) (string) if len("stream") > 1000000 { return xerrors.Errorf("Value in field \"stream\" was too long") }
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("stream"))); err != nil { return err } if _, err := cw.WriteString(string("stream")); err != nil { return err }
if len(t.Stream) > 1000000 { return xerrors.Errorf("Value in field t.Stream was too long") }
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Stream))); err != nil { return err } if _, err := cw.WriteString(string(t.Stream)); err != nil { return err }
// t.Content (string) (string) if len("content") > 1000000 { return xerrors.Errorf("Value in field \"content\" was too long") }
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("content"))); err != nil { return err } if _, err := cw.WriteString(string("content")); err != nil { return err }
if len(t.Content) > 1000000 { return xerrors.Errorf("Value in field t.Content was too long") }
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Content))); err != nil { return err } if _, err := cw.WriteString(string(t.Content)); err != nil { return err }
// t.Workflow (string) (string) if len("workflow") > 1000000 { return xerrors.Errorf("Value in field \"workflow\" was too long") }
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("workflow"))); err != nil { return err } if _, err := cw.WriteString(string("workflow")); err != nil { return err }
if len(t.Workflow) > 1000000 { return xerrors.Errorf("Value in field t.Workflow was too long") }
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Workflow))); err != nil { return err } if _, err := cw.WriteString(string(t.Workflow)); err != nil { return err } return nil}
func (t *CiSubscribePipelineLogs_Data) UnmarshalCBOR(r io.Reader) (err error) { *t = CiSubscribePipelineLogs_Data{}
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("CiSubscribePipelineLogs_Data: map struct too large (%d)", extra) }
n := extra
nameBuf := make([]byte, 8) 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.Step (int64) (int64) case "step": { 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.Step = int64(extraI) } // t.Time (string) (string) case "time":
{ sval, err := cbg.ReadStringWithMax(cr, 1000000) if err != nil { return err }
t.Time = string(sval) } // t.Stream (string) (string) case "stream":
{ sval, err := cbg.ReadStringWithMax(cr, 1000000) if err != nil { return err }
t.Stream = string(sval) } // t.Content (string) (string) case "content":
{ sval, err := cbg.ReadStringWithMax(cr, 1000000) if err != nil { return err }
t.Content = string(sval) } // t.Workflow (string) (string) case "workflow":
{ sval, err := cbg.ReadStringWithMax(cr, 1000000) if err != nil { return err }
t.Workflow = 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 *CiTriggerManual) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err }
cw := cbg.NewCborWriter(w) fieldCount := 5
if t.Inputs == nil { fieldCount-- }
if t.Ref == nil { fieldCount-- }
if _, err := cw.Write(cbg.CborEncodeMajorType(cbg.MajMap, uint64(fieldCount))); err != nil { return err }
// t.Ref (string) (string) if t.Ref != nil {
if len("ref") > 1000000 { return xerrors.Errorf("Value in field \"ref\" was too long") }
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("ref"))); err != nil { return err } if _, err := cw.WriteString(string("ref")); err != nil { return err }
if t.Ref == nil { if _, err := cw.Write(cbg.CborNull); err != nil { return err } } else { if len(*t.Ref) > 1000000 { return xerrors.Errorf("Value in field t.Ref 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 } } }
// 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("repo"))); err != nil { return err } if _, err := cw.WriteString(string("repo")); err != nil { return err }
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") }
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("org.tangled.ci.trigger.manual"))); err != nil { return err } if _, err := cw.WriteString(string("org.tangled.ci.trigger.manual")); err != nil { return err }
// t.Commit (string) (string) if len("commit") > 1000000 { return xerrors.Errorf("Value in field \"commit\" was too long") }
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("commit"))); err != nil { return err } if _, err := cw.WriteString(string("commit")); err != nil { return err }
if len(t.Commit) > 1000000 { return xerrors.Errorf("Value in field t.Commit was too long") }
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Commit))); err != nil { return err } if _, err := cw.WriteString(string(t.Commit)); err != nil { return err }
// t.Inputs ([]*org_tangled.CiTriggerManual_Pair) (slice) if t.Inputs != nil {
if len("inputs") > 1000000 { return xerrors.Errorf("Value in field \"inputs\" 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 len(t.Inputs) > 8192 { return xerrors.Errorf("Slice value in field t.Inputs 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 }
} } return nil}
func (t *CiTriggerManual) UnmarshalCBOR(r io.Reader) (err error) { *t = CiTriggerManual{}
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("CiTriggerManual: 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 } continue }
switch string(nameBuf[:nameLen]) { // t.Ref (string) (string) case "ref":
{ 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.Ref = (*string)(&sval) } } // t.Repo (string) (string) case "repo":
{ sval, err := cbg.ReadStringWithMax(cr, 1000000) if err != nil { return err }
t.Repo = string(sval) } // t.LexiconTypeID (string) (string) case "$type":
{ sval, err := cbg.ReadStringWithMax(cr, 1000000) if err != nil { return err }
t.LexiconTypeID = string(sval) } // t.Commit (string) (string) case "commit":
{ sval, err := cbg.ReadStringWithMax(cr, 1000000) if err != nil { return err }
t.Commit = string(sval) } // t.Inputs ([]*org_tangled.CiTriggerManual_Pair) (slice) case "inputs":
maj, extra, err = cr.ReadHeader() if err != nil { return err }
if extra > 8192 { return fmt.Errorf("t.Inputs: array too large (%d)", extra) }
if maj != cbg.MajArray { return fmt.Errorf("expected cbor array") }
if extra > 0 { t.Inputs = make([]*CiTriggerManual_Pair, 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(CiTriggerManual_Pair) if err := t.Inputs[i].UnmarshalCBOR(cr); err != nil { return xerrors.Errorf("unmarshaling t.Inputs[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 } } }
return nil}func (t *CiTriggerManual_Pair) 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 *CiTriggerManual_Pair) UnmarshalCBOR(r io.Reader) (err error) { *t = CiTriggerManual_Pair{}
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("CiTriggerManual_Pair: 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 *EventPullRequest) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err }
cw := cbg.NewCborWriter(w)
if _, err := cw.Write([]byte{161}); 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("org.tangled.event.pullRequest"))); err != nil { return err } if _, err := cw.WriteString(string("org.tangled.event.pullRequest")); err != nil { return err } return nil}
func (t *EventPullRequest) UnmarshalCBOR(r io.Reader) (err error) { *t = EventPullRequest{}
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("EventPullRequest: 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) }
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 *EventPush) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err }
cw := cbg.NewCborWriter(w)
if _, err := cw.Write([]byte{161}); 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("org.tangled.event.push"))); err != nil { return err } if _, err := cw.WriteString(string("org.tangled.event.push")); err != nil { return err } return nil}
func (t *EventPush) UnmarshalCBOR(r io.Reader) (err error) { *t = EventPush{}
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("EventPush: 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) }
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 *FeedSubscription) 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("org.tangled.feed.subscription"))); err != nil { return err } if _, err := cw.WriteString(string("org.tangled.feed.subscription")); err != nil { return err }
// t.Subject (org_tangled.FeedSubscription_Subject) (struct) if len("subject") > 1000000 { return xerrors.Errorf("Value in field \"subject\" was too long") }
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("subject"))); err != nil { return err } if _, err := cw.WriteString(string("subject")); err != nil { return err }
if err := t.Subject.MarshalCBOR(cw); err != nil { return err }
// 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("createdAt"))); err != nil { return err } if _, err := cw.WriteString(string("createdAt")); err != nil { return err }
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.CreatedAt))); err != nil { return err } if _, err := cw.WriteString(string(t.CreatedAt)); err != nil { return err } return nil}
func (t *FeedSubscription) UnmarshalCBOR(r io.Reader) (err error) { *t = FeedSubscription{}
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("FeedSubscription: map struct too large (%d)", extra) }
n := extra
nameBuf := make([]byte, 9) 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.Subject (org_tangled.FeedSubscription_Subject) (struct) case "subject":
{
b, err := cr.ReadByte() if err != nil { return err } if b != cbg.CborNull[0] { if err := cr.UnreadByte(); err != nil { return err } t.Subject = new(FeedSubscription_Subject) if err := t.Subject.UnmarshalCBOR(cr); err != nil { return xerrors.Errorf("unmarshaling t.Subject pointer: %w", err) } }
} // t.CreatedAt (string) (string) case "createdAt":
{ sval, err := cbg.ReadStringWithMax(cr, 1000000) if err != nil { return err }
t.CreatedAt = 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 *FeedSubscription_Record) 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.Uri (string) (string) if len("uri") > 1000000 { return xerrors.Errorf("Value in field \"uri\" was too long") }
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("uri"))); err != nil { return err } if _, err := cw.WriteString(string("uri")); err != nil { return err }
if len(t.Uri) > 1000000 { return xerrors.Errorf("Value in field t.Uri was too long") }
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Uri))); err != nil { return err } if _, err := cw.WriteString(string(t.Uri)); 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("org.tangled.feed.subscription#record"))); err != nil { return err } if _, err := cw.WriteString(string("org.tangled.feed.subscription#record")); err != nil { return err } return nil}
func (t *FeedSubscription_Record) UnmarshalCBOR(r io.Reader) (err error) { *t = FeedSubscription_Record{}
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("FeedSubscription_Record: 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.Uri (string) (string) case "uri":
{ sval, err := cbg.ReadStringWithMax(cr, 1000000) if err != nil { return err }
t.Uri = string(sval) } // t.LexiconTypeID (string) (string) case "$type":
{ sval, err := cbg.ReadStringWithMax(cr, 1000000) if err != nil { return err }
t.LexiconTypeID = 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 *FeedSubscription_Repo) 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.Did (string) (string) if len("did") > 1000000 { return xerrors.Errorf("Value in field \"did\" was too long") }
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("did"))); err != nil { return err } if _, err := cw.WriteString(string("did")); err != nil { return err }
if len(t.Did) > 1000000 { return xerrors.Errorf("Value in field t.Did was too long") }
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Did))); err != nil { return err } if _, err := cw.WriteString(string(t.Did)); 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("org.tangled.feed.subscription#repo"))); err != nil { return err } if _, err := cw.WriteString(string("org.tangled.feed.subscription#repo")); err != nil { return err } return nil}
func (t *FeedSubscription_Repo) UnmarshalCBOR(r io.Reader) (err error) { *t = FeedSubscription_Repo{}
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("FeedSubscription_Repo: 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.Did (string) (string) case "did":
{ sval, err := cbg.ReadStringWithMax(cr, 1000000) if err != nil { return err }
t.Did = string(sval) } // t.LexiconTypeID (string) (string) case "$type":
{ sval, err := cbg.ReadStringWithMax(cr, 1000000) if err != nil { return err }
t.LexiconTypeID = 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}