diff --git a/gen/proto/proto_edelweiss.go b/gen/proto/proto_edelweiss.go index 06ec943..feb04be 100644 --- a/gen/proto/proto_edelweiss.go +++ b/gen/proto/proto_edelweiss.go @@ -3,22 +3,22 @@ package proto import ( - pd12 "bytes" - pd8 "context" - pd6 "errors" - pd3 "fmt" - pd17 "github.com/ipfs/go-cid" - pd4 "github.com/ipfs/go-log/v2" + pd6 "bytes" + pd7 "context" + pd9 "errors" + pd2 "fmt" + pd16 "github.com/ipfs/go-cid" + pd5 "github.com/ipfs/go-log/v2" pd13 "github.com/ipld/edelweiss/services" - pd2 "github.com/ipld/edelweiss/values" - pd5 "github.com/ipld/go-ipld-prime" - pd9 "github.com/ipld/go-ipld-prime/codec/dagjson" - pd1 "github.com/ipld/go-ipld-prime/datamodel" - pd16 "github.com/ipld/go-ipld-prime/linking/cid" - pd7 "io" + pd1 "github.com/ipld/edelweiss/values" + pd11 "github.com/ipld/go-ipld-prime" + pd8 "github.com/ipld/go-ipld-prime/codec/dagjson" + pd3 "github.com/ipld/go-ipld-prime/datamodel" + pd17 "github.com/ipld/go-ipld-prime/linking/cid" + pd10 "io" pd15 "io/ioutil" - pd10 "net/http" - pd11 "net/url" + pd4 "net/http" + pd12 "net/url" pd14 "sync" ) @@ -27,22 +27,22 @@ import ( type DelegatedRouting_IdentifyArg struct { } -func (x DelegatedRouting_IdentifyArg) Node() pd1.Node { +func (x DelegatedRouting_IdentifyArg) Node() pd3.Node { return x } -func (x *DelegatedRouting_IdentifyArg) Parse(n pd1.Node) error { - if n.Kind() != pd1.Kind_Map { - return pd2.ErrNA +func (x *DelegatedRouting_IdentifyArg) Parse(n pd3.Node) error { + if n.Kind() != pd3.Kind_Map { + return pd1.ErrNA } iter := n.MapIterator() - fieldMap := map[string]pd2.ParseFunc{} + fieldMap := map[string]pd1.ParseFunc{} for !iter.Done() { if kn, vn, err := iter.Next(); err != nil { return err } else { if k, err := kn.AsString(); err != nil { - return pd3.Errorf("structure map key is not a string") + return pd2.Errorf("structure map key is not a string") } else { _ = vn switch k { @@ -52,7 +52,7 @@ func (x *DelegatedRouting_IdentifyArg) Parse(n pd1.Node) error { } } for _, fieldParse := range fieldMap { - if err := fieldParse(pd1.Null); err != nil { + if err := fieldParse(pd3.Null); err != nil { return err } } @@ -64,66 +64,66 @@ type DelegatedRouting_IdentifyArg_MapIterator struct { s *DelegatedRouting_IdentifyArg } -func (x *DelegatedRouting_IdentifyArg_MapIterator) Next() (key pd1.Node, value pd1.Node, err error) { +func (x *DelegatedRouting_IdentifyArg_MapIterator) Next() (key pd3.Node, value pd3.Node, err error) { x.i++ switch x.i { } - return nil, nil, pd2.ErrNA + return nil, nil, pd1.ErrNA } func (x *DelegatedRouting_IdentifyArg_MapIterator) Done() bool { return x.i+1 >= 0 } -func (x DelegatedRouting_IdentifyArg) Kind() pd1.Kind { - return pd1.Kind_Map +func (x DelegatedRouting_IdentifyArg) Kind() pd3.Kind { + return pd3.Kind_Map } -func (x DelegatedRouting_IdentifyArg) LookupByString(key string) (pd1.Node, error) { +func (x DelegatedRouting_IdentifyArg) LookupByString(key string) (pd3.Node, error) { switch key { } - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x DelegatedRouting_IdentifyArg) LookupByNode(key pd1.Node) (pd1.Node, error) { +func (x DelegatedRouting_IdentifyArg) LookupByNode(key pd3.Node) (pd3.Node, error) { switch key.Kind() { - case pd1.Kind_String: + case pd3.Kind_String: if s, err := key.AsString(); err != nil { return nil, err } else { return x.LookupByString(s) } - case pd1.Kind_Int: + case pd3.Kind_Int: if i, err := key.AsInt(); err != nil { return nil, err } else { return x.LookupByIndex(i) } } - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x DelegatedRouting_IdentifyArg) LookupByIndex(idx int64) (pd1.Node, error) { +func (x DelegatedRouting_IdentifyArg) LookupByIndex(idx int64) (pd3.Node, error) { switch idx { } - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x DelegatedRouting_IdentifyArg) LookupBySegment(seg pd1.PathSegment) (pd1.Node, error) { +func (x DelegatedRouting_IdentifyArg) LookupBySegment(seg pd3.PathSegment) (pd3.Node, error) { switch seg.String() { } - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x DelegatedRouting_IdentifyArg) MapIterator() pd1.MapIterator { +func (x DelegatedRouting_IdentifyArg) MapIterator() pd3.MapIterator { return &DelegatedRouting_IdentifyArg_MapIterator{-1, &x} } -func (x DelegatedRouting_IdentifyArg) ListIterator() pd1.ListIterator { +func (x DelegatedRouting_IdentifyArg) ListIterator() pd3.ListIterator { return nil } @@ -140,54 +140,54 @@ func (x DelegatedRouting_IdentifyArg) IsNull() bool { } func (x DelegatedRouting_IdentifyArg) AsBool() (bool, error) { - return false, pd2.ErrNA + return false, pd1.ErrNA } func (x DelegatedRouting_IdentifyArg) AsInt() (int64, error) { - return 0, pd2.ErrNA + return 0, pd1.ErrNA } func (x DelegatedRouting_IdentifyArg) AsFloat() (float64, error) { - return 0, pd2.ErrNA + return 0, pd1.ErrNA } func (x DelegatedRouting_IdentifyArg) AsString() (string, error) { - return "", pd2.ErrNA + return "", pd1.ErrNA } func (x DelegatedRouting_IdentifyArg) AsBytes() ([]byte, error) { - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x DelegatedRouting_IdentifyArg) AsLink() (pd1.Link, error) { - return nil, pd2.ErrNA +func (x DelegatedRouting_IdentifyArg) AsLink() (pd3.Link, error) { + return nil, pd1.ErrNA } -func (x DelegatedRouting_IdentifyArg) Prototype() pd1.NodePrototype { +func (x DelegatedRouting_IdentifyArg) Prototype() pd3.NodePrototype { return nil } // -- protocol type AnonList1 -- -type AnonList1 []pd2.String +type AnonList1 []pd1.String -func (v AnonList1) Node() pd1.Node { +func (v AnonList1) Node() pd3.Node { return v } -func (v *AnonList1) Parse(n pd1.Node) error { - if n.Kind() == pd1.Kind_Null { +func (v *AnonList1) Parse(n pd3.Node) error { + if n.Kind() == pd3.Kind_Null { *v = nil return nil } - if n.Kind() != pd1.Kind_List { - return pd2.ErrNA + if n.Kind() != pd3.Kind_List { + return pd1.ErrNA } else { *v = make(AnonList1, n.Length()) iter := n.ListIterator() for !iter.Done() { if i, n, err := iter.Next(); err != nil { - return pd2.ErrNA + return pd1.ErrNA } else if err = (*v)[i].Parse(n); err != nil { return err } @@ -196,39 +196,39 @@ func (v *AnonList1) Parse(n pd1.Node) error { } } -func (AnonList1) Kind() pd1.Kind { - return pd1.Kind_List +func (AnonList1) Kind() pd3.Kind { + return pd3.Kind_List } -func (AnonList1) LookupByString(string) (pd1.Node, error) { - return nil, pd2.ErrNA +func (AnonList1) LookupByString(string) (pd3.Node, error) { + return nil, pd1.ErrNA } -func (AnonList1) LookupByNode(key pd1.Node) (pd1.Node, error) { - return nil, pd2.ErrNA +func (AnonList1) LookupByNode(key pd3.Node) (pd3.Node, error) { + return nil, pd1.ErrNA } -func (v AnonList1) LookupByIndex(i int64) (pd1.Node, error) { +func (v AnonList1) LookupByIndex(i int64) (pd3.Node, error) { if i < 0 || i >= v.Length() { - return nil, pd2.ErrBounds + return nil, pd1.ErrBounds } else { return v[i].Node(), nil } } -func (v AnonList1) LookupBySegment(seg pd1.PathSegment) (pd1.Node, error) { +func (v AnonList1) LookupBySegment(seg pd3.PathSegment) (pd3.Node, error) { if i, err := seg.Index(); err != nil { - return nil, pd2.ErrNA + return nil, pd1.ErrNA } else { return v.LookupByIndex(i) } } -func (AnonList1) MapIterator() pd1.MapIterator { +func (AnonList1) MapIterator() pd3.MapIterator { return nil } -func (v AnonList1) ListIterator() pd1.ListIterator { +func (v AnonList1) ListIterator() pd3.ListIterator { return &AnonList1_ListIterator{v, 0} } @@ -245,30 +245,30 @@ func (AnonList1) IsNull() bool { } func (v AnonList1) AsBool() (bool, error) { - return false, pd2.ErrNA + return false, pd1.ErrNA } func (AnonList1) AsInt() (int64, error) { - return 0, pd2.ErrNA + return 0, pd1.ErrNA } func (AnonList1) AsFloat() (float64, error) { - return 0, pd2.ErrNA + return 0, pd1.ErrNA } func (AnonList1) AsString() (string, error) { - return "", pd2.ErrNA + return "", pd1.ErrNA } func (AnonList1) AsBytes() ([]byte, error) { - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (AnonList1) AsLink() (pd1.Link, error) { - return nil, pd2.ErrNA +func (AnonList1) AsLink() (pd3.Link, error) { + return nil, pd1.ErrNA } -func (AnonList1) Prototype() pd1.NodePrototype { +func (AnonList1) Prototype() pd3.NodePrototype { return nil // not needed } @@ -277,9 +277,9 @@ type AnonList1_ListIterator struct { at int64 } -func (iter *AnonList1_ListIterator) Next() (int64, pd1.Node, error) { +func (iter *AnonList1_ListIterator) Next() (int64, pd3.Node, error) { if iter.Done() { - return -1, nil, pd2.ErrBounds + return -1, nil, pd1.ErrBounds } v := iter.list[iter.at] i := int64(iter.at) @@ -297,16 +297,16 @@ type DelegatedRouting_IdentifyResult struct { Methods AnonList1 } -func (x DelegatedRouting_IdentifyResult) Node() pd1.Node { +func (x DelegatedRouting_IdentifyResult) Node() pd3.Node { return x } -func (x *DelegatedRouting_IdentifyResult) Parse(n pd1.Node) error { - if n.Kind() != pd1.Kind_Map { - return pd2.ErrNA +func (x *DelegatedRouting_IdentifyResult) Parse(n pd3.Node) error { + if n.Kind() != pd3.Kind_Map { + return pd1.ErrNA } iter := n.MapIterator() - fieldMap := map[string]pd2.ParseFunc{ + fieldMap := map[string]pd1.ParseFunc{ "Methods": x.Methods.Parse, } for !iter.Done() { @@ -314,13 +314,13 @@ func (x *DelegatedRouting_IdentifyResult) Parse(n pd1.Node) error { return err } else { if k, err := kn.AsString(); err != nil { - return pd3.Errorf("structure map key is not a string") + return pd2.Errorf("structure map key is not a string") } else { _ = vn switch k { case "Methods": if _, notParsed := fieldMap["Methods"]; !notParsed { - return pd3.Errorf("field %s already parsed", "Methods") + return pd2.Errorf("field %s already parsed", "Methods") } if err := x.Methods.Parse(vn); err != nil { return err @@ -332,7 +332,7 @@ func (x *DelegatedRouting_IdentifyResult) Parse(n pd1.Node) error { } } for _, fieldParse := range fieldMap { - if err := fieldParse(pd1.Null); err != nil { + if err := fieldParse(pd3.Null); err != nil { return err } } @@ -344,74 +344,74 @@ type DelegatedRouting_IdentifyResult_MapIterator struct { s *DelegatedRouting_IdentifyResult } -func (x *DelegatedRouting_IdentifyResult_MapIterator) Next() (key pd1.Node, value pd1.Node, err error) { +func (x *DelegatedRouting_IdentifyResult_MapIterator) Next() (key pd3.Node, value pd3.Node, err error) { x.i++ switch x.i { case 0: - return pd2.String("Methods"), x.s.Methods.Node(), nil + return pd1.String("Methods"), x.s.Methods.Node(), nil } - return nil, nil, pd2.ErrNA + return nil, nil, pd1.ErrNA } func (x *DelegatedRouting_IdentifyResult_MapIterator) Done() bool { return x.i+1 >= 1 } -func (x DelegatedRouting_IdentifyResult) Kind() pd1.Kind { - return pd1.Kind_Map +func (x DelegatedRouting_IdentifyResult) Kind() pd3.Kind { + return pd3.Kind_Map } -func (x DelegatedRouting_IdentifyResult) LookupByString(key string) (pd1.Node, error) { +func (x DelegatedRouting_IdentifyResult) LookupByString(key string) (pd3.Node, error) { switch key { case "Methods": return x.Methods.Node(), nil } - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x DelegatedRouting_IdentifyResult) LookupByNode(key pd1.Node) (pd1.Node, error) { +func (x DelegatedRouting_IdentifyResult) LookupByNode(key pd3.Node) (pd3.Node, error) { switch key.Kind() { - case pd1.Kind_String: + case pd3.Kind_String: if s, err := key.AsString(); err != nil { return nil, err } else { return x.LookupByString(s) } - case pd1.Kind_Int: + case pd3.Kind_Int: if i, err := key.AsInt(); err != nil { return nil, err } else { return x.LookupByIndex(i) } } - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x DelegatedRouting_IdentifyResult) LookupByIndex(idx int64) (pd1.Node, error) { +func (x DelegatedRouting_IdentifyResult) LookupByIndex(idx int64) (pd3.Node, error) { switch idx { case 0: return x.Methods.Node(), nil } - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x DelegatedRouting_IdentifyResult) LookupBySegment(seg pd1.PathSegment) (pd1.Node, error) { +func (x DelegatedRouting_IdentifyResult) LookupBySegment(seg pd3.PathSegment) (pd3.Node, error) { switch seg.String() { case "0", "Methods": return x.Methods.Node(), nil } - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x DelegatedRouting_IdentifyResult) MapIterator() pd1.MapIterator { +func (x DelegatedRouting_IdentifyResult) MapIterator() pd3.MapIterator { return &DelegatedRouting_IdentifyResult_MapIterator{-1, &x} } -func (x DelegatedRouting_IdentifyResult) ListIterator() pd1.ListIterator { +func (x DelegatedRouting_IdentifyResult) ListIterator() pd3.ListIterator { return nil } @@ -428,49 +428,49 @@ func (x DelegatedRouting_IdentifyResult) IsNull() bool { } func (x DelegatedRouting_IdentifyResult) AsBool() (bool, error) { - return false, pd2.ErrNA + return false, pd1.ErrNA } func (x DelegatedRouting_IdentifyResult) AsInt() (int64, error) { - return 0, pd2.ErrNA + return 0, pd1.ErrNA } func (x DelegatedRouting_IdentifyResult) AsFloat() (float64, error) { - return 0, pd2.ErrNA + return 0, pd1.ErrNA } func (x DelegatedRouting_IdentifyResult) AsString() (string, error) { - return "", pd2.ErrNA + return "", pd1.ErrNA } func (x DelegatedRouting_IdentifyResult) AsBytes() ([]byte, error) { - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x DelegatedRouting_IdentifyResult) AsLink() (pd1.Link, error) { - return nil, pd2.ErrNA +func (x DelegatedRouting_IdentifyResult) AsLink() (pd3.Link, error) { + return nil, pd1.ErrNA } -func (x DelegatedRouting_IdentifyResult) Prototype() pd1.NodePrototype { +func (x DelegatedRouting_IdentifyResult) Prototype() pd3.NodePrototype { return nil } // -- protocol type DelegatedRouting_Error -- type DelegatedRouting_Error struct { - Code pd2.String + Code pd1.String } -func (x DelegatedRouting_Error) Node() pd1.Node { +func (x DelegatedRouting_Error) Node() pd3.Node { return x } -func (x *DelegatedRouting_Error) Parse(n pd1.Node) error { - if n.Kind() != pd1.Kind_Map { - return pd2.ErrNA +func (x *DelegatedRouting_Error) Parse(n pd3.Node) error { + if n.Kind() != pd3.Kind_Map { + return pd1.ErrNA } iter := n.MapIterator() - fieldMap := map[string]pd2.ParseFunc{ + fieldMap := map[string]pd1.ParseFunc{ "Code": x.Code.Parse, } for !iter.Done() { @@ -478,13 +478,13 @@ func (x *DelegatedRouting_Error) Parse(n pd1.Node) error { return err } else { if k, err := kn.AsString(); err != nil { - return pd3.Errorf("structure map key is not a string") + return pd2.Errorf("structure map key is not a string") } else { _ = vn switch k { case "Code": if _, notParsed := fieldMap["Code"]; !notParsed { - return pd3.Errorf("field %s already parsed", "Code") + return pd2.Errorf("field %s already parsed", "Code") } if err := x.Code.Parse(vn); err != nil { return err @@ -496,7 +496,7 @@ func (x *DelegatedRouting_Error) Parse(n pd1.Node) error { } } for _, fieldParse := range fieldMap { - if err := fieldParse(pd1.Null); err != nil { + if err := fieldParse(pd3.Null); err != nil { return err } } @@ -508,74 +508,74 @@ type DelegatedRouting_Error_MapIterator struct { s *DelegatedRouting_Error } -func (x *DelegatedRouting_Error_MapIterator) Next() (key pd1.Node, value pd1.Node, err error) { +func (x *DelegatedRouting_Error_MapIterator) Next() (key pd3.Node, value pd3.Node, err error) { x.i++ switch x.i { case 0: - return pd2.String("Code"), x.s.Code.Node(), nil + return pd1.String("Code"), x.s.Code.Node(), nil } - return nil, nil, pd2.ErrNA + return nil, nil, pd1.ErrNA } func (x *DelegatedRouting_Error_MapIterator) Done() bool { return x.i+1 >= 1 } -func (x DelegatedRouting_Error) Kind() pd1.Kind { - return pd1.Kind_Map +func (x DelegatedRouting_Error) Kind() pd3.Kind { + return pd3.Kind_Map } -func (x DelegatedRouting_Error) LookupByString(key string) (pd1.Node, error) { +func (x DelegatedRouting_Error) LookupByString(key string) (pd3.Node, error) { switch key { case "Code": return x.Code.Node(), nil } - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x DelegatedRouting_Error) LookupByNode(key pd1.Node) (pd1.Node, error) { +func (x DelegatedRouting_Error) LookupByNode(key pd3.Node) (pd3.Node, error) { switch key.Kind() { - case pd1.Kind_String: + case pd3.Kind_String: if s, err := key.AsString(); err != nil { return nil, err } else { return x.LookupByString(s) } - case pd1.Kind_Int: + case pd3.Kind_Int: if i, err := key.AsInt(); err != nil { return nil, err } else { return x.LookupByIndex(i) } } - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x DelegatedRouting_Error) LookupByIndex(idx int64) (pd1.Node, error) { +func (x DelegatedRouting_Error) LookupByIndex(idx int64) (pd3.Node, error) { switch idx { case 0: return x.Code.Node(), nil } - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x DelegatedRouting_Error) LookupBySegment(seg pd1.PathSegment) (pd1.Node, error) { +func (x DelegatedRouting_Error) LookupBySegment(seg pd3.PathSegment) (pd3.Node, error) { switch seg.String() { case "0", "Code": return x.Code.Node(), nil } - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x DelegatedRouting_Error) MapIterator() pd1.MapIterator { +func (x DelegatedRouting_Error) MapIterator() pd3.MapIterator { return &DelegatedRouting_Error_MapIterator{-1, &x} } -func (x DelegatedRouting_Error) ListIterator() pd1.ListIterator { +func (x DelegatedRouting_Error) ListIterator() pd3.ListIterator { return nil } @@ -592,30 +592,30 @@ func (x DelegatedRouting_Error) IsNull() bool { } func (x DelegatedRouting_Error) AsBool() (bool, error) { - return false, pd2.ErrNA + return false, pd1.ErrNA } func (x DelegatedRouting_Error) AsInt() (int64, error) { - return 0, pd2.ErrNA + return 0, pd1.ErrNA } func (x DelegatedRouting_Error) AsFloat() (float64, error) { - return 0, pd2.ErrNA + return 0, pd1.ErrNA } func (x DelegatedRouting_Error) AsString() (string, error) { - return "", pd2.ErrNA + return "", pd1.ErrNA } func (x DelegatedRouting_Error) AsBytes() ([]byte, error) { - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x DelegatedRouting_Error) AsLink() (pd1.Link, error) { - return nil, pd2.ErrNA +func (x DelegatedRouting_Error) AsLink() (pd3.Link, error) { + return nil, pd1.ErrNA } -func (x DelegatedRouting_Error) Prototype() pd1.NodePrototype { +func (x DelegatedRouting_Error) Prototype() pd3.NodePrototype { return nil } @@ -629,10 +629,10 @@ type AnonInductive4 struct { Provide *ProvideRequest } -func (x *AnonInductive4) Parse(n pd1.Node) error { +func (x *AnonInductive4) Parse(n pd3.Node) error { *x = AnonInductive4{} - if n.Kind() != pd1.Kind_Map { - return pd2.ErrNA + if n.Kind() != pd3.Kind_Map { + return pd1.ErrNA } iter := n.MapIterator() kn, vn, err := iter.Next() @@ -641,7 +641,7 @@ func (x *AnonInductive4) Parse(n pd1.Node) error { } k, err := kn.AsString() if err != nil { - return pd3.Errorf("inductive map key is not a string") + return pd2.Errorf("inductive map key is not a string") } switch k { case "IdentifyRequest": @@ -682,7 +682,7 @@ func (x *AnonInductive4) Parse(n pd1.Node) error { } - return pd3.Errorf("inductive map has no applicable keys") + return pd2.Errorf("inductive map has no applicable keys") } @@ -691,25 +691,25 @@ type AnonInductive4_MapIterator struct { s *AnonInductive4 } -func (x *AnonInductive4_MapIterator) Next() (key pd1.Node, value pd1.Node, err error) { +func (x *AnonInductive4_MapIterator) Next() (key pd3.Node, value pd3.Node, err error) { if x.done { - return nil, nil, pd2.ErrNA + return nil, nil, pd1.ErrNA } else { x.done = true switch { case x.s.Identify != nil: - return pd2.String("IdentifyRequest"), x.s.Identify.Node(), nil + return pd1.String("IdentifyRequest"), x.s.Identify.Node(), nil case x.s.FindProviders != nil: - return pd2.String("FindProvidersRequest"), x.s.FindProviders.Node(), nil + return pd1.String("FindProvidersRequest"), x.s.FindProviders.Node(), nil case x.s.GetIPNS != nil: - return pd2.String("GetIPNSRequest"), x.s.GetIPNS.Node(), nil + return pd1.String("GetIPNSRequest"), x.s.GetIPNS.Node(), nil case x.s.PutIPNS != nil: - return pd2.String("PutIPNSRequest"), x.s.PutIPNS.Node(), nil + return pd1.String("PutIPNSRequest"), x.s.PutIPNS.Node(), nil case x.s.Provide != nil: - return pd2.String("ProvideRequest"), x.s.Provide.Node(), nil + return pd1.String("ProvideRequest"), x.s.Provide.Node(), nil default: - return nil, nil, pd3.Errorf("no inductive cases are set") + return nil, nil, pd2.Errorf("no inductive cases are set") } } } @@ -718,15 +718,15 @@ func (x *AnonInductive4_MapIterator) Done() bool { return x.done } -func (x AnonInductive4) Node() pd1.Node { +func (x AnonInductive4) Node() pd3.Node { return x } -func (x AnonInductive4) Kind() pd1.Kind { - return pd1.Kind_Map +func (x AnonInductive4) Kind() pd3.Kind { + return pd3.Kind_Map } -func (x AnonInductive4) LookupByString(key string) (pd1.Node, error) { +func (x AnonInductive4) LookupByString(key string) (pd3.Node, error) { switch { case x.Identify != nil && key == "IdentifyRequest": return x.Identify.Node(), nil @@ -740,12 +740,12 @@ func (x AnonInductive4) LookupByString(key string) (pd1.Node, error) { return x.Provide.Node(), nil } - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x AnonInductive4) LookupByNode(key pd1.Node) (pd1.Node, error) { - if key.Kind() != pd1.Kind_String { - return nil, pd2.ErrNA +func (x AnonInductive4) LookupByNode(key pd3.Node) (pd3.Node, error) { + if key.Kind() != pd3.Kind_String { + return nil, pd1.ErrNA } if s, err := key.AsString(); err != nil { return nil, err @@ -754,11 +754,11 @@ func (x AnonInductive4) LookupByNode(key pd1.Node) (pd1.Node, error) { } } -func (x AnonInductive4) LookupByIndex(idx int64) (pd1.Node, error) { - return nil, pd2.ErrNA +func (x AnonInductive4) LookupByIndex(idx int64) (pd3.Node, error) { + return nil, pd1.ErrNA } -func (x AnonInductive4) LookupBySegment(seg pd1.PathSegment) (pd1.Node, error) { +func (x AnonInductive4) LookupBySegment(seg pd3.PathSegment) (pd3.Node, error) { switch seg.String() { case "IdentifyRequest": return x.Identify.Node(), nil @@ -772,14 +772,14 @@ func (x AnonInductive4) LookupBySegment(seg pd1.PathSegment) (pd1.Node, error) { return x.Provide.Node(), nil } - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x AnonInductive4) MapIterator() pd1.MapIterator { +func (x AnonInductive4) MapIterator() pd3.MapIterator { return &AnonInductive4_MapIterator{false, &x} } -func (x AnonInductive4) ListIterator() pd1.ListIterator { +func (x AnonInductive4) ListIterator() pd3.ListIterator { return nil } @@ -796,30 +796,30 @@ func (x AnonInductive4) IsNull() bool { } func (x AnonInductive4) AsBool() (bool, error) { - return false, pd2.ErrNA + return false, pd1.ErrNA } func (x AnonInductive4) AsInt() (int64, error) { - return 0, pd2.ErrNA + return 0, pd1.ErrNA } func (x AnonInductive4) AsFloat() (float64, error) { - return 0, pd2.ErrNA + return 0, pd1.ErrNA } func (x AnonInductive4) AsString() (string, error) { - return "", pd2.ErrNA + return "", pd1.ErrNA } func (x AnonInductive4) AsBytes() ([]byte, error) { - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x AnonInductive4) AsLink() (pd1.Link, error) { - return nil, pd2.ErrNA +func (x AnonInductive4) AsLink() (pd3.Link, error) { + return nil, pd1.ErrNA } -func (x AnonInductive4) Prototype() pd1.NodePrototype { +func (x AnonInductive4) Prototype() pd3.NodePrototype { return nil } @@ -834,10 +834,10 @@ type AnonInductive5 struct { Error *DelegatedRouting_Error } -func (x *AnonInductive5) Parse(n pd1.Node) error { +func (x *AnonInductive5) Parse(n pd3.Node) error { *x = AnonInductive5{} - if n.Kind() != pd1.Kind_Map { - return pd2.ErrNA + if n.Kind() != pd3.Kind_Map { + return pd1.ErrNA } iter := n.MapIterator() kn, vn, err := iter.Next() @@ -846,7 +846,7 @@ func (x *AnonInductive5) Parse(n pd1.Node) error { } k, err := kn.AsString() if err != nil { - return pd3.Errorf("inductive map key is not a string") + return pd2.Errorf("inductive map key is not a string") } switch k { case "IdentifyResponse": @@ -894,7 +894,7 @@ func (x *AnonInductive5) Parse(n pd1.Node) error { } - return pd3.Errorf("inductive map has no applicable keys") + return pd2.Errorf("inductive map has no applicable keys") } @@ -903,27 +903,27 @@ type AnonInductive5_MapIterator struct { s *AnonInductive5 } -func (x *AnonInductive5_MapIterator) Next() (key pd1.Node, value pd1.Node, err error) { +func (x *AnonInductive5_MapIterator) Next() (key pd3.Node, value pd3.Node, err error) { if x.done { - return nil, nil, pd2.ErrNA + return nil, nil, pd1.ErrNA } else { x.done = true switch { case x.s.Identify != nil: - return pd2.String("IdentifyResponse"), x.s.Identify.Node(), nil + return pd1.String("IdentifyResponse"), x.s.Identify.Node(), nil case x.s.FindProviders != nil: - return pd2.String("FindProvidersResponse"), x.s.FindProviders.Node(), nil + return pd1.String("FindProvidersResponse"), x.s.FindProviders.Node(), nil case x.s.GetIPNS != nil: - return pd2.String("GetIPNSResponse"), x.s.GetIPNS.Node(), nil + return pd1.String("GetIPNSResponse"), x.s.GetIPNS.Node(), nil case x.s.PutIPNS != nil: - return pd2.String("PutIPNSResponse"), x.s.PutIPNS.Node(), nil + return pd1.String("PutIPNSResponse"), x.s.PutIPNS.Node(), nil case x.s.Provide != nil: - return pd2.String("ProvideResponse"), x.s.Provide.Node(), nil + return pd1.String("ProvideResponse"), x.s.Provide.Node(), nil case x.s.Error != nil: - return pd2.String("Error"), x.s.Error.Node(), nil + return pd1.String("Error"), x.s.Error.Node(), nil default: - return nil, nil, pd3.Errorf("no inductive cases are set") + return nil, nil, pd2.Errorf("no inductive cases are set") } } } @@ -932,15 +932,15 @@ func (x *AnonInductive5_MapIterator) Done() bool { return x.done } -func (x AnonInductive5) Node() pd1.Node { +func (x AnonInductive5) Node() pd3.Node { return x } -func (x AnonInductive5) Kind() pd1.Kind { - return pd1.Kind_Map +func (x AnonInductive5) Kind() pd3.Kind { + return pd3.Kind_Map } -func (x AnonInductive5) LookupByString(key string) (pd1.Node, error) { +func (x AnonInductive5) LookupByString(key string) (pd3.Node, error) { switch { case x.Identify != nil && key == "IdentifyResponse": return x.Identify.Node(), nil @@ -956,12 +956,12 @@ func (x AnonInductive5) LookupByString(key string) (pd1.Node, error) { return x.Error.Node(), nil } - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x AnonInductive5) LookupByNode(key pd1.Node) (pd1.Node, error) { - if key.Kind() != pd1.Kind_String { - return nil, pd2.ErrNA +func (x AnonInductive5) LookupByNode(key pd3.Node) (pd3.Node, error) { + if key.Kind() != pd3.Kind_String { + return nil, pd1.ErrNA } if s, err := key.AsString(); err != nil { return nil, err @@ -970,11 +970,11 @@ func (x AnonInductive5) LookupByNode(key pd1.Node) (pd1.Node, error) { } } -func (x AnonInductive5) LookupByIndex(idx int64) (pd1.Node, error) { - return nil, pd2.ErrNA +func (x AnonInductive5) LookupByIndex(idx int64) (pd3.Node, error) { + return nil, pd1.ErrNA } -func (x AnonInductive5) LookupBySegment(seg pd1.PathSegment) (pd1.Node, error) { +func (x AnonInductive5) LookupBySegment(seg pd3.PathSegment) (pd3.Node, error) { switch seg.String() { case "IdentifyResponse": return x.Identify.Node(), nil @@ -990,14 +990,14 @@ func (x AnonInductive5) LookupBySegment(seg pd1.PathSegment) (pd1.Node, error) { return x.Error.Node(), nil } - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x AnonInductive5) MapIterator() pd1.MapIterator { +func (x AnonInductive5) MapIterator() pd3.MapIterator { return &AnonInductive5_MapIterator{false, &x} } -func (x AnonInductive5) ListIterator() pd1.ListIterator { +func (x AnonInductive5) ListIterator() pd3.ListIterator { return nil } @@ -1014,55 +1014,55 @@ func (x AnonInductive5) IsNull() bool { } func (x AnonInductive5) AsBool() (bool, error) { - return false, pd2.ErrNA + return false, pd1.ErrNA } func (x AnonInductive5) AsInt() (int64, error) { - return 0, pd2.ErrNA + return 0, pd1.ErrNA } func (x AnonInductive5) AsFloat() (float64, error) { - return 0, pd2.ErrNA + return 0, pd1.ErrNA } func (x AnonInductive5) AsString() (string, error) { - return "", pd2.ErrNA + return "", pd1.ErrNA } func (x AnonInductive5) AsBytes() ([]byte, error) { - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x AnonInductive5) AsLink() (pd1.Link, error) { - return nil, pd2.ErrNA +func (x AnonInductive5) AsLink() (pd3.Link, error) { + return nil, pd1.ErrNA } -func (x AnonInductive5) Prototype() pd1.NodePrototype { +func (x AnonInductive5) Prototype() pd3.NodePrototype { return nil } -var logger_client_DelegatedRouting = pd4.Logger("service/client/delegatedrouting") +var logger_client_DelegatedRouting = pd5.Logger("service/client/delegatedrouting") type DelegatedRouting_Client interface { - Identify(ctx pd8.Context, req *DelegatedRouting_IdentifyArg) ([]*DelegatedRouting_IdentifyResult, error) + Identify(ctx pd7.Context, req *DelegatedRouting_IdentifyArg) ([]*DelegatedRouting_IdentifyResult, error) - FindProviders(ctx pd8.Context, req *FindProvidersRequest) ([]*FindProvidersResponse, error) + FindProviders(ctx pd7.Context, req *FindProvidersRequest) ([]*FindProvidersResponse, error) - GetIPNS(ctx pd8.Context, req *GetIPNSRequest) ([]*GetIPNSResponse, error) + GetIPNS(ctx pd7.Context, req *GetIPNSRequest) ([]*GetIPNSResponse, error) - PutIPNS(ctx pd8.Context, req *PutIPNSRequest) ([]*PutIPNSResponse, error) + PutIPNS(ctx pd7.Context, req *PutIPNSRequest) ([]*PutIPNSResponse, error) - Provide(ctx pd8.Context, req *ProvideRequest) ([]*ProvideResponse, error) + Provide(ctx pd7.Context, req *ProvideRequest) ([]*ProvideResponse, error) - Identify_Async(ctx pd8.Context, req *DelegatedRouting_IdentifyArg) (<-chan DelegatedRouting_Identify_AsyncResult, error) + Identify_Async(ctx pd7.Context, req *DelegatedRouting_IdentifyArg) (<-chan DelegatedRouting_Identify_AsyncResult, error) - FindProviders_Async(ctx pd8.Context, req *FindProvidersRequest) (<-chan DelegatedRouting_FindProviders_AsyncResult, error) + FindProviders_Async(ctx pd7.Context, req *FindProvidersRequest) (<-chan DelegatedRouting_FindProviders_AsyncResult, error) - GetIPNS_Async(ctx pd8.Context, req *GetIPNSRequest) (<-chan DelegatedRouting_GetIPNS_AsyncResult, error) + GetIPNS_Async(ctx pd7.Context, req *GetIPNSRequest) (<-chan DelegatedRouting_GetIPNS_AsyncResult, error) - PutIPNS_Async(ctx pd8.Context, req *PutIPNSRequest) (<-chan DelegatedRouting_PutIPNS_AsyncResult, error) + PutIPNS_Async(ctx pd7.Context, req *PutIPNSRequest) (<-chan DelegatedRouting_PutIPNS_AsyncResult, error) - Provide_Async(ctx pd8.Context, req *ProvideRequest) (<-chan DelegatedRouting_Provide_AsyncResult, error) + Provide_Async(ctx pd7.Context, req *ProvideRequest) (<-chan DelegatedRouting_Provide_AsyncResult, error) } type DelegatedRouting_Identify_AsyncResult struct { @@ -1093,13 +1093,13 @@ type DelegatedRouting_Provide_AsyncResult struct { type DelegatedRouting_ClientOption func(*client_DelegatedRouting) error type client_DelegatedRouting struct { - httpClient *pd10.Client - endpoint *pd11.URL + httpClient *pd4.Client + endpoint *pd12.URL ulk pd14.Mutex unsupported map[string]bool // cache of methods not supported by server } -func DelegatedRouting_Client_WithHTTPClient(hc *pd10.Client) DelegatedRouting_ClientOption { +func DelegatedRouting_Client_WithHTTPClient(hc *pd4.Client) DelegatedRouting_ClientOption { return func(c *client_DelegatedRouting) error { c.httpClient = hc return nil @@ -1107,11 +1107,11 @@ func DelegatedRouting_Client_WithHTTPClient(hc *pd10.Client) DelegatedRouting_Cl } func New_DelegatedRouting_Client(endpoint string, opts ...DelegatedRouting_ClientOption) (*client_DelegatedRouting, error) { - u, err := pd11.Parse(endpoint) + u, err := pd12.Parse(endpoint) if err != nil { return nil, err } - c := &client_DelegatedRouting{endpoint: u, httpClient: pd10.DefaultClient, unsupported: make(map[string]bool)} + c := &client_DelegatedRouting{endpoint: u, httpClient: pd4.DefaultClient, unsupported: make(map[string]bool)} for _, o := range opts { if err := o(c); err != nil { return nil, err @@ -1120,8 +1120,8 @@ func New_DelegatedRouting_Client(endpoint string, opts ...DelegatedRouting_Clien return c, nil } -func (c *client_DelegatedRouting) Identify(ctx pd8.Context, req *DelegatedRouting_IdentifyArg) ([]*DelegatedRouting_IdentifyResult, error) { - ctx, cancel := pd8.WithCancel(ctx) +func (c *client_DelegatedRouting) Identify(ctx pd7.Context, req *DelegatedRouting_IdentifyArg) ([]*DelegatedRouting_IdentifyResult, error) { + ctx, cancel := pd7.WithCancel(ctx) defer cancel() ch, err := c.Identify_Async(ctx, req) if err != nil { @@ -1149,7 +1149,7 @@ func (c *client_DelegatedRouting) Identify(ctx pd8.Context, req *DelegatedRoutin } } -func (c *client_DelegatedRouting) Identify_Async(ctx pd8.Context, req *DelegatedRouting_IdentifyArg) (<-chan DelegatedRouting_Identify_AsyncResult, error) { +func (c *client_DelegatedRouting) Identify_Async(ctx pd7.Context, req *DelegatedRouting_IdentifyArg) (<-chan DelegatedRouting_Identify_AsyncResult, error) { // check if we have memoized that this method is not supported by the server c.ulk.Lock() notSupported := c.unsupported["Identify"] @@ -1162,14 +1162,14 @@ func (c *client_DelegatedRouting) Identify_Async(ctx pd8.Context, req *Delegated Identify: req, } - buf, err := pd5.Encode(envelope, pd9.Encode) + buf, err := pd11.Encode(envelope, pd8.Encode) if err != nil { - return nil, pd3.Errorf("unexpected serialization error (%v)", err) + return nil, pd2.Errorf("serializing DAG-JSON request: %w", err) } // encode request in URL u := *c.endpoint - httpReq, err := pd10.NewRequestWithContext(ctx, "POST", u.String(), pd12.NewReader(buf)) + httpReq, err := pd4.NewRequestWithContext(ctx, "POST", u.String(), pd6.NewReader(buf)) if err != nil { return nil, err } @@ -1181,7 +1181,7 @@ func (c *client_DelegatedRouting) Identify_Async(ctx pd8.Context, req *Delegated resp, err := c.httpClient.Do(httpReq) if err != nil { - return nil, pd3.Errorf("sending HTTP request: %w", err) + return nil, pd2.Errorf("sending HTTP request: %w", err) } // HTTP codes 400 and 404 correspond to unrecognized method or request schema @@ -1199,12 +1199,12 @@ func (c *client_DelegatedRouting) Identify_Async(ctx pd8.Context, req *Delegated resp.Body.Close() if resp.Header != nil { if errValues, ok := resp.Header["Error"]; ok && len(errValues) == 1 { - err = pd13.ErrService{Cause: pd3.Errorf("%s", errValues[0])} + err = pd13.ErrService{Cause: pd2.Errorf("%s", errValues[0])} } else { - err = pd3.Errorf("service rejected the call, no cause provided") + err = pd2.Errorf("service rejected the call, no cause provided") } } else { - err = pd3.Errorf("service rejected the call") + err = pd2.Errorf("service rejected the call") } return nil, err } @@ -1214,10 +1214,10 @@ func (c *client_DelegatedRouting) Identify_Async(ctx pd8.Context, req *Delegated return ch, nil } -func process_DelegatedRouting_Identify_AsyncResult(ctx pd8.Context, ch chan<- DelegatedRouting_Identify_AsyncResult, r pd7.ReadCloser) { +func process_DelegatedRouting_Identify_AsyncResult(ctx pd7.Context, ch chan<- DelegatedRouting_Identify_AsyncResult, r pd10.ReadCloser) { defer close(ch) defer r.Close() - opt := pd9.DecodeOptions{ + opt := pd8.DecodeOptions{ ParseLinks: true, ParseBytes: true, DontParseBeyondEnd: true, @@ -1225,9 +1225,9 @@ func process_DelegatedRouting_Identify_AsyncResult(ctx pd8.Context, ch chan<- De for { var out DelegatedRouting_Identify_AsyncResult - n, err := pd5.DecodeStreaming(r, opt.Decode) + n, err := pd11.DecodeStreaming(r, opt.Decode) - if pd6.Is(err, pd7.EOF) || pd6.Is(err, pd7.ErrUnexpectedEOF) || pd6.Is(err, pd8.DeadlineExceeded) || pd6.Is(err, pd8.Canceled) { + if pd9.Is(err, pd10.EOF) || pd9.Is(err, pd10.ErrUnexpectedEOF) || pd9.Is(err, pd7.DeadlineExceeded) || pd9.Is(err, pd7.Canceled) { return } @@ -1236,13 +1236,13 @@ func process_DelegatedRouting_Identify_AsyncResult(ctx pd8.Context, ch chan<- De } else { var x [1]byte if k, err := r.Read(x[:]); k != 1 || x[0] != '\n' { - out = DelegatedRouting_Identify_AsyncResult{Err: pd13.ErrProto{Cause: pd3.Errorf("missing new line after result: err (%v), read (%d), char (%q)", err, k, string(x[:]))}} // Edelweiss decode error + out = DelegatedRouting_Identify_AsyncResult{Err: pd13.ErrProto{Cause: pd2.Errorf("missing new line after result: err (%v), read (%d), char (%q)", err, k, string(x[:]))}} // Edelweiss decode error } else { env := &AnonInductive5{} if err = env.Parse(n); err != nil { out = DelegatedRouting_Identify_AsyncResult{Err: pd13.ErrProto{Cause: err}} // schema decode error } else if env.Error != nil { - out = DelegatedRouting_Identify_AsyncResult{Err: pd13.ErrService{Cause: pd6.New(string(env.Error.Code))}} // service-level error + out = DelegatedRouting_Identify_AsyncResult{Err: pd13.ErrService{Cause: pd9.New(string(env.Error.Code))}} // service-level error } else if env.Identify != nil { out = DelegatedRouting_Identify_AsyncResult{Resp: env.Identify} } else { @@ -1259,8 +1259,8 @@ func process_DelegatedRouting_Identify_AsyncResult(ctx pd8.Context, ch chan<- De } } -func (c *client_DelegatedRouting) FindProviders(ctx pd8.Context, req *FindProvidersRequest) ([]*FindProvidersResponse, error) { - ctx, cancel := pd8.WithCancel(ctx) +func (c *client_DelegatedRouting) FindProviders(ctx pd7.Context, req *FindProvidersRequest) ([]*FindProvidersResponse, error) { + ctx, cancel := pd7.WithCancel(ctx) defer cancel() ch, err := c.FindProviders_Async(ctx, req) if err != nil { @@ -1288,7 +1288,7 @@ func (c *client_DelegatedRouting) FindProviders(ctx pd8.Context, req *FindProvid } } -func (c *client_DelegatedRouting) FindProviders_Async(ctx pd8.Context, req *FindProvidersRequest) (<-chan DelegatedRouting_FindProviders_AsyncResult, error) { +func (c *client_DelegatedRouting) FindProviders_Async(ctx pd7.Context, req *FindProvidersRequest) (<-chan DelegatedRouting_FindProviders_AsyncResult, error) { // check if we have memoized that this method is not supported by the server c.ulk.Lock() notSupported := c.unsupported["FindProviders"] @@ -1301,14 +1301,14 @@ func (c *client_DelegatedRouting) FindProviders_Async(ctx pd8.Context, req *Find FindProviders: req, } - buf, err := pd5.Encode(envelope, pd9.Encode) + buf, err := pd11.Encode(envelope, pd8.Encode) if err != nil { - return nil, pd3.Errorf("unexpected serialization error (%v)", err) + return nil, pd2.Errorf("serializing DAG-JSON request: %w", err) } // encode request in URL u := *c.endpoint - httpReq, err := pd10.NewRequestWithContext(ctx, "POST", u.String(), pd12.NewReader(buf)) + httpReq, err := pd4.NewRequestWithContext(ctx, "POST", u.String(), pd6.NewReader(buf)) if err != nil { return nil, err } @@ -1320,7 +1320,7 @@ func (c *client_DelegatedRouting) FindProviders_Async(ctx pd8.Context, req *Find resp, err := c.httpClient.Do(httpReq) if err != nil { - return nil, pd3.Errorf("sending HTTP request: %w", err) + return nil, pd2.Errorf("sending HTTP request: %w", err) } // HTTP codes 400 and 404 correspond to unrecognized method or request schema @@ -1338,12 +1338,12 @@ func (c *client_DelegatedRouting) FindProviders_Async(ctx pd8.Context, req *Find resp.Body.Close() if resp.Header != nil { if errValues, ok := resp.Header["Error"]; ok && len(errValues) == 1 { - err = pd13.ErrService{Cause: pd3.Errorf("%s", errValues[0])} + err = pd13.ErrService{Cause: pd2.Errorf("%s", errValues[0])} } else { - err = pd3.Errorf("service rejected the call, no cause provided") + err = pd2.Errorf("service rejected the call, no cause provided") } } else { - err = pd3.Errorf("service rejected the call") + err = pd2.Errorf("service rejected the call") } return nil, err } @@ -1353,10 +1353,10 @@ func (c *client_DelegatedRouting) FindProviders_Async(ctx pd8.Context, req *Find return ch, nil } -func process_DelegatedRouting_FindProviders_AsyncResult(ctx pd8.Context, ch chan<- DelegatedRouting_FindProviders_AsyncResult, r pd7.ReadCloser) { +func process_DelegatedRouting_FindProviders_AsyncResult(ctx pd7.Context, ch chan<- DelegatedRouting_FindProviders_AsyncResult, r pd10.ReadCloser) { defer close(ch) defer r.Close() - opt := pd9.DecodeOptions{ + opt := pd8.DecodeOptions{ ParseLinks: true, ParseBytes: true, DontParseBeyondEnd: true, @@ -1364,9 +1364,9 @@ func process_DelegatedRouting_FindProviders_AsyncResult(ctx pd8.Context, ch chan for { var out DelegatedRouting_FindProviders_AsyncResult - n, err := pd5.DecodeStreaming(r, opt.Decode) + n, err := pd11.DecodeStreaming(r, opt.Decode) - if pd6.Is(err, pd7.EOF) || pd6.Is(err, pd7.ErrUnexpectedEOF) || pd6.Is(err, pd8.DeadlineExceeded) || pd6.Is(err, pd8.Canceled) { + if pd9.Is(err, pd10.EOF) || pd9.Is(err, pd10.ErrUnexpectedEOF) || pd9.Is(err, pd7.DeadlineExceeded) || pd9.Is(err, pd7.Canceled) { return } @@ -1375,13 +1375,13 @@ func process_DelegatedRouting_FindProviders_AsyncResult(ctx pd8.Context, ch chan } else { var x [1]byte if k, err := r.Read(x[:]); k != 1 || x[0] != '\n' { - out = DelegatedRouting_FindProviders_AsyncResult{Err: pd13.ErrProto{Cause: pd3.Errorf("missing new line after result: err (%v), read (%d), char (%q)", err, k, string(x[:]))}} // Edelweiss decode error + out = DelegatedRouting_FindProviders_AsyncResult{Err: pd13.ErrProto{Cause: pd2.Errorf("missing new line after result: err (%v), read (%d), char (%q)", err, k, string(x[:]))}} // Edelweiss decode error } else { env := &AnonInductive5{} if err = env.Parse(n); err != nil { out = DelegatedRouting_FindProviders_AsyncResult{Err: pd13.ErrProto{Cause: err}} // schema decode error } else if env.Error != nil { - out = DelegatedRouting_FindProviders_AsyncResult{Err: pd13.ErrService{Cause: pd6.New(string(env.Error.Code))}} // service-level error + out = DelegatedRouting_FindProviders_AsyncResult{Err: pd13.ErrService{Cause: pd9.New(string(env.Error.Code))}} // service-level error } else if env.FindProviders != nil { out = DelegatedRouting_FindProviders_AsyncResult{Resp: env.FindProviders} } else { @@ -1398,8 +1398,8 @@ func process_DelegatedRouting_FindProviders_AsyncResult(ctx pd8.Context, ch chan } } -func (c *client_DelegatedRouting) GetIPNS(ctx pd8.Context, req *GetIPNSRequest) ([]*GetIPNSResponse, error) { - ctx, cancel := pd8.WithCancel(ctx) +func (c *client_DelegatedRouting) GetIPNS(ctx pd7.Context, req *GetIPNSRequest) ([]*GetIPNSResponse, error) { + ctx, cancel := pd7.WithCancel(ctx) defer cancel() ch, err := c.GetIPNS_Async(ctx, req) if err != nil { @@ -1427,7 +1427,7 @@ func (c *client_DelegatedRouting) GetIPNS(ctx pd8.Context, req *GetIPNSRequest) } } -func (c *client_DelegatedRouting) GetIPNS_Async(ctx pd8.Context, req *GetIPNSRequest) (<-chan DelegatedRouting_GetIPNS_AsyncResult, error) { +func (c *client_DelegatedRouting) GetIPNS_Async(ctx pd7.Context, req *GetIPNSRequest) (<-chan DelegatedRouting_GetIPNS_AsyncResult, error) { // check if we have memoized that this method is not supported by the server c.ulk.Lock() notSupported := c.unsupported["GetIPNS"] @@ -1440,14 +1440,14 @@ func (c *client_DelegatedRouting) GetIPNS_Async(ctx pd8.Context, req *GetIPNSReq GetIPNS: req, } - buf, err := pd5.Encode(envelope, pd9.Encode) + buf, err := pd11.Encode(envelope, pd8.Encode) if err != nil { - return nil, pd3.Errorf("unexpected serialization error (%v)", err) + return nil, pd2.Errorf("serializing DAG-JSON request: %w", err) } // encode request in URL u := *c.endpoint - httpReq, err := pd10.NewRequestWithContext(ctx, "POST", u.String(), pd12.NewReader(buf)) + httpReq, err := pd4.NewRequestWithContext(ctx, "POST", u.String(), pd6.NewReader(buf)) if err != nil { return nil, err } @@ -1459,7 +1459,7 @@ func (c *client_DelegatedRouting) GetIPNS_Async(ctx pd8.Context, req *GetIPNSReq resp, err := c.httpClient.Do(httpReq) if err != nil { - return nil, pd3.Errorf("sending HTTP request: %w", err) + return nil, pd2.Errorf("sending HTTP request: %w", err) } // HTTP codes 400 and 404 correspond to unrecognized method or request schema @@ -1477,12 +1477,12 @@ func (c *client_DelegatedRouting) GetIPNS_Async(ctx pd8.Context, req *GetIPNSReq resp.Body.Close() if resp.Header != nil { if errValues, ok := resp.Header["Error"]; ok && len(errValues) == 1 { - err = pd13.ErrService{Cause: pd3.Errorf("%s", errValues[0])} + err = pd13.ErrService{Cause: pd2.Errorf("%s", errValues[0])} } else { - err = pd3.Errorf("service rejected the call, no cause provided") + err = pd2.Errorf("service rejected the call, no cause provided") } } else { - err = pd3.Errorf("service rejected the call") + err = pd2.Errorf("service rejected the call") } return nil, err } @@ -1492,10 +1492,10 @@ func (c *client_DelegatedRouting) GetIPNS_Async(ctx pd8.Context, req *GetIPNSReq return ch, nil } -func process_DelegatedRouting_GetIPNS_AsyncResult(ctx pd8.Context, ch chan<- DelegatedRouting_GetIPNS_AsyncResult, r pd7.ReadCloser) { +func process_DelegatedRouting_GetIPNS_AsyncResult(ctx pd7.Context, ch chan<- DelegatedRouting_GetIPNS_AsyncResult, r pd10.ReadCloser) { defer close(ch) defer r.Close() - opt := pd9.DecodeOptions{ + opt := pd8.DecodeOptions{ ParseLinks: true, ParseBytes: true, DontParseBeyondEnd: true, @@ -1503,9 +1503,9 @@ func process_DelegatedRouting_GetIPNS_AsyncResult(ctx pd8.Context, ch chan<- Del for { var out DelegatedRouting_GetIPNS_AsyncResult - n, err := pd5.DecodeStreaming(r, opt.Decode) + n, err := pd11.DecodeStreaming(r, opt.Decode) - if pd6.Is(err, pd7.EOF) || pd6.Is(err, pd7.ErrUnexpectedEOF) || pd6.Is(err, pd8.DeadlineExceeded) || pd6.Is(err, pd8.Canceled) { + if pd9.Is(err, pd10.EOF) || pd9.Is(err, pd10.ErrUnexpectedEOF) || pd9.Is(err, pd7.DeadlineExceeded) || pd9.Is(err, pd7.Canceled) { return } @@ -1514,13 +1514,13 @@ func process_DelegatedRouting_GetIPNS_AsyncResult(ctx pd8.Context, ch chan<- Del } else { var x [1]byte if k, err := r.Read(x[:]); k != 1 || x[0] != '\n' { - out = DelegatedRouting_GetIPNS_AsyncResult{Err: pd13.ErrProto{Cause: pd3.Errorf("missing new line after result: err (%v), read (%d), char (%q)", err, k, string(x[:]))}} // Edelweiss decode error + out = DelegatedRouting_GetIPNS_AsyncResult{Err: pd13.ErrProto{Cause: pd2.Errorf("missing new line after result: err (%v), read (%d), char (%q)", err, k, string(x[:]))}} // Edelweiss decode error } else { env := &AnonInductive5{} if err = env.Parse(n); err != nil { out = DelegatedRouting_GetIPNS_AsyncResult{Err: pd13.ErrProto{Cause: err}} // schema decode error } else if env.Error != nil { - out = DelegatedRouting_GetIPNS_AsyncResult{Err: pd13.ErrService{Cause: pd6.New(string(env.Error.Code))}} // service-level error + out = DelegatedRouting_GetIPNS_AsyncResult{Err: pd13.ErrService{Cause: pd9.New(string(env.Error.Code))}} // service-level error } else if env.GetIPNS != nil { out = DelegatedRouting_GetIPNS_AsyncResult{Resp: env.GetIPNS} } else { @@ -1537,8 +1537,8 @@ func process_DelegatedRouting_GetIPNS_AsyncResult(ctx pd8.Context, ch chan<- Del } } -func (c *client_DelegatedRouting) PutIPNS(ctx pd8.Context, req *PutIPNSRequest) ([]*PutIPNSResponse, error) { - ctx, cancel := pd8.WithCancel(ctx) +func (c *client_DelegatedRouting) PutIPNS(ctx pd7.Context, req *PutIPNSRequest) ([]*PutIPNSResponse, error) { + ctx, cancel := pd7.WithCancel(ctx) defer cancel() ch, err := c.PutIPNS_Async(ctx, req) if err != nil { @@ -1566,7 +1566,7 @@ func (c *client_DelegatedRouting) PutIPNS(ctx pd8.Context, req *PutIPNSRequest) } } -func (c *client_DelegatedRouting) PutIPNS_Async(ctx pd8.Context, req *PutIPNSRequest) (<-chan DelegatedRouting_PutIPNS_AsyncResult, error) { +func (c *client_DelegatedRouting) PutIPNS_Async(ctx pd7.Context, req *PutIPNSRequest) (<-chan DelegatedRouting_PutIPNS_AsyncResult, error) { // check if we have memoized that this method is not supported by the server c.ulk.Lock() notSupported := c.unsupported["PutIPNS"] @@ -1579,14 +1579,14 @@ func (c *client_DelegatedRouting) PutIPNS_Async(ctx pd8.Context, req *PutIPNSReq PutIPNS: req, } - buf, err := pd5.Encode(envelope, pd9.Encode) + buf, err := pd11.Encode(envelope, pd8.Encode) if err != nil { - return nil, pd3.Errorf("unexpected serialization error (%v)", err) + return nil, pd2.Errorf("serializing DAG-JSON request: %w", err) } // encode request in URL u := *c.endpoint - httpReq, err := pd10.NewRequestWithContext(ctx, "POST", u.String(), pd12.NewReader(buf)) + httpReq, err := pd4.NewRequestWithContext(ctx, "POST", u.String(), pd6.NewReader(buf)) if err != nil { return nil, err } @@ -1598,7 +1598,7 @@ func (c *client_DelegatedRouting) PutIPNS_Async(ctx pd8.Context, req *PutIPNSReq resp, err := c.httpClient.Do(httpReq) if err != nil { - return nil, pd3.Errorf("sending HTTP request: %w", err) + return nil, pd2.Errorf("sending HTTP request: %w", err) } // HTTP codes 400 and 404 correspond to unrecognized method or request schema @@ -1616,12 +1616,12 @@ func (c *client_DelegatedRouting) PutIPNS_Async(ctx pd8.Context, req *PutIPNSReq resp.Body.Close() if resp.Header != nil { if errValues, ok := resp.Header["Error"]; ok && len(errValues) == 1 { - err = pd13.ErrService{Cause: pd3.Errorf("%s", errValues[0])} + err = pd13.ErrService{Cause: pd2.Errorf("%s", errValues[0])} } else { - err = pd3.Errorf("service rejected the call, no cause provided") + err = pd2.Errorf("service rejected the call, no cause provided") } } else { - err = pd3.Errorf("service rejected the call") + err = pd2.Errorf("service rejected the call") } return nil, err } @@ -1631,10 +1631,10 @@ func (c *client_DelegatedRouting) PutIPNS_Async(ctx pd8.Context, req *PutIPNSReq return ch, nil } -func process_DelegatedRouting_PutIPNS_AsyncResult(ctx pd8.Context, ch chan<- DelegatedRouting_PutIPNS_AsyncResult, r pd7.ReadCloser) { +func process_DelegatedRouting_PutIPNS_AsyncResult(ctx pd7.Context, ch chan<- DelegatedRouting_PutIPNS_AsyncResult, r pd10.ReadCloser) { defer close(ch) defer r.Close() - opt := pd9.DecodeOptions{ + opt := pd8.DecodeOptions{ ParseLinks: true, ParseBytes: true, DontParseBeyondEnd: true, @@ -1642,9 +1642,9 @@ func process_DelegatedRouting_PutIPNS_AsyncResult(ctx pd8.Context, ch chan<- Del for { var out DelegatedRouting_PutIPNS_AsyncResult - n, err := pd5.DecodeStreaming(r, opt.Decode) + n, err := pd11.DecodeStreaming(r, opt.Decode) - if pd6.Is(err, pd7.EOF) || pd6.Is(err, pd7.ErrUnexpectedEOF) || pd6.Is(err, pd8.DeadlineExceeded) || pd6.Is(err, pd8.Canceled) { + if pd9.Is(err, pd10.EOF) || pd9.Is(err, pd10.ErrUnexpectedEOF) || pd9.Is(err, pd7.DeadlineExceeded) || pd9.Is(err, pd7.Canceled) { return } @@ -1653,13 +1653,13 @@ func process_DelegatedRouting_PutIPNS_AsyncResult(ctx pd8.Context, ch chan<- Del } else { var x [1]byte if k, err := r.Read(x[:]); k != 1 || x[0] != '\n' { - out = DelegatedRouting_PutIPNS_AsyncResult{Err: pd13.ErrProto{Cause: pd3.Errorf("missing new line after result: err (%v), read (%d), char (%q)", err, k, string(x[:]))}} // Edelweiss decode error + out = DelegatedRouting_PutIPNS_AsyncResult{Err: pd13.ErrProto{Cause: pd2.Errorf("missing new line after result: err (%v), read (%d), char (%q)", err, k, string(x[:]))}} // Edelweiss decode error } else { env := &AnonInductive5{} if err = env.Parse(n); err != nil { out = DelegatedRouting_PutIPNS_AsyncResult{Err: pd13.ErrProto{Cause: err}} // schema decode error } else if env.Error != nil { - out = DelegatedRouting_PutIPNS_AsyncResult{Err: pd13.ErrService{Cause: pd6.New(string(env.Error.Code))}} // service-level error + out = DelegatedRouting_PutIPNS_AsyncResult{Err: pd13.ErrService{Cause: pd9.New(string(env.Error.Code))}} // service-level error } else if env.PutIPNS != nil { out = DelegatedRouting_PutIPNS_AsyncResult{Resp: env.PutIPNS} } else { @@ -1676,8 +1676,8 @@ func process_DelegatedRouting_PutIPNS_AsyncResult(ctx pd8.Context, ch chan<- Del } } -func (c *client_DelegatedRouting) Provide(ctx pd8.Context, req *ProvideRequest) ([]*ProvideResponse, error) { - ctx, cancel := pd8.WithCancel(ctx) +func (c *client_DelegatedRouting) Provide(ctx pd7.Context, req *ProvideRequest) ([]*ProvideResponse, error) { + ctx, cancel := pd7.WithCancel(ctx) defer cancel() ch, err := c.Provide_Async(ctx, req) if err != nil { @@ -1705,7 +1705,7 @@ func (c *client_DelegatedRouting) Provide(ctx pd8.Context, req *ProvideRequest) } } -func (c *client_DelegatedRouting) Provide_Async(ctx pd8.Context, req *ProvideRequest) (<-chan DelegatedRouting_Provide_AsyncResult, error) { +func (c *client_DelegatedRouting) Provide_Async(ctx pd7.Context, req *ProvideRequest) (<-chan DelegatedRouting_Provide_AsyncResult, error) { // check if we have memoized that this method is not supported by the server c.ulk.Lock() notSupported := c.unsupported["Provide"] @@ -1718,14 +1718,14 @@ func (c *client_DelegatedRouting) Provide_Async(ctx pd8.Context, req *ProvideReq Provide: req, } - buf, err := pd5.Encode(envelope, pd9.Encode) + buf, err := pd11.Encode(envelope, pd8.Encode) if err != nil { - return nil, pd3.Errorf("unexpected serialization error (%v)", err) + return nil, pd2.Errorf("serializing DAG-JSON request: %w", err) } // encode request in URL u := *c.endpoint - httpReq, err := pd10.NewRequestWithContext(ctx, "POST", u.String(), pd12.NewReader(buf)) + httpReq, err := pd4.NewRequestWithContext(ctx, "POST", u.String(), pd6.NewReader(buf)) if err != nil { return nil, err } @@ -1737,7 +1737,7 @@ func (c *client_DelegatedRouting) Provide_Async(ctx pd8.Context, req *ProvideReq resp, err := c.httpClient.Do(httpReq) if err != nil { - return nil, pd3.Errorf("sending HTTP request: %w", err) + return nil, pd2.Errorf("sending HTTP request: %w", err) } // HTTP codes 400 and 404 correspond to unrecognized method or request schema @@ -1755,12 +1755,12 @@ func (c *client_DelegatedRouting) Provide_Async(ctx pd8.Context, req *ProvideReq resp.Body.Close() if resp.Header != nil { if errValues, ok := resp.Header["Error"]; ok && len(errValues) == 1 { - err = pd13.ErrService{Cause: pd3.Errorf("%s", errValues[0])} + err = pd13.ErrService{Cause: pd2.Errorf("%s", errValues[0])} } else { - err = pd3.Errorf("service rejected the call, no cause provided") + err = pd2.Errorf("service rejected the call, no cause provided") } } else { - err = pd3.Errorf("service rejected the call") + err = pd2.Errorf("service rejected the call") } return nil, err } @@ -1770,10 +1770,10 @@ func (c *client_DelegatedRouting) Provide_Async(ctx pd8.Context, req *ProvideReq return ch, nil } -func process_DelegatedRouting_Provide_AsyncResult(ctx pd8.Context, ch chan<- DelegatedRouting_Provide_AsyncResult, r pd7.ReadCloser) { +func process_DelegatedRouting_Provide_AsyncResult(ctx pd7.Context, ch chan<- DelegatedRouting_Provide_AsyncResult, r pd10.ReadCloser) { defer close(ch) defer r.Close() - opt := pd9.DecodeOptions{ + opt := pd8.DecodeOptions{ ParseLinks: true, ParseBytes: true, DontParseBeyondEnd: true, @@ -1781,9 +1781,9 @@ func process_DelegatedRouting_Provide_AsyncResult(ctx pd8.Context, ch chan<- Del for { var out DelegatedRouting_Provide_AsyncResult - n, err := pd5.DecodeStreaming(r, opt.Decode) + n, err := pd11.DecodeStreaming(r, opt.Decode) - if pd6.Is(err, pd7.EOF) || pd6.Is(err, pd7.ErrUnexpectedEOF) || pd6.Is(err, pd8.DeadlineExceeded) || pd6.Is(err, pd8.Canceled) { + if pd9.Is(err, pd10.EOF) || pd9.Is(err, pd10.ErrUnexpectedEOF) || pd9.Is(err, pd7.DeadlineExceeded) || pd9.Is(err, pd7.Canceled) { return } @@ -1792,13 +1792,13 @@ func process_DelegatedRouting_Provide_AsyncResult(ctx pd8.Context, ch chan<- Del } else { var x [1]byte if k, err := r.Read(x[:]); k != 1 || x[0] != '\n' { - out = DelegatedRouting_Provide_AsyncResult{Err: pd13.ErrProto{Cause: pd3.Errorf("missing new line after result: err (%v), read (%d), char (%q)", err, k, string(x[:]))}} // Edelweiss decode error + out = DelegatedRouting_Provide_AsyncResult{Err: pd13.ErrProto{Cause: pd2.Errorf("missing new line after result: err (%v), read (%d), char (%q)", err, k, string(x[:]))}} // Edelweiss decode error } else { env := &AnonInductive5{} if err = env.Parse(n); err != nil { out = DelegatedRouting_Provide_AsyncResult{Err: pd13.ErrProto{Cause: err}} // schema decode error } else if env.Error != nil { - out = DelegatedRouting_Provide_AsyncResult{Err: pd13.ErrService{Cause: pd6.New(string(env.Error.Code))}} // service-level error + out = DelegatedRouting_Provide_AsyncResult{Err: pd13.ErrService{Cause: pd9.New(string(env.Error.Code))}} // service-level error } else if env.Provide != nil { out = DelegatedRouting_Provide_AsyncResult{Resp: env.Provide} } else { @@ -1815,17 +1815,17 @@ func process_DelegatedRouting_Provide_AsyncResult(ctx pd8.Context, ch chan<- Del } } -var logger_server_DelegatedRouting = pd4.Logger("service/server/delegatedrouting") +var logger_server_DelegatedRouting = pd5.Logger("service/server/delegatedrouting") type DelegatedRouting_Server interface { - FindProviders(ctx pd8.Context, req *FindProvidersRequest) (<-chan *DelegatedRouting_FindProviders_AsyncResult, error) - GetIPNS(ctx pd8.Context, req *GetIPNSRequest) (<-chan *DelegatedRouting_GetIPNS_AsyncResult, error) - PutIPNS(ctx pd8.Context, req *PutIPNSRequest) (<-chan *DelegatedRouting_PutIPNS_AsyncResult, error) - Provide(ctx pd8.Context, req *ProvideRequest) (<-chan *DelegatedRouting_Provide_AsyncResult, error) + FindProviders(ctx pd7.Context, req *FindProvidersRequest) (<-chan *DelegatedRouting_FindProviders_AsyncResult, error) + GetIPNS(ctx pd7.Context, req *GetIPNSRequest) (<-chan *DelegatedRouting_GetIPNS_AsyncResult, error) + PutIPNS(ctx pd7.Context, req *PutIPNSRequest) (<-chan *DelegatedRouting_PutIPNS_AsyncResult, error) + Provide(ctx pd7.Context, req *ProvideRequest) (<-chan *DelegatedRouting_Provide_AsyncResult, error) } -func DelegatedRouting_AsyncHandler(s DelegatedRouting_Server) pd10.HandlerFunc { - return func(writer pd10.ResponseWriter, request *pd10.Request) { +func DelegatedRouting_AsyncHandler(s DelegatedRouting_Server) pd4.HandlerFunc { + return func(writer pd4.ResponseWriter, request *pd4.Request) { // parse request msg, err := pd15.ReadAll(request.Body) if err != nil { @@ -1833,7 +1833,7 @@ func DelegatedRouting_AsyncHandler(s DelegatedRouting_Server) pd10.HandlerFunc { writer.WriteHeader(400) return } - n, err := pd5.Decode(msg, pd9.Decode) + n, err := pd11.Decode(msg, pd8.Decode) if err != nil { logger_server_DelegatedRouting.Errorf("received request not decodeable (%v)", err) writer.WriteHeader(400) @@ -1863,7 +1863,7 @@ func DelegatedRouting_AsyncHandler(s DelegatedRouting_Server) pd10.HandlerFunc { } writer.WriteHeader(200) - if f, ok := writer.(pd10.Flusher); ok { + if f, ok := writer.(pd4.Flusher); ok { f.Flush() } @@ -1877,18 +1877,18 @@ func DelegatedRouting_AsyncHandler(s DelegatedRouting_Server) pd10.HandlerFunc { } var env *AnonInductive5 if resp.Err != nil { - env = &AnonInductive5{Error: &DelegatedRouting_Error{Code: pd2.String(resp.Err.Error())}} + env = &AnonInductive5{Error: &DelegatedRouting_Error{Code: pd1.String(resp.Err.Error())}} } else { env = &AnonInductive5{FindProviders: resp.Resp} } - var buf pd12.Buffer - if err = pd5.EncodeStreaming(&buf, env, pd9.Encode); err != nil { + var buf pd6.Buffer + if err = pd11.EncodeStreaming(&buf, env, pd8.Encode); err != nil { logger_server_DelegatedRouting.Errorf("cannot encode response (%v)", err) continue } buf.WriteByte("\n"[0]) writer.Write(buf.Bytes()) - if f, ok := writer.(pd10.Flusher); ok { + if f, ok := writer.(pd4.Flusher); ok { f.Flush() } } @@ -1904,7 +1904,7 @@ func DelegatedRouting_AsyncHandler(s DelegatedRouting_Server) pd10.HandlerFunc { } writer.WriteHeader(200) - if f, ok := writer.(pd10.Flusher); ok { + if f, ok := writer.(pd4.Flusher); ok { f.Flush() } @@ -1918,18 +1918,18 @@ func DelegatedRouting_AsyncHandler(s DelegatedRouting_Server) pd10.HandlerFunc { } var env *AnonInductive5 if resp.Err != nil { - env = &AnonInductive5{Error: &DelegatedRouting_Error{Code: pd2.String(resp.Err.Error())}} + env = &AnonInductive5{Error: &DelegatedRouting_Error{Code: pd1.String(resp.Err.Error())}} } else { env = &AnonInductive5{GetIPNS: resp.Resp} } - var buf pd12.Buffer - if err = pd5.EncodeStreaming(&buf, env, pd9.Encode); err != nil { + var buf pd6.Buffer + if err = pd11.EncodeStreaming(&buf, env, pd8.Encode); err != nil { logger_server_DelegatedRouting.Errorf("cannot encode response (%v)", err) continue } buf.WriteByte("\n"[0]) writer.Write(buf.Bytes()) - if f, ok := writer.(pd10.Flusher); ok { + if f, ok := writer.(pd4.Flusher); ok { f.Flush() } } @@ -1945,7 +1945,7 @@ func DelegatedRouting_AsyncHandler(s DelegatedRouting_Server) pd10.HandlerFunc { } writer.WriteHeader(200) - if f, ok := writer.(pd10.Flusher); ok { + if f, ok := writer.(pd4.Flusher); ok { f.Flush() } @@ -1959,18 +1959,18 @@ func DelegatedRouting_AsyncHandler(s DelegatedRouting_Server) pd10.HandlerFunc { } var env *AnonInductive5 if resp.Err != nil { - env = &AnonInductive5{Error: &DelegatedRouting_Error{Code: pd2.String(resp.Err.Error())}} + env = &AnonInductive5{Error: &DelegatedRouting_Error{Code: pd1.String(resp.Err.Error())}} } else { env = &AnonInductive5{PutIPNS: resp.Resp} } - var buf pd12.Buffer - if err = pd5.EncodeStreaming(&buf, env, pd9.Encode); err != nil { + var buf pd6.Buffer + if err = pd11.EncodeStreaming(&buf, env, pd8.Encode); err != nil { logger_server_DelegatedRouting.Errorf("cannot encode response (%v)", err) continue } buf.WriteByte("\n"[0]) writer.Write(buf.Bytes()) - if f, ok := writer.(pd10.Flusher); ok { + if f, ok := writer.(pd4.Flusher); ok { f.Flush() } } @@ -1986,7 +1986,7 @@ func DelegatedRouting_AsyncHandler(s DelegatedRouting_Server) pd10.HandlerFunc { } writer.WriteHeader(200) - if f, ok := writer.(pd10.Flusher); ok { + if f, ok := writer.(pd4.Flusher); ok { f.Flush() } @@ -2000,18 +2000,18 @@ func DelegatedRouting_AsyncHandler(s DelegatedRouting_Server) pd10.HandlerFunc { } var env *AnonInductive5 if resp.Err != nil { - env = &AnonInductive5{Error: &DelegatedRouting_Error{Code: pd2.String(resp.Err.Error())}} + env = &AnonInductive5{Error: &DelegatedRouting_Error{Code: pd1.String(resp.Err.Error())}} } else { env = &AnonInductive5{Provide: resp.Resp} } - var buf pd12.Buffer - if err = pd5.EncodeStreaming(&buf, env, pd9.Encode); err != nil { + var buf pd6.Buffer + if err = pd11.EncodeStreaming(&buf, env, pd8.Encode); err != nil { logger_server_DelegatedRouting.Errorf("cannot encode response (%v)", err) continue } buf.WriteByte("\n"[0]) writer.Write(buf.Bytes()) - if f, ok := writer.(pd10.Flusher); ok { + if f, ok := writer.(pd4.Flusher); ok { f.Flush() } } @@ -2021,7 +2021,7 @@ func DelegatedRouting_AsyncHandler(s DelegatedRouting_Server) pd10.HandlerFunc { var env *AnonInductive5 env = &AnonInductive5{ Identify: &DelegatedRouting_IdentifyResult{ - Methods: []pd2.String{ + Methods: []pd1.String{ "FindProviders", "GetIPNS", "PutIPNS", @@ -2029,8 +2029,8 @@ func DelegatedRouting_AsyncHandler(s DelegatedRouting_Server) pd10.HandlerFunc { }, }, } - var buf pd12.Buffer - if err = pd5.EncodeStreaming(&buf, env, pd9.Encode); err != nil { + var buf pd6.Buffer + if err = pd11.EncodeStreaming(&buf, env, pd8.Encode); err != nil { logger_server_DelegatedRouting.Errorf("cannot encode identify response (%v)", err) writer.WriteHeader(500) return @@ -2051,16 +2051,16 @@ type FindProvidersRequest struct { Key LinkToAny } -func (x FindProvidersRequest) Node() pd1.Node { +func (x FindProvidersRequest) Node() pd3.Node { return x } -func (x *FindProvidersRequest) Parse(n pd1.Node) error { - if n.Kind() != pd1.Kind_Map { - return pd2.ErrNA +func (x *FindProvidersRequest) Parse(n pd3.Node) error { + if n.Kind() != pd3.Kind_Map { + return pd1.ErrNA } iter := n.MapIterator() - fieldMap := map[string]pd2.ParseFunc{ + fieldMap := map[string]pd1.ParseFunc{ "Key": x.Key.Parse, } for !iter.Done() { @@ -2068,13 +2068,13 @@ func (x *FindProvidersRequest) Parse(n pd1.Node) error { return err } else { if k, err := kn.AsString(); err != nil { - return pd3.Errorf("structure map key is not a string") + return pd2.Errorf("structure map key is not a string") } else { _ = vn switch k { case "Key": if _, notParsed := fieldMap["Key"]; !notParsed { - return pd3.Errorf("field %s already parsed", "Key") + return pd2.Errorf("field %s already parsed", "Key") } if err := x.Key.Parse(vn); err != nil { return err @@ -2086,7 +2086,7 @@ func (x *FindProvidersRequest) Parse(n pd1.Node) error { } } for _, fieldParse := range fieldMap { - if err := fieldParse(pd1.Null); err != nil { + if err := fieldParse(pd3.Null); err != nil { return err } } @@ -2098,74 +2098,74 @@ type FindProvidersRequest_MapIterator struct { s *FindProvidersRequest } -func (x *FindProvidersRequest_MapIterator) Next() (key pd1.Node, value pd1.Node, err error) { +func (x *FindProvidersRequest_MapIterator) Next() (key pd3.Node, value pd3.Node, err error) { x.i++ switch x.i { case 0: - return pd2.String("Key"), x.s.Key.Node(), nil + return pd1.String("Key"), x.s.Key.Node(), nil } - return nil, nil, pd2.ErrNA + return nil, nil, pd1.ErrNA } func (x *FindProvidersRequest_MapIterator) Done() bool { return x.i+1 >= 1 } -func (x FindProvidersRequest) Kind() pd1.Kind { - return pd1.Kind_Map +func (x FindProvidersRequest) Kind() pd3.Kind { + return pd3.Kind_Map } -func (x FindProvidersRequest) LookupByString(key string) (pd1.Node, error) { +func (x FindProvidersRequest) LookupByString(key string) (pd3.Node, error) { switch key { case "Key": return x.Key.Node(), nil } - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x FindProvidersRequest) LookupByNode(key pd1.Node) (pd1.Node, error) { +func (x FindProvidersRequest) LookupByNode(key pd3.Node) (pd3.Node, error) { switch key.Kind() { - case pd1.Kind_String: + case pd3.Kind_String: if s, err := key.AsString(); err != nil { return nil, err } else { return x.LookupByString(s) } - case pd1.Kind_Int: + case pd3.Kind_Int: if i, err := key.AsInt(); err != nil { return nil, err } else { return x.LookupByIndex(i) } } - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x FindProvidersRequest) LookupByIndex(idx int64) (pd1.Node, error) { +func (x FindProvidersRequest) LookupByIndex(idx int64) (pd3.Node, error) { switch idx { case 0: return x.Key.Node(), nil } - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x FindProvidersRequest) LookupBySegment(seg pd1.PathSegment) (pd1.Node, error) { +func (x FindProvidersRequest) LookupBySegment(seg pd3.PathSegment) (pd3.Node, error) { switch seg.String() { case "0", "Key": return x.Key.Node(), nil } - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x FindProvidersRequest) MapIterator() pd1.MapIterator { +func (x FindProvidersRequest) MapIterator() pd3.MapIterator { return &FindProvidersRequest_MapIterator{-1, &x} } -func (x FindProvidersRequest) ListIterator() pd1.ListIterator { +func (x FindProvidersRequest) ListIterator() pd3.ListIterator { return nil } @@ -2182,30 +2182,30 @@ func (x FindProvidersRequest) IsNull() bool { } func (x FindProvidersRequest) AsBool() (bool, error) { - return false, pd2.ErrNA + return false, pd1.ErrNA } func (x FindProvidersRequest) AsInt() (int64, error) { - return 0, pd2.ErrNA + return 0, pd1.ErrNA } func (x FindProvidersRequest) AsFloat() (float64, error) { - return 0, pd2.ErrNA + return 0, pd1.ErrNA } func (x FindProvidersRequest) AsString() (string, error) { - return "", pd2.ErrNA + return "", pd1.ErrNA } func (x FindProvidersRequest) AsBytes() ([]byte, error) { - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x FindProvidersRequest) AsLink() (pd1.Link, error) { - return nil, pd2.ErrNA +func (x FindProvidersRequest) AsLink() (pd3.Link, error) { + return nil, pd1.ErrNA } -func (x FindProvidersRequest) Prototype() pd1.NodePrototype { +func (x FindProvidersRequest) Prototype() pd3.NodePrototype { return nil } @@ -2213,23 +2213,23 @@ func (x FindProvidersRequest) Prototype() pd1.NodePrototype { type ProvidersList []Provider -func (v ProvidersList) Node() pd1.Node { +func (v ProvidersList) Node() pd3.Node { return v } -func (v *ProvidersList) Parse(n pd1.Node) error { - if n.Kind() == pd1.Kind_Null { +func (v *ProvidersList) Parse(n pd3.Node) error { + if n.Kind() == pd3.Kind_Null { *v = nil return nil } - if n.Kind() != pd1.Kind_List { - return pd2.ErrNA + if n.Kind() != pd3.Kind_List { + return pd1.ErrNA } else { *v = make(ProvidersList, n.Length()) iter := n.ListIterator() for !iter.Done() { if i, n, err := iter.Next(); err != nil { - return pd2.ErrNA + return pd1.ErrNA } else if err = (*v)[i].Parse(n); err != nil { return err } @@ -2238,39 +2238,39 @@ func (v *ProvidersList) Parse(n pd1.Node) error { } } -func (ProvidersList) Kind() pd1.Kind { - return pd1.Kind_List +func (ProvidersList) Kind() pd3.Kind { + return pd3.Kind_List } -func (ProvidersList) LookupByString(string) (pd1.Node, error) { - return nil, pd2.ErrNA +func (ProvidersList) LookupByString(string) (pd3.Node, error) { + return nil, pd1.ErrNA } -func (ProvidersList) LookupByNode(key pd1.Node) (pd1.Node, error) { - return nil, pd2.ErrNA +func (ProvidersList) LookupByNode(key pd3.Node) (pd3.Node, error) { + return nil, pd1.ErrNA } -func (v ProvidersList) LookupByIndex(i int64) (pd1.Node, error) { +func (v ProvidersList) LookupByIndex(i int64) (pd3.Node, error) { if i < 0 || i >= v.Length() { - return nil, pd2.ErrBounds + return nil, pd1.ErrBounds } else { return v[i].Node(), nil } } -func (v ProvidersList) LookupBySegment(seg pd1.PathSegment) (pd1.Node, error) { +func (v ProvidersList) LookupBySegment(seg pd3.PathSegment) (pd3.Node, error) { if i, err := seg.Index(); err != nil { - return nil, pd2.ErrNA + return nil, pd1.ErrNA } else { return v.LookupByIndex(i) } } -func (ProvidersList) MapIterator() pd1.MapIterator { +func (ProvidersList) MapIterator() pd3.MapIterator { return nil } -func (v ProvidersList) ListIterator() pd1.ListIterator { +func (v ProvidersList) ListIterator() pd3.ListIterator { return &ProvidersList_ListIterator{v, 0} } @@ -2287,30 +2287,30 @@ func (ProvidersList) IsNull() bool { } func (v ProvidersList) AsBool() (bool, error) { - return false, pd2.ErrNA + return false, pd1.ErrNA } func (ProvidersList) AsInt() (int64, error) { - return 0, pd2.ErrNA + return 0, pd1.ErrNA } func (ProvidersList) AsFloat() (float64, error) { - return 0, pd2.ErrNA + return 0, pd1.ErrNA } func (ProvidersList) AsString() (string, error) { - return "", pd2.ErrNA + return "", pd1.ErrNA } func (ProvidersList) AsBytes() ([]byte, error) { - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (ProvidersList) AsLink() (pd1.Link, error) { - return nil, pd2.ErrNA +func (ProvidersList) AsLink() (pd3.Link, error) { + return nil, pd1.ErrNA } -func (ProvidersList) Prototype() pd1.NodePrototype { +func (ProvidersList) Prototype() pd3.NodePrototype { return nil // not needed } @@ -2319,9 +2319,9 @@ type ProvidersList_ListIterator struct { at int64 } -func (iter *ProvidersList_ListIterator) Next() (int64, pd1.Node, error) { +func (iter *ProvidersList_ListIterator) Next() (int64, pd3.Node, error) { if iter.Done() { - return -1, nil, pd2.ErrBounds + return -1, nil, pd1.ErrBounds } v := iter.list[iter.at] i := int64(iter.at) @@ -2339,16 +2339,16 @@ type FindProvidersResponse struct { Providers ProvidersList } -func (x FindProvidersResponse) Node() pd1.Node { +func (x FindProvidersResponse) Node() pd3.Node { return x } -func (x *FindProvidersResponse) Parse(n pd1.Node) error { - if n.Kind() != pd1.Kind_Map { - return pd2.ErrNA +func (x *FindProvidersResponse) Parse(n pd3.Node) error { + if n.Kind() != pd3.Kind_Map { + return pd1.ErrNA } iter := n.MapIterator() - fieldMap := map[string]pd2.ParseFunc{ + fieldMap := map[string]pd1.ParseFunc{ "Providers": x.Providers.Parse, } for !iter.Done() { @@ -2356,13 +2356,13 @@ func (x *FindProvidersResponse) Parse(n pd1.Node) error { return err } else { if k, err := kn.AsString(); err != nil { - return pd3.Errorf("structure map key is not a string") + return pd2.Errorf("structure map key is not a string") } else { _ = vn switch k { case "Providers": if _, notParsed := fieldMap["Providers"]; !notParsed { - return pd3.Errorf("field %s already parsed", "Providers") + return pd2.Errorf("field %s already parsed", "Providers") } if err := x.Providers.Parse(vn); err != nil { return err @@ -2374,7 +2374,7 @@ func (x *FindProvidersResponse) Parse(n pd1.Node) error { } } for _, fieldParse := range fieldMap { - if err := fieldParse(pd1.Null); err != nil { + if err := fieldParse(pd3.Null); err != nil { return err } } @@ -2386,74 +2386,74 @@ type FindProvidersResponse_MapIterator struct { s *FindProvidersResponse } -func (x *FindProvidersResponse_MapIterator) Next() (key pd1.Node, value pd1.Node, err error) { +func (x *FindProvidersResponse_MapIterator) Next() (key pd3.Node, value pd3.Node, err error) { x.i++ switch x.i { case 0: - return pd2.String("Providers"), x.s.Providers.Node(), nil + return pd1.String("Providers"), x.s.Providers.Node(), nil } - return nil, nil, pd2.ErrNA + return nil, nil, pd1.ErrNA } func (x *FindProvidersResponse_MapIterator) Done() bool { return x.i+1 >= 1 } -func (x FindProvidersResponse) Kind() pd1.Kind { - return pd1.Kind_Map +func (x FindProvidersResponse) Kind() pd3.Kind { + return pd3.Kind_Map } -func (x FindProvidersResponse) LookupByString(key string) (pd1.Node, error) { +func (x FindProvidersResponse) LookupByString(key string) (pd3.Node, error) { switch key { case "Providers": return x.Providers.Node(), nil } - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x FindProvidersResponse) LookupByNode(key pd1.Node) (pd1.Node, error) { +func (x FindProvidersResponse) LookupByNode(key pd3.Node) (pd3.Node, error) { switch key.Kind() { - case pd1.Kind_String: + case pd3.Kind_String: if s, err := key.AsString(); err != nil { return nil, err } else { return x.LookupByString(s) } - case pd1.Kind_Int: + case pd3.Kind_Int: if i, err := key.AsInt(); err != nil { return nil, err } else { return x.LookupByIndex(i) } } - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x FindProvidersResponse) LookupByIndex(idx int64) (pd1.Node, error) { +func (x FindProvidersResponse) LookupByIndex(idx int64) (pd3.Node, error) { switch idx { case 0: return x.Providers.Node(), nil } - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x FindProvidersResponse) LookupBySegment(seg pd1.PathSegment) (pd1.Node, error) { +func (x FindProvidersResponse) LookupBySegment(seg pd3.PathSegment) (pd3.Node, error) { switch seg.String() { case "0", "Providers": return x.Providers.Node(), nil } - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x FindProvidersResponse) MapIterator() pd1.MapIterator { +func (x FindProvidersResponse) MapIterator() pd3.MapIterator { return &FindProvidersResponse_MapIterator{-1, &x} } -func (x FindProvidersResponse) ListIterator() pd1.ListIterator { +func (x FindProvidersResponse) ListIterator() pd3.ListIterator { return nil } @@ -2470,49 +2470,49 @@ func (x FindProvidersResponse) IsNull() bool { } func (x FindProvidersResponse) AsBool() (bool, error) { - return false, pd2.ErrNA + return false, pd1.ErrNA } func (x FindProvidersResponse) AsInt() (int64, error) { - return 0, pd2.ErrNA + return 0, pd1.ErrNA } func (x FindProvidersResponse) AsFloat() (float64, error) { - return 0, pd2.ErrNA + return 0, pd1.ErrNA } func (x FindProvidersResponse) AsString() (string, error) { - return "", pd2.ErrNA + return "", pd1.ErrNA } func (x FindProvidersResponse) AsBytes() ([]byte, error) { - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x FindProvidersResponse) AsLink() (pd1.Link, error) { - return nil, pd2.ErrNA +func (x FindProvidersResponse) AsLink() (pd3.Link, error) { + return nil, pd1.ErrNA } -func (x FindProvidersResponse) Prototype() pd1.NodePrototype { +func (x FindProvidersResponse) Prototype() pd3.NodePrototype { return nil } // -- protocol type GetIPNSRequest -- type GetIPNSRequest struct { - ID pd2.Bytes + ID pd1.Bytes } -func (x GetIPNSRequest) Node() pd1.Node { +func (x GetIPNSRequest) Node() pd3.Node { return x } -func (x *GetIPNSRequest) Parse(n pd1.Node) error { - if n.Kind() != pd1.Kind_Map { - return pd2.ErrNA +func (x *GetIPNSRequest) Parse(n pd3.Node) error { + if n.Kind() != pd3.Kind_Map { + return pd1.ErrNA } iter := n.MapIterator() - fieldMap := map[string]pd2.ParseFunc{ + fieldMap := map[string]pd1.ParseFunc{ "ID": x.ID.Parse, } for !iter.Done() { @@ -2520,13 +2520,13 @@ func (x *GetIPNSRequest) Parse(n pd1.Node) error { return err } else { if k, err := kn.AsString(); err != nil { - return pd3.Errorf("structure map key is not a string") + return pd2.Errorf("structure map key is not a string") } else { _ = vn switch k { case "ID": if _, notParsed := fieldMap["ID"]; !notParsed { - return pd3.Errorf("field %s already parsed", "ID") + return pd2.Errorf("field %s already parsed", "ID") } if err := x.ID.Parse(vn); err != nil { return err @@ -2538,7 +2538,7 @@ func (x *GetIPNSRequest) Parse(n pd1.Node) error { } } for _, fieldParse := range fieldMap { - if err := fieldParse(pd1.Null); err != nil { + if err := fieldParse(pd3.Null); err != nil { return err } } @@ -2550,74 +2550,74 @@ type GetIPNSRequest_MapIterator struct { s *GetIPNSRequest } -func (x *GetIPNSRequest_MapIterator) Next() (key pd1.Node, value pd1.Node, err error) { +func (x *GetIPNSRequest_MapIterator) Next() (key pd3.Node, value pd3.Node, err error) { x.i++ switch x.i { case 0: - return pd2.String("ID"), x.s.ID.Node(), nil + return pd1.String("ID"), x.s.ID.Node(), nil } - return nil, nil, pd2.ErrNA + return nil, nil, pd1.ErrNA } func (x *GetIPNSRequest_MapIterator) Done() bool { return x.i+1 >= 1 } -func (x GetIPNSRequest) Kind() pd1.Kind { - return pd1.Kind_Map +func (x GetIPNSRequest) Kind() pd3.Kind { + return pd3.Kind_Map } -func (x GetIPNSRequest) LookupByString(key string) (pd1.Node, error) { +func (x GetIPNSRequest) LookupByString(key string) (pd3.Node, error) { switch key { case "ID": return x.ID.Node(), nil } - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x GetIPNSRequest) LookupByNode(key pd1.Node) (pd1.Node, error) { +func (x GetIPNSRequest) LookupByNode(key pd3.Node) (pd3.Node, error) { switch key.Kind() { - case pd1.Kind_String: + case pd3.Kind_String: if s, err := key.AsString(); err != nil { return nil, err } else { return x.LookupByString(s) } - case pd1.Kind_Int: + case pd3.Kind_Int: if i, err := key.AsInt(); err != nil { return nil, err } else { return x.LookupByIndex(i) } } - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x GetIPNSRequest) LookupByIndex(idx int64) (pd1.Node, error) { +func (x GetIPNSRequest) LookupByIndex(idx int64) (pd3.Node, error) { switch idx { case 0: return x.ID.Node(), nil } - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x GetIPNSRequest) LookupBySegment(seg pd1.PathSegment) (pd1.Node, error) { +func (x GetIPNSRequest) LookupBySegment(seg pd3.PathSegment) (pd3.Node, error) { switch seg.String() { case "0", "ID": return x.ID.Node(), nil } - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x GetIPNSRequest) MapIterator() pd1.MapIterator { +func (x GetIPNSRequest) MapIterator() pd3.MapIterator { return &GetIPNSRequest_MapIterator{-1, &x} } -func (x GetIPNSRequest) ListIterator() pd1.ListIterator { +func (x GetIPNSRequest) ListIterator() pd3.ListIterator { return nil } @@ -2634,49 +2634,49 @@ func (x GetIPNSRequest) IsNull() bool { } func (x GetIPNSRequest) AsBool() (bool, error) { - return false, pd2.ErrNA + return false, pd1.ErrNA } func (x GetIPNSRequest) AsInt() (int64, error) { - return 0, pd2.ErrNA + return 0, pd1.ErrNA } func (x GetIPNSRequest) AsFloat() (float64, error) { - return 0, pd2.ErrNA + return 0, pd1.ErrNA } func (x GetIPNSRequest) AsString() (string, error) { - return "", pd2.ErrNA + return "", pd1.ErrNA } func (x GetIPNSRequest) AsBytes() ([]byte, error) { - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x GetIPNSRequest) AsLink() (pd1.Link, error) { - return nil, pd2.ErrNA +func (x GetIPNSRequest) AsLink() (pd3.Link, error) { + return nil, pd1.ErrNA } -func (x GetIPNSRequest) Prototype() pd1.NodePrototype { +func (x GetIPNSRequest) Prototype() pd3.NodePrototype { return nil } // -- protocol type GetIPNSResponse -- type GetIPNSResponse struct { - Record pd2.Bytes + Record pd1.Bytes } -func (x GetIPNSResponse) Node() pd1.Node { +func (x GetIPNSResponse) Node() pd3.Node { return x } -func (x *GetIPNSResponse) Parse(n pd1.Node) error { - if n.Kind() != pd1.Kind_Map { - return pd2.ErrNA +func (x *GetIPNSResponse) Parse(n pd3.Node) error { + if n.Kind() != pd3.Kind_Map { + return pd1.ErrNA } iter := n.MapIterator() - fieldMap := map[string]pd2.ParseFunc{ + fieldMap := map[string]pd1.ParseFunc{ "Record": x.Record.Parse, } for !iter.Done() { @@ -2684,13 +2684,13 @@ func (x *GetIPNSResponse) Parse(n pd1.Node) error { return err } else { if k, err := kn.AsString(); err != nil { - return pd3.Errorf("structure map key is not a string") + return pd2.Errorf("structure map key is not a string") } else { _ = vn switch k { case "Record": if _, notParsed := fieldMap["Record"]; !notParsed { - return pd3.Errorf("field %s already parsed", "Record") + return pd2.Errorf("field %s already parsed", "Record") } if err := x.Record.Parse(vn); err != nil { return err @@ -2702,7 +2702,7 @@ func (x *GetIPNSResponse) Parse(n pd1.Node) error { } } for _, fieldParse := range fieldMap { - if err := fieldParse(pd1.Null); err != nil { + if err := fieldParse(pd3.Null); err != nil { return err } } @@ -2714,74 +2714,74 @@ type GetIPNSResponse_MapIterator struct { s *GetIPNSResponse } -func (x *GetIPNSResponse_MapIterator) Next() (key pd1.Node, value pd1.Node, err error) { +func (x *GetIPNSResponse_MapIterator) Next() (key pd3.Node, value pd3.Node, err error) { x.i++ switch x.i { case 0: - return pd2.String("Record"), x.s.Record.Node(), nil + return pd1.String("Record"), x.s.Record.Node(), nil } - return nil, nil, pd2.ErrNA + return nil, nil, pd1.ErrNA } func (x *GetIPNSResponse_MapIterator) Done() bool { return x.i+1 >= 1 } -func (x GetIPNSResponse) Kind() pd1.Kind { - return pd1.Kind_Map +func (x GetIPNSResponse) Kind() pd3.Kind { + return pd3.Kind_Map } -func (x GetIPNSResponse) LookupByString(key string) (pd1.Node, error) { +func (x GetIPNSResponse) LookupByString(key string) (pd3.Node, error) { switch key { case "Record": return x.Record.Node(), nil } - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x GetIPNSResponse) LookupByNode(key pd1.Node) (pd1.Node, error) { +func (x GetIPNSResponse) LookupByNode(key pd3.Node) (pd3.Node, error) { switch key.Kind() { - case pd1.Kind_String: + case pd3.Kind_String: if s, err := key.AsString(); err != nil { return nil, err } else { return x.LookupByString(s) } - case pd1.Kind_Int: + case pd3.Kind_Int: if i, err := key.AsInt(); err != nil { return nil, err } else { return x.LookupByIndex(i) } } - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x GetIPNSResponse) LookupByIndex(idx int64) (pd1.Node, error) { +func (x GetIPNSResponse) LookupByIndex(idx int64) (pd3.Node, error) { switch idx { case 0: return x.Record.Node(), nil } - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x GetIPNSResponse) LookupBySegment(seg pd1.PathSegment) (pd1.Node, error) { +func (x GetIPNSResponse) LookupBySegment(seg pd3.PathSegment) (pd3.Node, error) { switch seg.String() { case "0", "Record": return x.Record.Node(), nil } - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x GetIPNSResponse) MapIterator() pd1.MapIterator { +func (x GetIPNSResponse) MapIterator() pd3.MapIterator { return &GetIPNSResponse_MapIterator{-1, &x} } -func (x GetIPNSResponse) ListIterator() pd1.ListIterator { +func (x GetIPNSResponse) ListIterator() pd3.ListIterator { return nil } @@ -2798,50 +2798,50 @@ func (x GetIPNSResponse) IsNull() bool { } func (x GetIPNSResponse) AsBool() (bool, error) { - return false, pd2.ErrNA + return false, pd1.ErrNA } func (x GetIPNSResponse) AsInt() (int64, error) { - return 0, pd2.ErrNA + return 0, pd1.ErrNA } func (x GetIPNSResponse) AsFloat() (float64, error) { - return 0, pd2.ErrNA + return 0, pd1.ErrNA } func (x GetIPNSResponse) AsString() (string, error) { - return "", pd2.ErrNA + return "", pd1.ErrNA } func (x GetIPNSResponse) AsBytes() ([]byte, error) { - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x GetIPNSResponse) AsLink() (pd1.Link, error) { - return nil, pd2.ErrNA +func (x GetIPNSResponse) AsLink() (pd3.Link, error) { + return nil, pd1.ErrNA } -func (x GetIPNSResponse) Prototype() pd1.NodePrototype { +func (x GetIPNSResponse) Prototype() pd3.NodePrototype { return nil } // -- protocol type PutIPNSRequest -- type PutIPNSRequest struct { - ID pd2.Bytes - Record pd2.Bytes + ID pd1.Bytes + Record pd1.Bytes } -func (x PutIPNSRequest) Node() pd1.Node { +func (x PutIPNSRequest) Node() pd3.Node { return x } -func (x *PutIPNSRequest) Parse(n pd1.Node) error { - if n.Kind() != pd1.Kind_Map { - return pd2.ErrNA +func (x *PutIPNSRequest) Parse(n pd3.Node) error { + if n.Kind() != pd3.Kind_Map { + return pd1.ErrNA } iter := n.MapIterator() - fieldMap := map[string]pd2.ParseFunc{ + fieldMap := map[string]pd1.ParseFunc{ "ID": x.ID.Parse, "Record": x.Record.Parse, } @@ -2850,13 +2850,13 @@ func (x *PutIPNSRequest) Parse(n pd1.Node) error { return err } else { if k, err := kn.AsString(); err != nil { - return pd3.Errorf("structure map key is not a string") + return pd2.Errorf("structure map key is not a string") } else { _ = vn switch k { case "ID": if _, notParsed := fieldMap["ID"]; !notParsed { - return pd3.Errorf("field %s already parsed", "ID") + return pd2.Errorf("field %s already parsed", "ID") } if err := x.ID.Parse(vn); err != nil { return err @@ -2864,7 +2864,7 @@ func (x *PutIPNSRequest) Parse(n pd1.Node) error { delete(fieldMap, "ID") case "Record": if _, notParsed := fieldMap["Record"]; !notParsed { - return pd3.Errorf("field %s already parsed", "Record") + return pd2.Errorf("field %s already parsed", "Record") } if err := x.Record.Parse(vn); err != nil { return err @@ -2876,7 +2876,7 @@ func (x *PutIPNSRequest) Parse(n pd1.Node) error { } } for _, fieldParse := range fieldMap { - if err := fieldParse(pd1.Null); err != nil { + if err := fieldParse(pd3.Null); err != nil { return err } } @@ -2888,27 +2888,27 @@ type PutIPNSRequest_MapIterator struct { s *PutIPNSRequest } -func (x *PutIPNSRequest_MapIterator) Next() (key pd1.Node, value pd1.Node, err error) { +func (x *PutIPNSRequest_MapIterator) Next() (key pd3.Node, value pd3.Node, err error) { x.i++ switch x.i { case 0: - return pd2.String("ID"), x.s.ID.Node(), nil + return pd1.String("ID"), x.s.ID.Node(), nil case 1: - return pd2.String("Record"), x.s.Record.Node(), nil + return pd1.String("Record"), x.s.Record.Node(), nil } - return nil, nil, pd2.ErrNA + return nil, nil, pd1.ErrNA } func (x *PutIPNSRequest_MapIterator) Done() bool { return x.i+1 >= 2 } -func (x PutIPNSRequest) Kind() pd1.Kind { - return pd1.Kind_Map +func (x PutIPNSRequest) Kind() pd3.Kind { + return pd3.Kind_Map } -func (x PutIPNSRequest) LookupByString(key string) (pd1.Node, error) { +func (x PutIPNSRequest) LookupByString(key string) (pd3.Node, error) { switch key { case "ID": return x.ID.Node(), nil @@ -2916,28 +2916,28 @@ func (x PutIPNSRequest) LookupByString(key string) (pd1.Node, error) { return x.Record.Node(), nil } - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x PutIPNSRequest) LookupByNode(key pd1.Node) (pd1.Node, error) { +func (x PutIPNSRequest) LookupByNode(key pd3.Node) (pd3.Node, error) { switch key.Kind() { - case pd1.Kind_String: + case pd3.Kind_String: if s, err := key.AsString(); err != nil { return nil, err } else { return x.LookupByString(s) } - case pd1.Kind_Int: + case pd3.Kind_Int: if i, err := key.AsInt(); err != nil { return nil, err } else { return x.LookupByIndex(i) } } - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x PutIPNSRequest) LookupByIndex(idx int64) (pd1.Node, error) { +func (x PutIPNSRequest) LookupByIndex(idx int64) (pd3.Node, error) { switch idx { case 0: return x.ID.Node(), nil @@ -2945,10 +2945,10 @@ func (x PutIPNSRequest) LookupByIndex(idx int64) (pd1.Node, error) { return x.Record.Node(), nil } - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x PutIPNSRequest) LookupBySegment(seg pd1.PathSegment) (pd1.Node, error) { +func (x PutIPNSRequest) LookupBySegment(seg pd3.PathSegment) (pd3.Node, error) { switch seg.String() { case "0", "ID": return x.ID.Node(), nil @@ -2956,14 +2956,14 @@ func (x PutIPNSRequest) LookupBySegment(seg pd1.PathSegment) (pd1.Node, error) { return x.Record.Node(), nil } - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x PutIPNSRequest) MapIterator() pd1.MapIterator { +func (x PutIPNSRequest) MapIterator() pd3.MapIterator { return &PutIPNSRequest_MapIterator{-1, &x} } -func (x PutIPNSRequest) ListIterator() pd1.ListIterator { +func (x PutIPNSRequest) ListIterator() pd3.ListIterator { return nil } @@ -2980,30 +2980,30 @@ func (x PutIPNSRequest) IsNull() bool { } func (x PutIPNSRequest) AsBool() (bool, error) { - return false, pd2.ErrNA + return false, pd1.ErrNA } func (x PutIPNSRequest) AsInt() (int64, error) { - return 0, pd2.ErrNA + return 0, pd1.ErrNA } func (x PutIPNSRequest) AsFloat() (float64, error) { - return 0, pd2.ErrNA + return 0, pd1.ErrNA } func (x PutIPNSRequest) AsString() (string, error) { - return "", pd2.ErrNA + return "", pd1.ErrNA } func (x PutIPNSRequest) AsBytes() ([]byte, error) { - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x PutIPNSRequest) AsLink() (pd1.Link, error) { - return nil, pd2.ErrNA +func (x PutIPNSRequest) AsLink() (pd3.Link, error) { + return nil, pd1.ErrNA } -func (x PutIPNSRequest) Prototype() pd1.NodePrototype { +func (x PutIPNSRequest) Prototype() pd3.NodePrototype { return nil } @@ -3012,22 +3012,22 @@ func (x PutIPNSRequest) Prototype() pd1.NodePrototype { type PutIPNSResponse struct { } -func (x PutIPNSResponse) Node() pd1.Node { +func (x PutIPNSResponse) Node() pd3.Node { return x } -func (x *PutIPNSResponse) Parse(n pd1.Node) error { - if n.Kind() != pd1.Kind_Map { - return pd2.ErrNA +func (x *PutIPNSResponse) Parse(n pd3.Node) error { + if n.Kind() != pd3.Kind_Map { + return pd1.ErrNA } iter := n.MapIterator() - fieldMap := map[string]pd2.ParseFunc{} + fieldMap := map[string]pd1.ParseFunc{} for !iter.Done() { if kn, vn, err := iter.Next(); err != nil { return err } else { if k, err := kn.AsString(); err != nil { - return pd3.Errorf("structure map key is not a string") + return pd2.Errorf("structure map key is not a string") } else { _ = vn switch k { @@ -3037,7 +3037,7 @@ func (x *PutIPNSResponse) Parse(n pd1.Node) error { } } for _, fieldParse := range fieldMap { - if err := fieldParse(pd1.Null); err != nil { + if err := fieldParse(pd3.Null); err != nil { return err } } @@ -3049,66 +3049,66 @@ type PutIPNSResponse_MapIterator struct { s *PutIPNSResponse } -func (x *PutIPNSResponse_MapIterator) Next() (key pd1.Node, value pd1.Node, err error) { +func (x *PutIPNSResponse_MapIterator) Next() (key pd3.Node, value pd3.Node, err error) { x.i++ switch x.i { } - return nil, nil, pd2.ErrNA + return nil, nil, pd1.ErrNA } func (x *PutIPNSResponse_MapIterator) Done() bool { return x.i+1 >= 0 } -func (x PutIPNSResponse) Kind() pd1.Kind { - return pd1.Kind_Map +func (x PutIPNSResponse) Kind() pd3.Kind { + return pd3.Kind_Map } -func (x PutIPNSResponse) LookupByString(key string) (pd1.Node, error) { +func (x PutIPNSResponse) LookupByString(key string) (pd3.Node, error) { switch key { } - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x PutIPNSResponse) LookupByNode(key pd1.Node) (pd1.Node, error) { +func (x PutIPNSResponse) LookupByNode(key pd3.Node) (pd3.Node, error) { switch key.Kind() { - case pd1.Kind_String: + case pd3.Kind_String: if s, err := key.AsString(); err != nil { return nil, err } else { return x.LookupByString(s) } - case pd1.Kind_Int: + case pd3.Kind_Int: if i, err := key.AsInt(); err != nil { return nil, err } else { return x.LookupByIndex(i) } } - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x PutIPNSResponse) LookupByIndex(idx int64) (pd1.Node, error) { +func (x PutIPNSResponse) LookupByIndex(idx int64) (pd3.Node, error) { switch idx { } - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x PutIPNSResponse) LookupBySegment(seg pd1.PathSegment) (pd1.Node, error) { +func (x PutIPNSResponse) LookupBySegment(seg pd3.PathSegment) (pd3.Node, error) { switch seg.String() { } - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x PutIPNSResponse) MapIterator() pd1.MapIterator { +func (x PutIPNSResponse) MapIterator() pd3.MapIterator { return &PutIPNSResponse_MapIterator{-1, &x} } -func (x PutIPNSResponse) ListIterator() pd1.ListIterator { +func (x PutIPNSResponse) ListIterator() pd3.ListIterator { return nil } @@ -3125,30 +3125,30 @@ func (x PutIPNSResponse) IsNull() bool { } func (x PutIPNSResponse) AsBool() (bool, error) { - return false, pd2.ErrNA + return false, pd1.ErrNA } func (x PutIPNSResponse) AsInt() (int64, error) { - return 0, pd2.ErrNA + return 0, pd1.ErrNA } func (x PutIPNSResponse) AsFloat() (float64, error) { - return 0, pd2.ErrNA + return 0, pd1.ErrNA } func (x PutIPNSResponse) AsString() (string, error) { - return "", pd2.ErrNA + return "", pd1.ErrNA } func (x PutIPNSResponse) AsBytes() ([]byte, error) { - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x PutIPNSResponse) AsLink() (pd1.Link, error) { - return nil, pd2.ErrNA +func (x PutIPNSResponse) AsLink() (pd3.Link, error) { + return nil, pd1.ErrNA } -func (x PutIPNSResponse) Prototype() pd1.NodePrototype { +func (x PutIPNSResponse) Prototype() pd3.NodePrototype { return nil } @@ -3157,21 +3157,21 @@ func (x PutIPNSResponse) Prototype() pd1.NodePrototype { type ProvideRequest struct { Key LinkToAny Provider Provider - Timestamp pd2.Int - AdvisoryTTL pd2.Int - Signature pd2.Bytes + Timestamp pd1.Int + AdvisoryTTL pd1.Int + Signature pd1.Bytes } -func (x ProvideRequest) Node() pd1.Node { +func (x ProvideRequest) Node() pd3.Node { return x } -func (x *ProvideRequest) Parse(n pd1.Node) error { - if n.Kind() != pd1.Kind_Map { - return pd2.ErrNA +func (x *ProvideRequest) Parse(n pd3.Node) error { + if n.Kind() != pd3.Kind_Map { + return pd1.ErrNA } iter := n.MapIterator() - fieldMap := map[string]pd2.ParseFunc{ + fieldMap := map[string]pd1.ParseFunc{ "Key": x.Key.Parse, "Provider": x.Provider.Parse, "Timestamp": x.Timestamp.Parse, @@ -3183,13 +3183,13 @@ func (x *ProvideRequest) Parse(n pd1.Node) error { return err } else { if k, err := kn.AsString(); err != nil { - return pd3.Errorf("structure map key is not a string") + return pd2.Errorf("structure map key is not a string") } else { _ = vn switch k { case "Key": if _, notParsed := fieldMap["Key"]; !notParsed { - return pd3.Errorf("field %s already parsed", "Key") + return pd2.Errorf("field %s already parsed", "Key") } if err := x.Key.Parse(vn); err != nil { return err @@ -3197,7 +3197,7 @@ func (x *ProvideRequest) Parse(n pd1.Node) error { delete(fieldMap, "Key") case "Provider": if _, notParsed := fieldMap["Provider"]; !notParsed { - return pd3.Errorf("field %s already parsed", "Provider") + return pd2.Errorf("field %s already parsed", "Provider") } if err := x.Provider.Parse(vn); err != nil { return err @@ -3205,7 +3205,7 @@ func (x *ProvideRequest) Parse(n pd1.Node) error { delete(fieldMap, "Provider") case "Timestamp": if _, notParsed := fieldMap["Timestamp"]; !notParsed { - return pd3.Errorf("field %s already parsed", "Timestamp") + return pd2.Errorf("field %s already parsed", "Timestamp") } if err := x.Timestamp.Parse(vn); err != nil { return err @@ -3213,7 +3213,7 @@ func (x *ProvideRequest) Parse(n pd1.Node) error { delete(fieldMap, "Timestamp") case "AdvisoryTTL": if _, notParsed := fieldMap["AdvisoryTTL"]; !notParsed { - return pd3.Errorf("field %s already parsed", "AdvisoryTTL") + return pd2.Errorf("field %s already parsed", "AdvisoryTTL") } if err := x.AdvisoryTTL.Parse(vn); err != nil { return err @@ -3221,7 +3221,7 @@ func (x *ProvideRequest) Parse(n pd1.Node) error { delete(fieldMap, "AdvisoryTTL") case "Signature": if _, notParsed := fieldMap["Signature"]; !notParsed { - return pd3.Errorf("field %s already parsed", "Signature") + return pd2.Errorf("field %s already parsed", "Signature") } if err := x.Signature.Parse(vn); err != nil { return err @@ -3233,7 +3233,7 @@ func (x *ProvideRequest) Parse(n pd1.Node) error { } } for _, fieldParse := range fieldMap { - if err := fieldParse(pd1.Null); err != nil { + if err := fieldParse(pd3.Null); err != nil { return err } } @@ -3245,33 +3245,33 @@ type ProvideRequest_MapIterator struct { s *ProvideRequest } -func (x *ProvideRequest_MapIterator) Next() (key pd1.Node, value pd1.Node, err error) { +func (x *ProvideRequest_MapIterator) Next() (key pd3.Node, value pd3.Node, err error) { x.i++ switch x.i { case 0: - return pd2.String("Key"), x.s.Key.Node(), nil + return pd1.String("Key"), x.s.Key.Node(), nil case 1: - return pd2.String("Provider"), x.s.Provider.Node(), nil + return pd1.String("Provider"), x.s.Provider.Node(), nil case 2: - return pd2.String("Timestamp"), x.s.Timestamp.Node(), nil + return pd1.String("Timestamp"), x.s.Timestamp.Node(), nil case 3: - return pd2.String("AdvisoryTTL"), x.s.AdvisoryTTL.Node(), nil + return pd1.String("AdvisoryTTL"), x.s.AdvisoryTTL.Node(), nil case 4: - return pd2.String("Signature"), x.s.Signature.Node(), nil + return pd1.String("Signature"), x.s.Signature.Node(), nil } - return nil, nil, pd2.ErrNA + return nil, nil, pd1.ErrNA } func (x *ProvideRequest_MapIterator) Done() bool { return x.i+1 >= 5 } -func (x ProvideRequest) Kind() pd1.Kind { - return pd1.Kind_Map +func (x ProvideRequest) Kind() pd3.Kind { + return pd3.Kind_Map } -func (x ProvideRequest) LookupByString(key string) (pd1.Node, error) { +func (x ProvideRequest) LookupByString(key string) (pd3.Node, error) { switch key { case "Key": return x.Key.Node(), nil @@ -3285,28 +3285,28 @@ func (x ProvideRequest) LookupByString(key string) (pd1.Node, error) { return x.Signature.Node(), nil } - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x ProvideRequest) LookupByNode(key pd1.Node) (pd1.Node, error) { +func (x ProvideRequest) LookupByNode(key pd3.Node) (pd3.Node, error) { switch key.Kind() { - case pd1.Kind_String: + case pd3.Kind_String: if s, err := key.AsString(); err != nil { return nil, err } else { return x.LookupByString(s) } - case pd1.Kind_Int: + case pd3.Kind_Int: if i, err := key.AsInt(); err != nil { return nil, err } else { return x.LookupByIndex(i) } } - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x ProvideRequest) LookupByIndex(idx int64) (pd1.Node, error) { +func (x ProvideRequest) LookupByIndex(idx int64) (pd3.Node, error) { switch idx { case 0: return x.Key.Node(), nil @@ -3320,10 +3320,10 @@ func (x ProvideRequest) LookupByIndex(idx int64) (pd1.Node, error) { return x.Signature.Node(), nil } - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x ProvideRequest) LookupBySegment(seg pd1.PathSegment) (pd1.Node, error) { +func (x ProvideRequest) LookupBySegment(seg pd3.PathSegment) (pd3.Node, error) { switch seg.String() { case "0", "Key": return x.Key.Node(), nil @@ -3337,14 +3337,14 @@ func (x ProvideRequest) LookupBySegment(seg pd1.PathSegment) (pd1.Node, error) { return x.Signature.Node(), nil } - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x ProvideRequest) MapIterator() pd1.MapIterator { +func (x ProvideRequest) MapIterator() pd3.MapIterator { return &ProvideRequest_MapIterator{-1, &x} } -func (x ProvideRequest) ListIterator() pd1.ListIterator { +func (x ProvideRequest) ListIterator() pd3.ListIterator { return nil } @@ -3361,49 +3361,49 @@ func (x ProvideRequest) IsNull() bool { } func (x ProvideRequest) AsBool() (bool, error) { - return false, pd2.ErrNA + return false, pd1.ErrNA } func (x ProvideRequest) AsInt() (int64, error) { - return 0, pd2.ErrNA + return 0, pd1.ErrNA } func (x ProvideRequest) AsFloat() (float64, error) { - return 0, pd2.ErrNA + return 0, pd1.ErrNA } func (x ProvideRequest) AsString() (string, error) { - return "", pd2.ErrNA + return "", pd1.ErrNA } func (x ProvideRequest) AsBytes() ([]byte, error) { - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x ProvideRequest) AsLink() (pd1.Link, error) { - return nil, pd2.ErrNA +func (x ProvideRequest) AsLink() (pd3.Link, error) { + return nil, pd1.ErrNA } -func (x ProvideRequest) Prototype() pd1.NodePrototype { +func (x ProvideRequest) Prototype() pd3.NodePrototype { return nil } // -- protocol type ProvideResponse -- type ProvideResponse struct { - AdvisoryTTL pd2.Int + AdvisoryTTL pd1.Int } -func (x ProvideResponse) Node() pd1.Node { +func (x ProvideResponse) Node() pd3.Node { return x } -func (x *ProvideResponse) Parse(n pd1.Node) error { - if n.Kind() != pd1.Kind_Map { - return pd2.ErrNA +func (x *ProvideResponse) Parse(n pd3.Node) error { + if n.Kind() != pd3.Kind_Map { + return pd1.ErrNA } iter := n.MapIterator() - fieldMap := map[string]pd2.ParseFunc{ + fieldMap := map[string]pd1.ParseFunc{ "AdvisoryTTL": x.AdvisoryTTL.Parse, } for !iter.Done() { @@ -3411,13 +3411,13 @@ func (x *ProvideResponse) Parse(n pd1.Node) error { return err } else { if k, err := kn.AsString(); err != nil { - return pd3.Errorf("structure map key is not a string") + return pd2.Errorf("structure map key is not a string") } else { _ = vn switch k { case "AdvisoryTTL": if _, notParsed := fieldMap["AdvisoryTTL"]; !notParsed { - return pd3.Errorf("field %s already parsed", "AdvisoryTTL") + return pd2.Errorf("field %s already parsed", "AdvisoryTTL") } if err := x.AdvisoryTTL.Parse(vn); err != nil { return err @@ -3429,7 +3429,7 @@ func (x *ProvideResponse) Parse(n pd1.Node) error { } } for _, fieldParse := range fieldMap { - if err := fieldParse(pd1.Null); err != nil { + if err := fieldParse(pd3.Null); err != nil { return err } } @@ -3441,74 +3441,74 @@ type ProvideResponse_MapIterator struct { s *ProvideResponse } -func (x *ProvideResponse_MapIterator) Next() (key pd1.Node, value pd1.Node, err error) { +func (x *ProvideResponse_MapIterator) Next() (key pd3.Node, value pd3.Node, err error) { x.i++ switch x.i { case 0: - return pd2.String("AdvisoryTTL"), x.s.AdvisoryTTL.Node(), nil + return pd1.String("AdvisoryTTL"), x.s.AdvisoryTTL.Node(), nil } - return nil, nil, pd2.ErrNA + return nil, nil, pd1.ErrNA } func (x *ProvideResponse_MapIterator) Done() bool { return x.i+1 >= 1 } -func (x ProvideResponse) Kind() pd1.Kind { - return pd1.Kind_Map +func (x ProvideResponse) Kind() pd3.Kind { + return pd3.Kind_Map } -func (x ProvideResponse) LookupByString(key string) (pd1.Node, error) { +func (x ProvideResponse) LookupByString(key string) (pd3.Node, error) { switch key { case "AdvisoryTTL": return x.AdvisoryTTL.Node(), nil } - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x ProvideResponse) LookupByNode(key pd1.Node) (pd1.Node, error) { +func (x ProvideResponse) LookupByNode(key pd3.Node) (pd3.Node, error) { switch key.Kind() { - case pd1.Kind_String: + case pd3.Kind_String: if s, err := key.AsString(); err != nil { return nil, err } else { return x.LookupByString(s) } - case pd1.Kind_Int: + case pd3.Kind_Int: if i, err := key.AsInt(); err != nil { return nil, err } else { return x.LookupByIndex(i) } } - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x ProvideResponse) LookupByIndex(idx int64) (pd1.Node, error) { +func (x ProvideResponse) LookupByIndex(idx int64) (pd3.Node, error) { switch idx { case 0: return x.AdvisoryTTL.Node(), nil } - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x ProvideResponse) LookupBySegment(seg pd1.PathSegment) (pd1.Node, error) { +func (x ProvideResponse) LookupBySegment(seg pd3.PathSegment) (pd3.Node, error) { switch seg.String() { case "0", "AdvisoryTTL": return x.AdvisoryTTL.Node(), nil } - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x ProvideResponse) MapIterator() pd1.MapIterator { +func (x ProvideResponse) MapIterator() pd3.MapIterator { return &ProvideResponse_MapIterator{-1, &x} } -func (x ProvideResponse) ListIterator() pd1.ListIterator { +func (x ProvideResponse) ListIterator() pd3.ListIterator { return nil } @@ -3525,46 +3525,46 @@ func (x ProvideResponse) IsNull() bool { } func (x ProvideResponse) AsBool() (bool, error) { - return false, pd2.ErrNA + return false, pd1.ErrNA } func (x ProvideResponse) AsInt() (int64, error) { - return 0, pd2.ErrNA + return 0, pd1.ErrNA } func (x ProvideResponse) AsFloat() (float64, error) { - return 0, pd2.ErrNA + return 0, pd1.ErrNA } func (x ProvideResponse) AsString() (string, error) { - return "", pd2.ErrNA + return "", pd1.ErrNA } func (x ProvideResponse) AsBytes() ([]byte, error) { - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x ProvideResponse) AsLink() (pd1.Link, error) { - return nil, pd2.ErrNA +func (x ProvideResponse) AsLink() (pd3.Link, error) { + return nil, pd1.ErrNA } -func (x ProvideResponse) Prototype() pd1.NodePrototype { +func (x ProvideResponse) Prototype() pd3.NodePrototype { return nil } // -- protocol type LinkToAny -- -type LinkToAny pd17.Cid +type LinkToAny pd16.Cid -func (v *LinkToAny) Parse(n pd1.Node) error { - if n.Kind() != pd1.Kind_Link { - return pd2.ErrNA +func (v *LinkToAny) Parse(n pd3.Node) error { + if n.Kind() != pd3.Kind_Link { + return pd1.ErrNA } else { ipldLink, _ := n.AsLink() // TODO: Is there a more general way to convert ipld.Link interface into a concrete user object? - cidLink, ok := ipldLink.(pd16.Link) + cidLink, ok := ipldLink.(pd17.Link) if !ok { - return pd3.Errorf("only cid links are supported") + return pd2.Errorf("only cid links are supported") } else { *v = LinkToAny(cidLink.Cid) return nil @@ -3572,35 +3572,35 @@ func (v *LinkToAny) Parse(n pd1.Node) error { } } -func (v LinkToAny) Node() pd1.Node { +func (v LinkToAny) Node() pd3.Node { return v } -func (LinkToAny) Kind() pd1.Kind { - return pd1.Kind_Link +func (LinkToAny) Kind() pd3.Kind { + return pd3.Kind_Link } -func (LinkToAny) LookupByString(string) (pd1.Node, error) { - return nil, pd2.ErrNA +func (LinkToAny) LookupByString(string) (pd3.Node, error) { + return nil, pd1.ErrNA } -func (LinkToAny) LookupByNode(key pd1.Node) (pd1.Node, error) { - return nil, pd2.ErrNA +func (LinkToAny) LookupByNode(key pd3.Node) (pd3.Node, error) { + return nil, pd1.ErrNA } -func (LinkToAny) LookupByIndex(idx int64) (pd1.Node, error) { - return nil, pd2.ErrNA +func (LinkToAny) LookupByIndex(idx int64) (pd3.Node, error) { + return nil, pd1.ErrNA } -func (LinkToAny) LookupBySegment(seg pd1.PathSegment) (pd1.Node, error) { - return nil, pd2.ErrNA +func (LinkToAny) LookupBySegment(seg pd3.PathSegment) (pd3.Node, error) { + return nil, pd1.ErrNA } -func (LinkToAny) MapIterator() pd1.MapIterator { +func (LinkToAny) MapIterator() pd3.MapIterator { return nil } -func (LinkToAny) ListIterator() pd1.ListIterator { +func (LinkToAny) ListIterator() pd3.ListIterator { return nil } @@ -3617,30 +3617,30 @@ func (LinkToAny) IsNull() bool { } func (LinkToAny) AsBool() (bool, error) { - return false, pd2.ErrNA + return false, pd1.ErrNA } func (v LinkToAny) AsInt() (int64, error) { - return 0, pd2.ErrNA + return 0, pd1.ErrNA } func (LinkToAny) AsFloat() (float64, error) { - return 0, pd2.ErrNA + return 0, pd1.ErrNA } func (LinkToAny) AsString() (string, error) { - return "", pd2.ErrNA + return "", pd1.ErrNA } func (LinkToAny) AsBytes() ([]byte, error) { - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (v LinkToAny) AsLink() (pd1.Link, error) { - return pd16.Link{Cid: pd17.Cid(v)}, nil +func (v LinkToAny) AsLink() (pd3.Link, error) { + return pd17.Link{Cid: pd16.Cid(v)}, nil } -func (LinkToAny) Prototype() pd1.NodePrototype { +func (LinkToAny) Prototype() pd3.NodePrototype { return nil // not needed } @@ -3651,16 +3651,16 @@ type Provider struct { ProviderProto TransferProtocolList } -func (x Provider) Node() pd1.Node { +func (x Provider) Node() pd3.Node { return x } -func (x *Provider) Parse(n pd1.Node) error { - if n.Kind() != pd1.Kind_Map { - return pd2.ErrNA +func (x *Provider) Parse(n pd3.Node) error { + if n.Kind() != pd3.Kind_Map { + return pd1.ErrNA } iter := n.MapIterator() - fieldMap := map[string]pd2.ParseFunc{ + fieldMap := map[string]pd1.ParseFunc{ "Node": x.ProviderNode.Parse, "Proto": x.ProviderProto.Parse, } @@ -3669,13 +3669,13 @@ func (x *Provider) Parse(n pd1.Node) error { return err } else { if k, err := kn.AsString(); err != nil { - return pd3.Errorf("structure map key is not a string") + return pd2.Errorf("structure map key is not a string") } else { _ = vn switch k { case "Node": if _, notParsed := fieldMap["Node"]; !notParsed { - return pd3.Errorf("field %s already parsed", "Node") + return pd2.Errorf("field %s already parsed", "Node") } if err := x.ProviderNode.Parse(vn); err != nil { return err @@ -3683,7 +3683,7 @@ func (x *Provider) Parse(n pd1.Node) error { delete(fieldMap, "Node") case "Proto": if _, notParsed := fieldMap["Proto"]; !notParsed { - return pd3.Errorf("field %s already parsed", "Proto") + return pd2.Errorf("field %s already parsed", "Proto") } if err := x.ProviderProto.Parse(vn); err != nil { return err @@ -3695,7 +3695,7 @@ func (x *Provider) Parse(n pd1.Node) error { } } for _, fieldParse := range fieldMap { - if err := fieldParse(pd1.Null); err != nil { + if err := fieldParse(pd3.Null); err != nil { return err } } @@ -3707,27 +3707,27 @@ type Provider_MapIterator struct { s *Provider } -func (x *Provider_MapIterator) Next() (key pd1.Node, value pd1.Node, err error) { +func (x *Provider_MapIterator) Next() (key pd3.Node, value pd3.Node, err error) { x.i++ switch x.i { case 0: - return pd2.String("Node"), x.s.ProviderNode.Node(), nil + return pd1.String("Node"), x.s.ProviderNode.Node(), nil case 1: - return pd2.String("Proto"), x.s.ProviderProto.Node(), nil + return pd1.String("Proto"), x.s.ProviderProto.Node(), nil } - return nil, nil, pd2.ErrNA + return nil, nil, pd1.ErrNA } func (x *Provider_MapIterator) Done() bool { return x.i+1 >= 2 } -func (x Provider) Kind() pd1.Kind { - return pd1.Kind_Map +func (x Provider) Kind() pd3.Kind { + return pd3.Kind_Map } -func (x Provider) LookupByString(key string) (pd1.Node, error) { +func (x Provider) LookupByString(key string) (pd3.Node, error) { switch key { case "Node": return x.ProviderNode.Node(), nil @@ -3735,28 +3735,28 @@ func (x Provider) LookupByString(key string) (pd1.Node, error) { return x.ProviderProto.Node(), nil } - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x Provider) LookupByNode(key pd1.Node) (pd1.Node, error) { +func (x Provider) LookupByNode(key pd3.Node) (pd3.Node, error) { switch key.Kind() { - case pd1.Kind_String: + case pd3.Kind_String: if s, err := key.AsString(); err != nil { return nil, err } else { return x.LookupByString(s) } - case pd1.Kind_Int: + case pd3.Kind_Int: if i, err := key.AsInt(); err != nil { return nil, err } else { return x.LookupByIndex(i) } } - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x Provider) LookupByIndex(idx int64) (pd1.Node, error) { +func (x Provider) LookupByIndex(idx int64) (pd3.Node, error) { switch idx { case 0: return x.ProviderNode.Node(), nil @@ -3764,10 +3764,10 @@ func (x Provider) LookupByIndex(idx int64) (pd1.Node, error) { return x.ProviderProto.Node(), nil } - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x Provider) LookupBySegment(seg pd1.PathSegment) (pd1.Node, error) { +func (x Provider) LookupBySegment(seg pd3.PathSegment) (pd3.Node, error) { switch seg.String() { case "0", "Node": return x.ProviderNode.Node(), nil @@ -3775,14 +3775,14 @@ func (x Provider) LookupBySegment(seg pd1.PathSegment) (pd1.Node, error) { return x.ProviderProto.Node(), nil } - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x Provider) MapIterator() pd1.MapIterator { +func (x Provider) MapIterator() pd3.MapIterator { return &Provider_MapIterator{-1, &x} } -func (x Provider) ListIterator() pd1.ListIterator { +func (x Provider) ListIterator() pd3.ListIterator { return nil } @@ -3799,30 +3799,30 @@ func (x Provider) IsNull() bool { } func (x Provider) AsBool() (bool, error) { - return false, pd2.ErrNA + return false, pd1.ErrNA } func (x Provider) AsInt() (int64, error) { - return 0, pd2.ErrNA + return 0, pd1.ErrNA } func (x Provider) AsFloat() (float64, error) { - return 0, pd2.ErrNA + return 0, pd1.ErrNA } func (x Provider) AsString() (string, error) { - return "", pd2.ErrNA + return "", pd1.ErrNA } func (x Provider) AsBytes() ([]byte, error) { - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x Provider) AsLink() (pd1.Link, error) { - return nil, pd2.ErrNA +func (x Provider) AsLink() (pd3.Link, error) { + return nil, pd1.ErrNA } -func (x Provider) Prototype() pd1.NodePrototype { +func (x Provider) Prototype() pd3.NodePrototype { return nil } @@ -3830,23 +3830,23 @@ func (x Provider) Prototype() pd1.NodePrototype { type TransferProtocolList []TransferProtocol -func (v TransferProtocolList) Node() pd1.Node { +func (v TransferProtocolList) Node() pd3.Node { return v } -func (v *TransferProtocolList) Parse(n pd1.Node) error { - if n.Kind() == pd1.Kind_Null { +func (v *TransferProtocolList) Parse(n pd3.Node) error { + if n.Kind() == pd3.Kind_Null { *v = nil return nil } - if n.Kind() != pd1.Kind_List { - return pd2.ErrNA + if n.Kind() != pd3.Kind_List { + return pd1.ErrNA } else { *v = make(TransferProtocolList, n.Length()) iter := n.ListIterator() for !iter.Done() { if i, n, err := iter.Next(); err != nil { - return pd2.ErrNA + return pd1.ErrNA } else if err = (*v)[i].Parse(n); err != nil { return err } @@ -3855,39 +3855,39 @@ func (v *TransferProtocolList) Parse(n pd1.Node) error { } } -func (TransferProtocolList) Kind() pd1.Kind { - return pd1.Kind_List +func (TransferProtocolList) Kind() pd3.Kind { + return pd3.Kind_List } -func (TransferProtocolList) LookupByString(string) (pd1.Node, error) { - return nil, pd2.ErrNA +func (TransferProtocolList) LookupByString(string) (pd3.Node, error) { + return nil, pd1.ErrNA } -func (TransferProtocolList) LookupByNode(key pd1.Node) (pd1.Node, error) { - return nil, pd2.ErrNA +func (TransferProtocolList) LookupByNode(key pd3.Node) (pd3.Node, error) { + return nil, pd1.ErrNA } -func (v TransferProtocolList) LookupByIndex(i int64) (pd1.Node, error) { +func (v TransferProtocolList) LookupByIndex(i int64) (pd3.Node, error) { if i < 0 || i >= v.Length() { - return nil, pd2.ErrBounds + return nil, pd1.ErrBounds } else { return v[i].Node(), nil } } -func (v TransferProtocolList) LookupBySegment(seg pd1.PathSegment) (pd1.Node, error) { +func (v TransferProtocolList) LookupBySegment(seg pd3.PathSegment) (pd3.Node, error) { if i, err := seg.Index(); err != nil { - return nil, pd2.ErrNA + return nil, pd1.ErrNA } else { return v.LookupByIndex(i) } } -func (TransferProtocolList) MapIterator() pd1.MapIterator { +func (TransferProtocolList) MapIterator() pd3.MapIterator { return nil } -func (v TransferProtocolList) ListIterator() pd1.ListIterator { +func (v TransferProtocolList) ListIterator() pd3.ListIterator { return &TransferProtocolList_ListIterator{v, 0} } @@ -3904,30 +3904,30 @@ func (TransferProtocolList) IsNull() bool { } func (v TransferProtocolList) AsBool() (bool, error) { - return false, pd2.ErrNA + return false, pd1.ErrNA } func (TransferProtocolList) AsInt() (int64, error) { - return 0, pd2.ErrNA + return 0, pd1.ErrNA } func (TransferProtocolList) AsFloat() (float64, error) { - return 0, pd2.ErrNA + return 0, pd1.ErrNA } func (TransferProtocolList) AsString() (string, error) { - return "", pd2.ErrNA + return "", pd1.ErrNA } func (TransferProtocolList) AsBytes() ([]byte, error) { - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (TransferProtocolList) AsLink() (pd1.Link, error) { - return nil, pd2.ErrNA +func (TransferProtocolList) AsLink() (pd3.Link, error) { + return nil, pd1.ErrNA } -func (TransferProtocolList) Prototype() pd1.NodePrototype { +func (TransferProtocolList) Prototype() pd3.NodePrototype { return nil // not needed } @@ -3936,9 +3936,9 @@ type TransferProtocolList_ListIterator struct { at int64 } -func (iter *TransferProtocolList_ListIterator) Next() (int64, pd1.Node, error) { +func (iter *TransferProtocolList_ListIterator) Next() (int64, pd3.Node, error) { if iter.Done() { - return -1, nil, pd2.ErrBounds + return -1, nil, pd1.ErrBounds } v := iter.list[iter.at] i := int64(iter.at) @@ -3956,13 +3956,13 @@ type Node struct { Peer *Peer DefaultKey string - DefaultValue *pd2.Any + DefaultValue *pd1.Any } -func (x *Node) Parse(n pd1.Node) error { +func (x *Node) Parse(n pd3.Node) error { *x = Node{} - if n.Kind() != pd1.Kind_Map { - return pd2.ErrNA + if n.Kind() != pd3.Kind_Map { + return pd1.ErrNA } iter := n.MapIterator() kn, vn, err := iter.Next() @@ -3971,7 +3971,7 @@ func (x *Node) Parse(n pd1.Node) error { } k, err := kn.AsString() if err != nil { - return pd3.Errorf("inductive map key is not a string") + return pd2.Errorf("inductive map key is not a string") } switch k { case "peer": @@ -3983,7 +3983,7 @@ func (x *Node) Parse(n pd1.Node) error { return nil default: - var y pd2.Any + var y pd1.Any if err := y.Parse(vn); err != nil { return err } @@ -4000,20 +4000,20 @@ type Node_MapIterator struct { s *Node } -func (x *Node_MapIterator) Next() (key pd1.Node, value pd1.Node, err error) { +func (x *Node_MapIterator) Next() (key pd3.Node, value pd3.Node, err error) { if x.done { - return nil, nil, pd2.ErrNA + return nil, nil, pd1.ErrNA } else { x.done = true switch { case x.s.Peer != nil: - return pd2.String("peer"), x.s.Peer.Node(), nil + return pd1.String("peer"), x.s.Peer.Node(), nil case x.s.DefaultValue != nil: - return pd2.String(x.s.DefaultKey), x.s.DefaultValue.Node(), nil + return pd1.String(x.s.DefaultKey), x.s.DefaultValue.Node(), nil default: - return nil, nil, pd3.Errorf("no inductive cases are set") + return nil, nil, pd2.Errorf("no inductive cases are set") } } } @@ -4022,15 +4022,15 @@ func (x *Node_MapIterator) Done() bool { return x.done } -func (x Node) Node() pd1.Node { +func (x Node) Node() pd3.Node { return x } -func (x Node) Kind() pd1.Kind { - return pd1.Kind_Map +func (x Node) Kind() pd3.Kind { + return pd3.Kind_Map } -func (x Node) LookupByString(key string) (pd1.Node, error) { +func (x Node) LookupByString(key string) (pd3.Node, error) { switch { case x.Peer != nil && key == "peer": return x.Peer.Node(), nil @@ -4039,12 +4039,12 @@ func (x Node) LookupByString(key string) (pd1.Node, error) { return x.DefaultValue.Node(), nil } - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x Node) LookupByNode(key pd1.Node) (pd1.Node, error) { - if key.Kind() != pd1.Kind_String { - return nil, pd2.ErrNA +func (x Node) LookupByNode(key pd3.Node) (pd3.Node, error) { + if key.Kind() != pd3.Kind_String { + return nil, pd1.ErrNA } if s, err := key.AsString(); err != nil { return nil, err @@ -4053,11 +4053,11 @@ func (x Node) LookupByNode(key pd1.Node) (pd1.Node, error) { } } -func (x Node) LookupByIndex(idx int64) (pd1.Node, error) { - return nil, pd2.ErrNA +func (x Node) LookupByIndex(idx int64) (pd3.Node, error) { + return nil, pd1.ErrNA } -func (x Node) LookupBySegment(seg pd1.PathSegment) (pd1.Node, error) { +func (x Node) LookupBySegment(seg pd3.PathSegment) (pd3.Node, error) { switch seg.String() { case "peer": return x.Peer.Node(), nil @@ -4066,14 +4066,14 @@ func (x Node) LookupBySegment(seg pd1.PathSegment) (pd1.Node, error) { return x.DefaultValue.Node(), nil } - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x Node) MapIterator() pd1.MapIterator { +func (x Node) MapIterator() pd3.MapIterator { return &Node_MapIterator{false, &x} } -func (x Node) ListIterator() pd1.ListIterator { +func (x Node) ListIterator() pd3.ListIterator { return nil } @@ -4090,54 +4090,54 @@ func (x Node) IsNull() bool { } func (x Node) AsBool() (bool, error) { - return false, pd2.ErrNA + return false, pd1.ErrNA } func (x Node) AsInt() (int64, error) { - return 0, pd2.ErrNA + return 0, pd1.ErrNA } func (x Node) AsFloat() (float64, error) { - return 0, pd2.ErrNA + return 0, pd1.ErrNA } func (x Node) AsString() (string, error) { - return "", pd2.ErrNA + return "", pd1.ErrNA } func (x Node) AsBytes() ([]byte, error) { - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x Node) AsLink() (pd1.Link, error) { - return nil, pd2.ErrNA +func (x Node) AsLink() (pd3.Link, error) { + return nil, pd1.ErrNA } -func (x Node) Prototype() pd1.NodePrototype { +func (x Node) Prototype() pd3.NodePrototype { return nil } // -- protocol type AnonList20 -- -type AnonList20 []pd2.Bytes +type AnonList20 []pd1.Bytes -func (v AnonList20) Node() pd1.Node { +func (v AnonList20) Node() pd3.Node { return v } -func (v *AnonList20) Parse(n pd1.Node) error { - if n.Kind() == pd1.Kind_Null { +func (v *AnonList20) Parse(n pd3.Node) error { + if n.Kind() == pd3.Kind_Null { *v = nil return nil } - if n.Kind() != pd1.Kind_List { - return pd2.ErrNA + if n.Kind() != pd3.Kind_List { + return pd1.ErrNA } else { *v = make(AnonList20, n.Length()) iter := n.ListIterator() for !iter.Done() { if i, n, err := iter.Next(); err != nil { - return pd2.ErrNA + return pd1.ErrNA } else if err = (*v)[i].Parse(n); err != nil { return err } @@ -4146,39 +4146,39 @@ func (v *AnonList20) Parse(n pd1.Node) error { } } -func (AnonList20) Kind() pd1.Kind { - return pd1.Kind_List +func (AnonList20) Kind() pd3.Kind { + return pd3.Kind_List } -func (AnonList20) LookupByString(string) (pd1.Node, error) { - return nil, pd2.ErrNA +func (AnonList20) LookupByString(string) (pd3.Node, error) { + return nil, pd1.ErrNA } -func (AnonList20) LookupByNode(key pd1.Node) (pd1.Node, error) { - return nil, pd2.ErrNA +func (AnonList20) LookupByNode(key pd3.Node) (pd3.Node, error) { + return nil, pd1.ErrNA } -func (v AnonList20) LookupByIndex(i int64) (pd1.Node, error) { +func (v AnonList20) LookupByIndex(i int64) (pd3.Node, error) { if i < 0 || i >= v.Length() { - return nil, pd2.ErrBounds + return nil, pd1.ErrBounds } else { return v[i].Node(), nil } } -func (v AnonList20) LookupBySegment(seg pd1.PathSegment) (pd1.Node, error) { +func (v AnonList20) LookupBySegment(seg pd3.PathSegment) (pd3.Node, error) { if i, err := seg.Index(); err != nil { - return nil, pd2.ErrNA + return nil, pd1.ErrNA } else { return v.LookupByIndex(i) } } -func (AnonList20) MapIterator() pd1.MapIterator { +func (AnonList20) MapIterator() pd3.MapIterator { return nil } -func (v AnonList20) ListIterator() pd1.ListIterator { +func (v AnonList20) ListIterator() pd3.ListIterator { return &AnonList20_ListIterator{v, 0} } @@ -4195,30 +4195,30 @@ func (AnonList20) IsNull() bool { } func (v AnonList20) AsBool() (bool, error) { - return false, pd2.ErrNA + return false, pd1.ErrNA } func (AnonList20) AsInt() (int64, error) { - return 0, pd2.ErrNA + return 0, pd1.ErrNA } func (AnonList20) AsFloat() (float64, error) { - return 0, pd2.ErrNA + return 0, pd1.ErrNA } func (AnonList20) AsString() (string, error) { - return "", pd2.ErrNA + return "", pd1.ErrNA } func (AnonList20) AsBytes() ([]byte, error) { - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (AnonList20) AsLink() (pd1.Link, error) { - return nil, pd2.ErrNA +func (AnonList20) AsLink() (pd3.Link, error) { + return nil, pd1.ErrNA } -func (AnonList20) Prototype() pd1.NodePrototype { +func (AnonList20) Prototype() pd3.NodePrototype { return nil // not needed } @@ -4227,9 +4227,9 @@ type AnonList20_ListIterator struct { at int64 } -func (iter *AnonList20_ListIterator) Next() (int64, pd1.Node, error) { +func (iter *AnonList20_ListIterator) Next() (int64, pd3.Node, error) { if iter.Done() { - return -1, nil, pd2.ErrBounds + return -1, nil, pd1.ErrBounds } v := iter.list[iter.at] i := int64(iter.at) @@ -4244,20 +4244,20 @@ func (iter *AnonList20_ListIterator) Done() bool { // -- protocol type Peer -- type Peer struct { - ID pd2.Bytes + ID pd1.Bytes Multiaddresses AnonList20 } -func (x Peer) Node() pd1.Node { +func (x Peer) Node() pd3.Node { return x } -func (x *Peer) Parse(n pd1.Node) error { - if n.Kind() != pd1.Kind_Map { - return pd2.ErrNA +func (x *Peer) Parse(n pd3.Node) error { + if n.Kind() != pd3.Kind_Map { + return pd1.ErrNA } iter := n.MapIterator() - fieldMap := map[string]pd2.ParseFunc{ + fieldMap := map[string]pd1.ParseFunc{ "ID": x.ID.Parse, "Multiaddresses": x.Multiaddresses.Parse, } @@ -4266,13 +4266,13 @@ func (x *Peer) Parse(n pd1.Node) error { return err } else { if k, err := kn.AsString(); err != nil { - return pd3.Errorf("structure map key is not a string") + return pd2.Errorf("structure map key is not a string") } else { _ = vn switch k { case "ID": if _, notParsed := fieldMap["ID"]; !notParsed { - return pd3.Errorf("field %s already parsed", "ID") + return pd2.Errorf("field %s already parsed", "ID") } if err := x.ID.Parse(vn); err != nil { return err @@ -4280,7 +4280,7 @@ func (x *Peer) Parse(n pd1.Node) error { delete(fieldMap, "ID") case "Multiaddresses": if _, notParsed := fieldMap["Multiaddresses"]; !notParsed { - return pd3.Errorf("field %s already parsed", "Multiaddresses") + return pd2.Errorf("field %s already parsed", "Multiaddresses") } if err := x.Multiaddresses.Parse(vn); err != nil { return err @@ -4292,7 +4292,7 @@ func (x *Peer) Parse(n pd1.Node) error { } } for _, fieldParse := range fieldMap { - if err := fieldParse(pd1.Null); err != nil { + if err := fieldParse(pd3.Null); err != nil { return err } } @@ -4304,27 +4304,27 @@ type Peer_MapIterator struct { s *Peer } -func (x *Peer_MapIterator) Next() (key pd1.Node, value pd1.Node, err error) { +func (x *Peer_MapIterator) Next() (key pd3.Node, value pd3.Node, err error) { x.i++ switch x.i { case 0: - return pd2.String("ID"), x.s.ID.Node(), nil + return pd1.String("ID"), x.s.ID.Node(), nil case 1: - return pd2.String("Multiaddresses"), x.s.Multiaddresses.Node(), nil + return pd1.String("Multiaddresses"), x.s.Multiaddresses.Node(), nil } - return nil, nil, pd2.ErrNA + return nil, nil, pd1.ErrNA } func (x *Peer_MapIterator) Done() bool { return x.i+1 >= 2 } -func (x Peer) Kind() pd1.Kind { - return pd1.Kind_Map +func (x Peer) Kind() pd3.Kind { + return pd3.Kind_Map } -func (x Peer) LookupByString(key string) (pd1.Node, error) { +func (x Peer) LookupByString(key string) (pd3.Node, error) { switch key { case "ID": return x.ID.Node(), nil @@ -4332,28 +4332,28 @@ func (x Peer) LookupByString(key string) (pd1.Node, error) { return x.Multiaddresses.Node(), nil } - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x Peer) LookupByNode(key pd1.Node) (pd1.Node, error) { +func (x Peer) LookupByNode(key pd3.Node) (pd3.Node, error) { switch key.Kind() { - case pd1.Kind_String: + case pd3.Kind_String: if s, err := key.AsString(); err != nil { return nil, err } else { return x.LookupByString(s) } - case pd1.Kind_Int: + case pd3.Kind_Int: if i, err := key.AsInt(); err != nil { return nil, err } else { return x.LookupByIndex(i) } } - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x Peer) LookupByIndex(idx int64) (pd1.Node, error) { +func (x Peer) LookupByIndex(idx int64) (pd3.Node, error) { switch idx { case 0: return x.ID.Node(), nil @@ -4361,10 +4361,10 @@ func (x Peer) LookupByIndex(idx int64) (pd1.Node, error) { return x.Multiaddresses.Node(), nil } - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x Peer) LookupBySegment(seg pd1.PathSegment) (pd1.Node, error) { +func (x Peer) LookupBySegment(seg pd3.PathSegment) (pd3.Node, error) { switch seg.String() { case "0", "ID": return x.ID.Node(), nil @@ -4372,14 +4372,14 @@ func (x Peer) LookupBySegment(seg pd1.PathSegment) (pd1.Node, error) { return x.Multiaddresses.Node(), nil } - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x Peer) MapIterator() pd1.MapIterator { +func (x Peer) MapIterator() pd3.MapIterator { return &Peer_MapIterator{-1, &x} } -func (x Peer) ListIterator() pd1.ListIterator { +func (x Peer) ListIterator() pd3.ListIterator { return nil } @@ -4396,30 +4396,30 @@ func (x Peer) IsNull() bool { } func (x Peer) AsBool() (bool, error) { - return false, pd2.ErrNA + return false, pd1.ErrNA } func (x Peer) AsInt() (int64, error) { - return 0, pd2.ErrNA + return 0, pd1.ErrNA } func (x Peer) AsFloat() (float64, error) { - return 0, pd2.ErrNA + return 0, pd1.ErrNA } func (x Peer) AsString() (string, error) { - return "", pd2.ErrNA + return "", pd1.ErrNA } func (x Peer) AsBytes() ([]byte, error) { - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x Peer) AsLink() (pd1.Link, error) { - return nil, pd2.ErrNA +func (x Peer) AsLink() (pd3.Link, error) { + return nil, pd1.ErrNA } -func (x Peer) Prototype() pd1.NodePrototype { +func (x Peer) Prototype() pd3.NodePrototype { return nil } @@ -4430,13 +4430,13 @@ type TransferProtocol struct { GraphSyncFILv1 *GraphSyncFILv1Protocol DefaultKey string - DefaultValue *pd2.Any + DefaultValue *pd1.Any } -func (x *TransferProtocol) Parse(n pd1.Node) error { +func (x *TransferProtocol) Parse(n pd3.Node) error { *x = TransferProtocol{} - if n.Kind() != pd1.Kind_Map { - return pd2.ErrNA + if n.Kind() != pd3.Kind_Map { + return pd1.ErrNA } iter := n.MapIterator() kn, vn, err := iter.Next() @@ -4445,7 +4445,7 @@ func (x *TransferProtocol) Parse(n pd1.Node) error { } k, err := kn.AsString() if err != nil { - return pd3.Errorf("inductive map key is not a string") + return pd2.Errorf("inductive map key is not a string") } switch k { case "2304": @@ -4464,7 +4464,7 @@ func (x *TransferProtocol) Parse(n pd1.Node) error { return nil default: - var y pd2.Any + var y pd1.Any if err := y.Parse(vn); err != nil { return err } @@ -4481,22 +4481,22 @@ type TransferProtocol_MapIterator struct { s *TransferProtocol } -func (x *TransferProtocol_MapIterator) Next() (key pd1.Node, value pd1.Node, err error) { +func (x *TransferProtocol_MapIterator) Next() (key pd3.Node, value pd3.Node, err error) { if x.done { - return nil, nil, pd2.ErrNA + return nil, nil, pd1.ErrNA } else { x.done = true switch { case x.s.Bitswap != nil: - return pd2.String("2304"), x.s.Bitswap.Node(), nil + return pd1.String("2304"), x.s.Bitswap.Node(), nil case x.s.GraphSyncFILv1 != nil: - return pd2.String("2320"), x.s.GraphSyncFILv1.Node(), nil + return pd1.String("2320"), x.s.GraphSyncFILv1.Node(), nil case x.s.DefaultValue != nil: - return pd2.String(x.s.DefaultKey), x.s.DefaultValue.Node(), nil + return pd1.String(x.s.DefaultKey), x.s.DefaultValue.Node(), nil default: - return nil, nil, pd3.Errorf("no inductive cases are set") + return nil, nil, pd2.Errorf("no inductive cases are set") } } } @@ -4505,15 +4505,15 @@ func (x *TransferProtocol_MapIterator) Done() bool { return x.done } -func (x TransferProtocol) Node() pd1.Node { +func (x TransferProtocol) Node() pd3.Node { return x } -func (x TransferProtocol) Kind() pd1.Kind { - return pd1.Kind_Map +func (x TransferProtocol) Kind() pd3.Kind { + return pd3.Kind_Map } -func (x TransferProtocol) LookupByString(key string) (pd1.Node, error) { +func (x TransferProtocol) LookupByString(key string) (pd3.Node, error) { switch { case x.Bitswap != nil && key == "2304": return x.Bitswap.Node(), nil @@ -4524,12 +4524,12 @@ func (x TransferProtocol) LookupByString(key string) (pd1.Node, error) { return x.DefaultValue.Node(), nil } - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x TransferProtocol) LookupByNode(key pd1.Node) (pd1.Node, error) { - if key.Kind() != pd1.Kind_String { - return nil, pd2.ErrNA +func (x TransferProtocol) LookupByNode(key pd3.Node) (pd3.Node, error) { + if key.Kind() != pd3.Kind_String { + return nil, pd1.ErrNA } if s, err := key.AsString(); err != nil { return nil, err @@ -4538,11 +4538,11 @@ func (x TransferProtocol) LookupByNode(key pd1.Node) (pd1.Node, error) { } } -func (x TransferProtocol) LookupByIndex(idx int64) (pd1.Node, error) { - return nil, pd2.ErrNA +func (x TransferProtocol) LookupByIndex(idx int64) (pd3.Node, error) { + return nil, pd1.ErrNA } -func (x TransferProtocol) LookupBySegment(seg pd1.PathSegment) (pd1.Node, error) { +func (x TransferProtocol) LookupBySegment(seg pd3.PathSegment) (pd3.Node, error) { switch seg.String() { case "2304": return x.Bitswap.Node(), nil @@ -4553,14 +4553,14 @@ func (x TransferProtocol) LookupBySegment(seg pd1.PathSegment) (pd1.Node, error) return x.DefaultValue.Node(), nil } - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x TransferProtocol) MapIterator() pd1.MapIterator { +func (x TransferProtocol) MapIterator() pd3.MapIterator { return &TransferProtocol_MapIterator{false, &x} } -func (x TransferProtocol) ListIterator() pd1.ListIterator { +func (x TransferProtocol) ListIterator() pd3.ListIterator { return nil } @@ -4577,30 +4577,30 @@ func (x TransferProtocol) IsNull() bool { } func (x TransferProtocol) AsBool() (bool, error) { - return false, pd2.ErrNA + return false, pd1.ErrNA } func (x TransferProtocol) AsInt() (int64, error) { - return 0, pd2.ErrNA + return 0, pd1.ErrNA } func (x TransferProtocol) AsFloat() (float64, error) { - return 0, pd2.ErrNA + return 0, pd1.ErrNA } func (x TransferProtocol) AsString() (string, error) { - return "", pd2.ErrNA + return "", pd1.ErrNA } func (x TransferProtocol) AsBytes() ([]byte, error) { - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x TransferProtocol) AsLink() (pd1.Link, error) { - return nil, pd2.ErrNA +func (x TransferProtocol) AsLink() (pd3.Link, error) { + return nil, pd1.ErrNA } -func (x TransferProtocol) Prototype() pd1.NodePrototype { +func (x TransferProtocol) Prototype() pd3.NodePrototype { return nil } @@ -4609,22 +4609,22 @@ func (x TransferProtocol) Prototype() pd1.NodePrototype { type BitswapProtocol struct { } -func (x BitswapProtocol) Node() pd1.Node { +func (x BitswapProtocol) Node() pd3.Node { return x } -func (x *BitswapProtocol) Parse(n pd1.Node) error { - if n.Kind() != pd1.Kind_Map { - return pd2.ErrNA +func (x *BitswapProtocol) Parse(n pd3.Node) error { + if n.Kind() != pd3.Kind_Map { + return pd1.ErrNA } iter := n.MapIterator() - fieldMap := map[string]pd2.ParseFunc{} + fieldMap := map[string]pd1.ParseFunc{} for !iter.Done() { if kn, vn, err := iter.Next(); err != nil { return err } else { if k, err := kn.AsString(); err != nil { - return pd3.Errorf("structure map key is not a string") + return pd2.Errorf("structure map key is not a string") } else { _ = vn switch k { @@ -4634,7 +4634,7 @@ func (x *BitswapProtocol) Parse(n pd1.Node) error { } } for _, fieldParse := range fieldMap { - if err := fieldParse(pd1.Null); err != nil { + if err := fieldParse(pd3.Null); err != nil { return err } } @@ -4646,66 +4646,66 @@ type BitswapProtocol_MapIterator struct { s *BitswapProtocol } -func (x *BitswapProtocol_MapIterator) Next() (key pd1.Node, value pd1.Node, err error) { +func (x *BitswapProtocol_MapIterator) Next() (key pd3.Node, value pd3.Node, err error) { x.i++ switch x.i { } - return nil, nil, pd2.ErrNA + return nil, nil, pd1.ErrNA } func (x *BitswapProtocol_MapIterator) Done() bool { return x.i+1 >= 0 } -func (x BitswapProtocol) Kind() pd1.Kind { - return pd1.Kind_Map +func (x BitswapProtocol) Kind() pd3.Kind { + return pd3.Kind_Map } -func (x BitswapProtocol) LookupByString(key string) (pd1.Node, error) { +func (x BitswapProtocol) LookupByString(key string) (pd3.Node, error) { switch key { } - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x BitswapProtocol) LookupByNode(key pd1.Node) (pd1.Node, error) { +func (x BitswapProtocol) LookupByNode(key pd3.Node) (pd3.Node, error) { switch key.Kind() { - case pd1.Kind_String: + case pd3.Kind_String: if s, err := key.AsString(); err != nil { return nil, err } else { return x.LookupByString(s) } - case pd1.Kind_Int: + case pd3.Kind_Int: if i, err := key.AsInt(); err != nil { return nil, err } else { return x.LookupByIndex(i) } } - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x BitswapProtocol) LookupByIndex(idx int64) (pd1.Node, error) { +func (x BitswapProtocol) LookupByIndex(idx int64) (pd3.Node, error) { switch idx { } - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x BitswapProtocol) LookupBySegment(seg pd1.PathSegment) (pd1.Node, error) { +func (x BitswapProtocol) LookupBySegment(seg pd3.PathSegment) (pd3.Node, error) { switch seg.String() { } - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x BitswapProtocol) MapIterator() pd1.MapIterator { +func (x BitswapProtocol) MapIterator() pd3.MapIterator { return &BitswapProtocol_MapIterator{-1, &x} } -func (x BitswapProtocol) ListIterator() pd1.ListIterator { +func (x BitswapProtocol) ListIterator() pd3.ListIterator { return nil } @@ -4722,30 +4722,30 @@ func (x BitswapProtocol) IsNull() bool { } func (x BitswapProtocol) AsBool() (bool, error) { - return false, pd2.ErrNA + return false, pd1.ErrNA } func (x BitswapProtocol) AsInt() (int64, error) { - return 0, pd2.ErrNA + return 0, pd1.ErrNA } func (x BitswapProtocol) AsFloat() (float64, error) { - return 0, pd2.ErrNA + return 0, pd1.ErrNA } func (x BitswapProtocol) AsString() (string, error) { - return "", pd2.ErrNA + return "", pd1.ErrNA } func (x BitswapProtocol) AsBytes() ([]byte, error) { - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x BitswapProtocol) AsLink() (pd1.Link, error) { - return nil, pd2.ErrNA +func (x BitswapProtocol) AsLink() (pd3.Link, error) { + return nil, pd1.ErrNA } -func (x BitswapProtocol) Prototype() pd1.NodePrototype { +func (x BitswapProtocol) Prototype() pd3.NodePrototype { return nil } @@ -4753,20 +4753,20 @@ func (x BitswapProtocol) Prototype() pd1.NodePrototype { type GraphSyncFILv1Protocol struct { PieceCID LinkToAny - VerifiedDeal pd2.Bool - FastRetrieval pd2.Bool + VerifiedDeal pd1.Bool + FastRetrieval pd1.Bool } -func (x GraphSyncFILv1Protocol) Node() pd1.Node { +func (x GraphSyncFILv1Protocol) Node() pd3.Node { return x } -func (x *GraphSyncFILv1Protocol) Parse(n pd1.Node) error { - if n.Kind() != pd1.Kind_Map { - return pd2.ErrNA +func (x *GraphSyncFILv1Protocol) Parse(n pd3.Node) error { + if n.Kind() != pd3.Kind_Map { + return pd1.ErrNA } iter := n.MapIterator() - fieldMap := map[string]pd2.ParseFunc{ + fieldMap := map[string]pd1.ParseFunc{ "PieceCID": x.PieceCID.Parse, "VerifiedDeal": x.VerifiedDeal.Parse, "FastRetrieval": x.FastRetrieval.Parse, @@ -4776,13 +4776,13 @@ func (x *GraphSyncFILv1Protocol) Parse(n pd1.Node) error { return err } else { if k, err := kn.AsString(); err != nil { - return pd3.Errorf("structure map key is not a string") + return pd2.Errorf("structure map key is not a string") } else { _ = vn switch k { case "PieceCID": if _, notParsed := fieldMap["PieceCID"]; !notParsed { - return pd3.Errorf("field %s already parsed", "PieceCID") + return pd2.Errorf("field %s already parsed", "PieceCID") } if err := x.PieceCID.Parse(vn); err != nil { return err @@ -4790,7 +4790,7 @@ func (x *GraphSyncFILv1Protocol) Parse(n pd1.Node) error { delete(fieldMap, "PieceCID") case "VerifiedDeal": if _, notParsed := fieldMap["VerifiedDeal"]; !notParsed { - return pd3.Errorf("field %s already parsed", "VerifiedDeal") + return pd2.Errorf("field %s already parsed", "VerifiedDeal") } if err := x.VerifiedDeal.Parse(vn); err != nil { return err @@ -4798,7 +4798,7 @@ func (x *GraphSyncFILv1Protocol) Parse(n pd1.Node) error { delete(fieldMap, "VerifiedDeal") case "FastRetrieval": if _, notParsed := fieldMap["FastRetrieval"]; !notParsed { - return pd3.Errorf("field %s already parsed", "FastRetrieval") + return pd2.Errorf("field %s already parsed", "FastRetrieval") } if err := x.FastRetrieval.Parse(vn); err != nil { return err @@ -4810,7 +4810,7 @@ func (x *GraphSyncFILv1Protocol) Parse(n pd1.Node) error { } } for _, fieldParse := range fieldMap { - if err := fieldParse(pd1.Null); err != nil { + if err := fieldParse(pd3.Null); err != nil { return err } } @@ -4822,29 +4822,29 @@ type GraphSyncFILv1Protocol_MapIterator struct { s *GraphSyncFILv1Protocol } -func (x *GraphSyncFILv1Protocol_MapIterator) Next() (key pd1.Node, value pd1.Node, err error) { +func (x *GraphSyncFILv1Protocol_MapIterator) Next() (key pd3.Node, value pd3.Node, err error) { x.i++ switch x.i { case 0: - return pd2.String("PieceCID"), x.s.PieceCID.Node(), nil + return pd1.String("PieceCID"), x.s.PieceCID.Node(), nil case 1: - return pd2.String("VerifiedDeal"), x.s.VerifiedDeal.Node(), nil + return pd1.String("VerifiedDeal"), x.s.VerifiedDeal.Node(), nil case 2: - return pd2.String("FastRetrieval"), x.s.FastRetrieval.Node(), nil + return pd1.String("FastRetrieval"), x.s.FastRetrieval.Node(), nil } - return nil, nil, pd2.ErrNA + return nil, nil, pd1.ErrNA } func (x *GraphSyncFILv1Protocol_MapIterator) Done() bool { return x.i+1 >= 3 } -func (x GraphSyncFILv1Protocol) Kind() pd1.Kind { - return pd1.Kind_Map +func (x GraphSyncFILv1Protocol) Kind() pd3.Kind { + return pd3.Kind_Map } -func (x GraphSyncFILv1Protocol) LookupByString(key string) (pd1.Node, error) { +func (x GraphSyncFILv1Protocol) LookupByString(key string) (pd3.Node, error) { switch key { case "PieceCID": return x.PieceCID.Node(), nil @@ -4854,28 +4854,28 @@ func (x GraphSyncFILv1Protocol) LookupByString(key string) (pd1.Node, error) { return x.FastRetrieval.Node(), nil } - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x GraphSyncFILv1Protocol) LookupByNode(key pd1.Node) (pd1.Node, error) { +func (x GraphSyncFILv1Protocol) LookupByNode(key pd3.Node) (pd3.Node, error) { switch key.Kind() { - case pd1.Kind_String: + case pd3.Kind_String: if s, err := key.AsString(); err != nil { return nil, err } else { return x.LookupByString(s) } - case pd1.Kind_Int: + case pd3.Kind_Int: if i, err := key.AsInt(); err != nil { return nil, err } else { return x.LookupByIndex(i) } } - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x GraphSyncFILv1Protocol) LookupByIndex(idx int64) (pd1.Node, error) { +func (x GraphSyncFILv1Protocol) LookupByIndex(idx int64) (pd3.Node, error) { switch idx { case 0: return x.PieceCID.Node(), nil @@ -4885,10 +4885,10 @@ func (x GraphSyncFILv1Protocol) LookupByIndex(idx int64) (pd1.Node, error) { return x.FastRetrieval.Node(), nil } - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x GraphSyncFILv1Protocol) LookupBySegment(seg pd1.PathSegment) (pd1.Node, error) { +func (x GraphSyncFILv1Protocol) LookupBySegment(seg pd3.PathSegment) (pd3.Node, error) { switch seg.String() { case "0", "PieceCID": return x.PieceCID.Node(), nil @@ -4898,14 +4898,14 @@ func (x GraphSyncFILv1Protocol) LookupBySegment(seg pd1.PathSegment) (pd1.Node, return x.FastRetrieval.Node(), nil } - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x GraphSyncFILv1Protocol) MapIterator() pd1.MapIterator { +func (x GraphSyncFILv1Protocol) MapIterator() pd3.MapIterator { return &GraphSyncFILv1Protocol_MapIterator{-1, &x} } -func (x GraphSyncFILv1Protocol) ListIterator() pd1.ListIterator { +func (x GraphSyncFILv1Protocol) ListIterator() pd3.ListIterator { return nil } @@ -4922,29 +4922,29 @@ func (x GraphSyncFILv1Protocol) IsNull() bool { } func (x GraphSyncFILv1Protocol) AsBool() (bool, error) { - return false, pd2.ErrNA + return false, pd1.ErrNA } func (x GraphSyncFILv1Protocol) AsInt() (int64, error) { - return 0, pd2.ErrNA + return 0, pd1.ErrNA } func (x GraphSyncFILv1Protocol) AsFloat() (float64, error) { - return 0, pd2.ErrNA + return 0, pd1.ErrNA } func (x GraphSyncFILv1Protocol) AsString() (string, error) { - return "", pd2.ErrNA + return "", pd1.ErrNA } func (x GraphSyncFILv1Protocol) AsBytes() ([]byte, error) { - return nil, pd2.ErrNA + return nil, pd1.ErrNA } -func (x GraphSyncFILv1Protocol) AsLink() (pd1.Link, error) { - return nil, pd2.ErrNA +func (x GraphSyncFILv1Protocol) AsLink() (pd3.Link, error) { + return nil, pd1.ErrNA } -func (x GraphSyncFILv1Protocol) Prototype() pd1.NodePrototype { +func (x GraphSyncFILv1Protocol) Prototype() pd3.NodePrototype { return nil } diff --git a/gen/routing.go b/gen/routing.go index eba5819..5fc3863 100644 --- a/gen/routing.go +++ b/gen/routing.go @@ -3,6 +3,7 @@ package main import ( "os" + "os/exec" "path" log "github.com/ipfs/go-log/v2" @@ -254,4 +255,9 @@ func main() { logger.Errorf("build (%v)\n", err) os.Exit(-1) } + // go fmt + if err = exec.Command("go", "fmt", "./...").Run(); err != nil { + logger.Errorf("formatting generated code (%v)\n", err) + os.Exit(-1) + } } diff --git a/go.mod b/go.mod index 92da529..74344df 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/ipfs/go-cid v0.2.0 github.com/ipfs/go-ipns v0.1.2 github.com/ipfs/go-log/v2 v2.5.1 - github.com/ipld/edelweiss v0.1.5 + github.com/ipld/edelweiss v0.1.6 github.com/ipld/go-ipld-prime v0.17.1-0.20220627233435-adf99676901e github.com/libp2p/go-libp2p-core v0.16.1 github.com/libp2p/go-libp2p-record v0.1.3 diff --git a/go.sum b/go.sum index 7169753..30856e1 100644 --- a/go.sum +++ b/go.sum @@ -98,8 +98,8 @@ github.com/ipfs/go-log/v2 v2.0.5/go.mod h1:eZs4Xt4ZUJQFM3DlanGhy7TkwwawCZcSByscw github.com/ipfs/go-log/v2 v2.1.3/go.mod h1:/8d0SH3Su5Ooc31QlL1WysJhvyOTDCjcCZ9Axpmri6g= github.com/ipfs/go-log/v2 v2.5.1 h1:1XdUzF7048prq4aBjDQQ4SL5RxftpRGdXhNRwKSAlcY= github.com/ipfs/go-log/v2 v2.5.1/go.mod h1:prSpmC1Gpllc9UYWxDiZDreBYw7zp4Iqp1kOLU9U5UI= -github.com/ipld/edelweiss v0.1.5 h1:NxsTAuaB2R+k7NweBWtUauMIRrQVjvwoyS7N9Qi+v/o= -github.com/ipld/edelweiss v0.1.5/go.mod h1:IVSfo5e7vJrTKKRjR1lrtfgc2UbEMvvatNycfH9fRfY= +github.com/ipld/edelweiss v0.1.6 h1:LHx4wzsbQYC5UvN+7xwvwnGbq8kCsMbOSbfBYVCC1nY= +github.com/ipld/edelweiss v0.1.6/go.mod h1:IVSfo5e7vJrTKKRjR1lrtfgc2UbEMvvatNycfH9fRfY= github.com/ipld/go-ipld-prime v0.9.0/go.mod h1:KvBLMr4PX1gWptgkzRjVZCrLmSGcZCb/jioOQwCqZN8= github.com/ipld/go-ipld-prime v0.17.0/go.mod h1:aYcKm5TIvGfY8P3QBKz/2gKcLxzJ1zDaD+o0bOowhgs= github.com/ipld/go-ipld-prime v0.17.1-0.20220627233435-adf99676901e h1:p5qepdt1UEk6UadNwNBFDlm/uC+GwSmdVB4wqyt2JLA=