- 08 Dec, 2018 1 commit
-
-
Eric Myhre authored
This will be for the active path -- if we also follow through on the idea of having a just-in-time checked Node wrapper, a lot of these checks might end up duplicated. We'll DRY that up when we get there. Doing accumulation of errors. Might get loud. We can come back and and early-halt parameters or other accumulation strategies later. Added IsNull predicate to core Node interface. Going to want enumerated error categories here for sure, but punting on that until we get more examples of what all the errors *are*; then I'll come back and tear all this 'fmt.Errorf' nonsense back out. Signed-off-by: Eric Myhre <hash@exultant.us>
-
- 06 Dec, 2018 1 commit
-
-
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: Eric Myhre <hash@exultant.us>
-
- 21 Oct, 2018 2 commits
-
-
Eric Myhre authored
Finally got the bind and free impls on the same page. Surprisingly, the bind node can work without being a ptr itself. I'm not sure if that'll last, but let's try to roll with it. If we *can* keep that property, it might reduce GC impact in a pretty significant way. Added a 'fluent' package. It's just a twinkle in my eye so far, but it might represent the nicest way through all the discussed issues. Nodes shouldn't have to be panicful; and users shouldn't have to do all error handling manually either. A package full of fluent interfaces that know what's going on seems to be the only way to get both. But we'll see how this shakes out. Maybe typeful traversers will make the whole thing end up more coreward than being relegated to a helper package. I have no idea. Signed-off-by: Eric Myhre <hash@exultant.us>
-
Eric Myhre authored
And add a bunch of type-specific ones for helpfulness. But immediately re-reviewing this further. What we've done here is handle leafs very oddly, because it would seem to avoid unnecessary wrapping on the leaf nodes. But the result seems to be much uglier code than it needs to be, and implies that we've got all sorts of additional special cases required to either handle or reject binds of primitive-kind fields. And that seems... maybe not a great trade. Signed-off-by: Eric Myhre <hash@exultant.us>
-
- 19 Oct, 2018 1 commit
-
-
Eric Myhre authored
This has been sitting on my hard drive quite a while already, so I decided to clean it up juuuust enough that it compiles so I can push it. But as you can see, there's a LOT of TODOs dangling here. I'm not at all still sure those comments about "root node" in the interface are going to stand up to scrutiny over time. There's definitely going to be some distinction between "Node we're traversing" and "Node we are putting in a serialized block of bytes and can think it's reasonable to address by hash", but figuring out the best ergonomics of that is probably going to take a while. I'm going to start on another simpler just-backed-by-maps-n-stuff Node impl before going deeper with this one, because I suspect it'll make tests easier to write, which will then make this whole pile of reflection easier to test down the road as well. Signed-off-by: Eric Myhre <hash@exultant.us>
-
- 29 Aug, 2018 1 commit
-
-
Eric Myhre authored
Hopefully if we come up with a good way to flip one node impl into another, we'll be able to come up with an easy interface for "this is referencing an in-memory structure type of mine, but hashed as CBOR native standard".
-