1. 16 Aug, 2021 2 commits
  2. 29 Jul, 2021 5 commits
  3. 21 Jul, 2021 5 commits
  4. 16 Jul, 2021 4 commits
  5. 14 Jul, 2021 2 commits
  6. 01 Jul, 2021 1 commit
    • Daniel Martí's avatar
      fluent/quip: remove in favor of qp · b7347f19
      Daniel Martí authored
      After experimenting with quip and qp for a few months, we seem to agree
      that qp is a bit nicer to use. Remove quip, since it's largely redundant
      going forward.
      
      Since the qp docs referenced quip, redo that to stand on its own ground.
      b7347f19
  7. 19 Jun, 2021 1 commit
  8. 14 Jun, 2021 1 commit
  9. 09 Jun, 2021 1 commit
    • Daniel Martí's avatar
      node/bindnode: rethink and better document APIs · 2fc002c2
      Daniel Martí authored
      Before, we envisioned exposing the following APIs:
      
      	Prototype
      	PrototypeNoSchema
      	PrototypeOnlySchema
      	Wrap
      	WrapNoSchema
      
      The names were long, though, and perhaps a bit confusing too. Instead,
      just expose Prototype and Wrap, and allow either of the parameters to be
      nil to infer its value. This makes the API easier to navigate, and we
      can concentrate documentation in fewer places.
      
      Now there's two main entrypoints: Prototype if one wants a high-level
      prototype to create nodes of a certain shape, and Wrap if one wants to
      expose an existing Go value as an IPLD node. Whether one supplies only
      an IPLD Schema, only a Go type/value, or both, is their choice. The only
      exception is Wrap, which always requires a Go value by definition.
      
      Wrap works now, too, and gains an example. It's the same idea as the
      previous Prototype example, but it builds the value via a Go composite
      literal rather than fluent/qp on the IPLD side.
      
      Another noteworthy change is that we now return TypedPrototype and
      TypedNode rather than the regular NodePrototype and Node interfaces,
      since bindnode always works with a schema - even when it's inferred.
      The big advantage here is that one can call the Representation method
      directly on the result without having to type assert, like the example
      does.
      2fc002c2
  10. 08 Jun, 2021 1 commit
    • Daniel Martí's avatar
      node/tests: cover yet more interface methods · b832b762
      Daniel Martí authored
      Including LookupBySegment and LookupByNode for both maps and lists, but
      also As<T> for the representation form of all scalar kinds.
      
      While at it, expand the interface implementation assertions, too.
      
      Note that we had to make the node/basic tests external,
      for the sake of testing LookupByNode without inserting an import cycle.
      b832b762
  11. 07 Jun, 2021 1 commit
    • Daniel Martí's avatar
      node/tests: cover more error cases for scalar kinds · dab6ec7c
      Daniel Martí authored
      In particular, calling non-scalar Node and Assembler methods should
      always fail.
      
      While at it, remove some unused code, since unions always have
      representation strategies.
      
      Brings up code coverage in bindnode from 72.7% to 75%.
      dab6ec7c
  12. 03 Jun, 2021 2 commits
    • Daniel Martí's avatar
      node/tests: add more extensive scalar kind tests · b6e2b10f
      Daniel Martí authored
      It covers AssignKind, AssignNode, and AsKind for every combination of
      assembler kind and method.
      
      We also verify that a constructed scalar node behaves the same with
      AsKind when using its representation, like the old test.
      
      There's effectively a triple loop as a test table, so the subtest name
      has up to three components separated by dashes, such as:
      
      	TestSchema/Scalars/Bytes-AssignNode-String
      
      We also use this test as a demo of quicktest instead of go-wish.
      
      Finally, adapt bindnode to pass these tests just like codegen. This was
      mainly a bunch of TODOs in the relevant methods.
      b6e2b10f
    • Daniel Martí's avatar
      node/bindnode: start running all schema tests · 6042d4d8
      Daniel Martí authored
      We add node/tests.SchemaTestAll to simplify this task, meaning we don't
      need to duplicate all test func declarations in node/bindnode.
      SchemaTestAll is also flexible enough to allow running multiple
      sub-tests per schema test in the future.
      
      There were two remaining places in node/tests that still weren't using
      ipld.DeepEqual, so fix those.
      
      Finally, bindnode needed a couple of changes to fully support
      ipld.DeepEqual. Most notable is iteration over maps, which required a
      bit of a refactor to keep ordered keys.
      6042d4d8
  13. 02 Jun, 2021 4 commits
  14. 25 May, 2021 5 commits
  15. 24 May, 2021 2 commits
    • Will Scott's avatar
      Add enumerate methods to the multicodec registries. · 401e218a
      Will Scott authored
      (This is a logical port of
      https://github.com/ipld/go-ipld-prime/pull/169 to follow
      https://github.com/ipld/go-ipld-prime/pull/172 .)
      
      I've added more documentation -- particularly, cautionary notes on the
      package-scope functions which read the global shared state.
      401e218a
    • Eric Myhre's avatar
      Make a multicodec.Registry type available. · 575054d9
      Eric Myhre authored
      The hope is that this might be helpful if you want to build a
      multicodec registry other than the global one, but are still buying
      into the idea of the registry being keyed by indicator numbers.
      
      (I'm... not actually sure how useful this is, because I'd think if
      you're building something other than the default, there's also a good
      chance you'd want *more* features than a primitive numerical mapping,
      which are probably going to be related to whatever your application
      logic in the area is, and therefore not possible for this library
      to usefully anticipate.  But, I dunno.  I'm doing this because
      people are proposing attaching more features to the global, and
      I'm not comfortable with it, and I'm hoping this will provide a
      pressure release valve.)
      
      The current interfaces are functionally unchanged.
      
      The multicodec.Registry type can now be used when constructing
      a cidlink.LinkSystem.  (This saves you from having to write the
      glue functions to unbox cidlink and then do the LookupEncoder
      and LookupDecode calls.)
      
      For where this relates to LinkSystem, I considered a mechanism like:
      `func (r *Registry) InstallOn(lsys *ipld.LinkSystem)` ...
      and probably would've found that a bit cleaner.
      However, it doesn't jive with the way we've isolated the CID types
      into a package with a LinkSystem just for them (sigh; that really is
      the gift of complexity that just keeps giving); you can see how the
      EncoderChooser and DecoderChooser funcs need a tiny bit of type
      assertions in order to figure out how to extract the multicodec
      indicator from the Link/LinkPrototype types?  That bit is a bit
      that we still want to keep cordoned off the rest of the import tree.
      
      DefaultRegistry is also now an exported variable, in addition to the
      functions which already worked with the global data.
      I probably would've preferred to keep the DefaultRegistry variable
      unexported, because I can't imagine any good coming of touching it,
      but the relationship to LinkSystem detailed in the above paragraph
      requires some access to it.
      575054d9
  16. 05 May, 2021 1 commit
    • Daniel Martí's avatar
      fluent/qp: don't panic on string panics · aff91f7b
      Daniel Martí authored
      Since qp uses panics as an error mechanism, the top-level functions
      recover those errors to return them normally.
      
      However, this blows up if, internally, an ipld.Node implementation
      panics with a value whose type is not error. For example, with:
      
      	panic("some panic message")
      
      One gets:
      
      	panic: some panic message [recovered]
      		panic: interface conversion: string is not error: missing method Error
      
      Fix this by having a fallback for non-error panic values.
      aff91f7b
  17. 28 Apr, 2021 2 commits