1. 22 Aug, 2021 1 commit
  2. 16 Aug, 2021 1 commit
  3. 29 Jul, 2021 1 commit
  4. 25 Dec, 2020 1 commit
    • Daniel Martí's avatar
      all: rename schema.Kind to TypeKind, ipld.ReprKind to Kind · 2d7d25c4
      Daniel Martí authored
      As discussed on the issue thread, ipld.Kind and schema.TypeKind are more
      intuitive, closer to the spec wording, and just generally better in the
      long run.
      
      The changes are almost entirely automated via the commands below. Very
      minor changes were needed in some of the generators, and then gofmt.
      
      	sed -ri 's/\<Kind\(\)/TypeKind()/g' **/*.go
      	git checkout fluent # since it uses reflect.Value.Kind
      
      	sed -ri 's/\<Kind_/TypeKind_/g' **/*.go
      	sed -i 's/\<Kind\>/TypeKind/g' **/*.go
      	sed -i 's/ReprKind/Kind/g' **/*.go
      
      Plus manually undoing a few renames, as per Eric's review.
      
      Fixes #94.
      2d7d25c4
  5. 30 Aug, 2019 1 commit
    • Eric Myhre's avatar
      Move selector.PathSegment up to ipld.PathSegment. · fc1f83d7
      Eric Myhre authored
      ipld.Path is now a slice of ipld.PathSegment instead of strings.
      
      This should be an improvement in sanity: there are now several fewer
      places importing "strconv", and that's just always a good thing.
      
      We will also be free in the future to add PathSegment-based accessor
      methods to ipld.Node, as has already been commented as a desire;
      and, to use PathSegment in building better typed errors
      (which is the specific thing that provokes this diff today and now).
      
      The implementation of PathSegment is now also based on a struct-style
      union rather than an interface style union.  There are comments about
      this in the diff.  I do not wish to comment on how much time I've spent
      looking at golang assembler and runtime internals while trying to find
      a path to a more perfect compromise between ergonomics and performance.
      tl;dr Selectors will probably get faster and trigger fewer allocations;
      ipld.Path will probably take slightly more memory (another word per
      path segment), but not enough to care about for any practical purposes.
      
      I did not attempt to hoist the SegmentIterator features from the
      selector package to anywhere more central.
      It may be a fine idea to do so someday; I just don't presently have
      a formed opinion and am not budgeting time to consider it today.
      Signed-off-by: default avatarEric Myhre <hash@exultant.us>
      fc1f83d7
  6. 06 Aug, 2019 5 commits
  7. 16 Jul, 2019 1 commit
    • hannahhoward's avatar
      feat(selectors): update existing to spec · 94020ba3
      hannahhoward authored
      - Update existing selectors so they are current with the specification.
      - Also add early implementations of ExploreIndex and ExploreRange.
      - Add an early implementation of Explore for ExploreUnion.
      - Add constants for field keys.
      94020ba3
  8. 29 Apr, 2019 1 commit
    • Eric Myhre's avatar
      Selector implementation! · cd9283dd
      Eric Myhre authored
      This is a draft.  There's a LOT of hard design choices which are not
      yet completely settled here.
      
      Corresponding updates to the ipld/specs repo will be coming soon:
      these implementations match a very recursive concept of selectors.
      (https://github.com/ipld/specs/pull/116 is roughly this.)
      
      There's so many things to go over, here.
      
      - selectors at all
      - selectFields is kind of a special case of unions
      - selectPath as a concept is gone; is a degenerate case of selectFields
      - we've added some new methods to help narrow down search spaces
      - we have serial selector spec parsers...!  (very hand-rolled.)
      - the idea of always reporting candidates vs definite match parents
        is dropped for now; it requires a different algo with different
        performance characteristics, so, we'll do it as such -- later.
      - we ended up with unions being *in*!  They're going to be used
        internally by a bunch of other things -- see comment blocks in
        the code about that (tl;dr recursives imply a need of unions).
      
      More docs will be coming in future commits; this is just a checkpoint
      of the progress.
      Signed-off-by: default avatarEric Myhre <hash@exultant.us>
      cd9283dd
  9. 21 Mar, 2019 1 commit
    • Eric Myhre's avatar
      Iterator refactor: entry-based, for map and list. · b84e99cd
      Eric Myhre authored
      We now have both MapIterator and ListIterator interfaces.
      Both return key-value (or index-value) pairs, rather than just keys.
      
      List iterators may seem a tad redundant: you just loop over the length,
      right?  Well, sure.  But there's one place a list iterator shines:
      selecting only a subset of elements.  And indeed, we'll be doing
      exactly that in the traversal/selector package; therefore, we
      definitely need list iterators.
      
      We might want keys-only iterators again in the future, but at present,
      I'm deferring that.  It's definitely true that we should have iterators
      returning values as a core feature, since they're likely to be more
      efficiently supportable than "random" access (especially when we get to
      some Advanced Layout data systems), so we'll implement those first.
      
      Additionally, note that MapIterator now returns a Node for the key.
      This is to account for that fact that when using the schema system and
      typed nodes, map keys can be more *specific* types.  Such nodes are
      still required to be kind==ReprKind_String, but string might not be
      their *preferred* native format (think: tuples with serialized to be
      delimiter-separated strings); we need to account for that.
      (MapBuilder.Insert method already takes a Node parameter for similar
      reasons: so it can take *typed* nodes.  Node.TraverseField accepting
      a plain string is the oddball out here, and should be rectified.)
      Signed-off-by: default avatarEric Myhre <hash@exultant.us>
      b84e99cd
  10. 08 Mar, 2019 1 commit
  11. 14 Feb, 2019 1 commit
    • Eric Myhre's avatar
      Outline of Traverse* funcs; comment about link loaders in TraversalConfig;... · 67abbce4
      Eric Myhre authored
      Outline of Traverse* funcs; comment about link loaders in TraversalConfig; confession of working draft of Selector interface; fixed typo in AdvVisitFn return types.
      
      Yes, that's lot of things heaped in one commit.
      
      Yes, (unfortunately,) they're all related.  Almost the entirety of this
      has to manifest *at once*, all seamlessly connected, for any part of
      it to get off the ground.
      
      Note how very much is handwaved in the comments about TraversalConfig
      having linkloader tools of some kind.  There's a lot to unpack there.
      Getting it to work well, and let users of the library supply functions
      that customize the parts that are interesting to the user, while *not*
      getting them hamstrung by a bunch of details about multicodecs and
      multihashing (unless they want to!)... requires careful design work.
      Signed-off-by: default avatarEric Myhre <hash@exultant.us>
      67abbce4