1. 15 Jan, 2019 1 commit
    • Eric Myhre's avatar
      Reboot typed dir. Now with child packages. · c8e3e1d4
      Eric Myhre authored
      See previous commit for more discussion of the child packages to come,
      or the schema.md file in the docs dir, which describes similar.
      
      Several large todos in comments.
      
      Quite importantly: typed.Node is now an **interface**, not a concrete
      struct itself.  The godoc comment should explain this nicely; long
      story short, this is going to be relevant when we get to codegen and
      other advanced form of native integration.
      Signed-off-by: default avatarEric Myhre <hash@exultant.us>
      c8e3e1d4
  2. 06 Dec, 2018 2 commits
    • Eric Myhre's avatar
      Add Kind and Keys methods to Node. · 5c32434e
      Eric Myhre authored
      And ReprKind moves from the typed package to the ipld main package.
      It's hard to get too much done without the standardization of ReprKind.
      
      Between the Kind() and Keys() methods, it should now be possible to
      perform traversals of unknown nodes.
      
      This diff just worries about implementing all the Kind() methods.
      Keys() has some additional questions to handle (namely, map ordering?).
      Signed-off-by: default avatarEric Myhre <hash@exultant.us>
      5c32434e
    • Eric Myhre's avatar
      Add ReprKind method to Type interface. · 2a230abe
      Eric Myhre authored
      Having a Name() interface method might also have been useful, but at
      the moment, it's too annoying.  Maybe I'll come back to this and add a
      ton of constructors for each kind of type and make all their fields
      private scope, which would solve the name collision... maybe.  Later.
      (This is all expected to be implementation-internal stuff in the long
      run rather than anything user-facing API, so it's up for debate how
      much polishing it's actually worth.  Unless that changes!)
      
      The ReprKind method is *usually* pretty predestined based on the kind
      of type in the first place, but a few cases are interesting.
      
      ... *Especially* kinded unions.  I'm a little alarmed at the break of
      pattern, there.  Hopefully that doesn't manifest too much complexity
      down the road.  But if it does... eh, well... nature of the beast.
      Kinded unions are definitely a useful feature.
      Signed-off-by: default avatarEric Myhre <hash@exultant.us>
      2a230abe