• Masih H. Derkani's avatar
    Unexport unecesserry index APIs and integrate with mulitcodec · 2b593c11
    Masih H. Derkani authored
    Use the codec dedicated to CAR index sorted when marshalling and
    unmarshalling `indexSorted`. Note, the code depends on a specific commit
    of `go-multicodec` `master` branch. This needs to be replaced with a tag
    once a release is made on the go-multicodec side later.
    
    Unexport index APIs that should not be exposed publicly. Remove
    `Builder` now that it is not needed anywhere. Move `insertionIndex` into
    `blockstore` package since that's the only place it is used.
    
    Introduce an index constructor that takes multicodec code and
    instantiates an index.
    
    Fix ignored errors in `indexsorted.go` during marshalling/unmarshlling.
    
    Rename index constructor functions to use consistent terminology; i.e.
    `new` instead if `mk`.
    
    Remove redundant TODOs in code.
    
    Relates to:
    - https://github.com/multiformats/go-multicodec/pull/46
    
    Address review comments
    
    * Rename constructor of index by codec to a simpler name and update
    docs.
    
    * Use multicodec.Code as constant instead of wrappint unit64 every time.
    2b593c11
indexhashed.go 836 Bytes