Add a 'justString' implementation.
This is meant to be about the cheapest implementation of Node possible. It's important to have this given how often we need string nodes. In the example of the moment: in writing some typed.Node systems, I need some intermediate string nodes just to nudge around map processes. Those nodes need to be handy and their implementation must be cheap. It's also useful that we can have a constructor which doesn't return errors, so it's easier to chain. The NodeBuilder features are restrained to needing to be able to yield errors for interface satisfaction purposes, in turn needed for more complex features. But when building a specific node, there's no reason we need to go through NodeBuilder at all. I'm putting this in the ipldfree package at the moment. I wouldn't mind putting a constructor for this in the root ipld package as well, but that would either mean a cyclic import or putting this implementation as a blessed one in the main package. (Putting this as a blessed default implementation in the main package is possible, and can be considered later, but is a "not today" thing; having these implementations in a subpackage is a good forcing-function for development to make sure we don't accidentally leave any important things unexported in the main package.)
Showing
impl/free/justString.go
0 → 100644
impl/util/iteratorThunks.go
0 → 100644
Please register or sign in to comment