• Eric Myhre's avatar
    cid impl via struct and via string together. · c724ad0d
    Eric Myhre authored
    Added back in some of the parser methods.  (These were previously named "Cast"
    and I think that's silly and wrong so I fixed it.)
    
    Functions are named overly-literally with their type (e.g. ParseCidString and
    ParseCidStruct rather than ParseCid or even just Parse) because for this
    research package I don't want to bother with many sub-packages.  (Maybe I'll
    regret this, but at the moment it seems simpler to hold back on sub-packages.)
    
    Functions that produce Cids are literal with their return types, as well.
    Part of the purpose of this research package is going to be to concretely
    benchmark exactly how much performance overhead there is to using interfaces
    (which will likely cause a lot of boxing and unboxing in practice) -- since we
    want to explore where this boxing happens and how much it costs, it's important
    that none of our basic implementation functions do the boxing!
    
    The entire set of codec enums came along in this commit.  Ah well; they would
    have eventually anyway, I guess.  But it's interesting to note the only thing
    that dragged them along so far is the reference to 'DagProtobuf' when
    constructing v0 CIDs; otherwise, this enum is quite unused here.
    c724ad0d
misc.go 168 Bytes