• Masih H. Derkani's avatar
    Implement version agnostic streaming CAR block iterator · d0e44a62
    Masih H. Derkani authored
    Implement an iterator over CAR blocks that accepts both v1 and v2. The
    reader only requires io.Reader interface to operate and exposes the
    version and roots of the underlaying CAR file as fields.
    
    Remove `Next` from CARv2 reader now that the iteration functionality is
    provided using `BlockReader`.
    
    Update the benchmarks to reflect the changes and add example usage for
    `NewBlockReader`.
    
    Add tests that assert `BlockReader` behaviour in erroneous and
    successful cases for both underlying CARv1 and CARv2 payload.
    d0e44a62
bench_test.go 1.59 KB