Versions in this module Expand all Collapse all v2 v2.0.3 Aug 30, 2021 Changes in this version + const CharacteristicsSize + const HeaderSize + const PragmaSize + var ErrAlreadyV1 = errors.New("already a CARv1") + var Pragma = []byte + func AttachIndex(path string, idx index.Index, offset uint64) error + func ExtractV1File(srcPath, dstPath string) (err error) + func GenerateIndex(v1r io.Reader, opts ...ReadOption) (index.Index, error) + func GenerateIndexFromFile(path string) (index.Index, error) + func ReadOrGenerateIndex(rs io.ReadSeeker, opts ...ReadOption) (index.Index, error) + func ReadVersion(r io.Reader) (uint64, error) + func WrapV1(src io.ReadSeeker, dst io.Writer) error + func WrapV1File(srcPath, dstPath string) error + type BlockReader struct + Roots []cid.Cid + Version uint64 + func NewBlockReader(r io.Reader, opts ...ReadOption) (*BlockReader, error) + func (br *BlockReader) Next() (blocks.Block, error) + type Characteristics struct + Hi uint64 + Lo uint64 + func (c *Characteristics) ReadFrom(r io.Reader) (int64, error) + func (c Characteristics) WriteTo(w io.Writer) (n int64, err error) + type Header struct + Characteristics Characteristics + DataOffset uint64 + DataSize uint64 + IndexOffset uint64 + func NewHeader(dataSize uint64) Header + func (h *Header) ReadFrom(r io.Reader) (int64, error) + func (h Header) HasIndex() bool + func (h Header) WithDataPadding(padding uint64) Header + func (h Header) WithDataSize(size uint64) Header + func (h Header) WithIndexPadding(padding uint64) Header + func (h Header) WriteTo(w io.Writer) (n int64, err error) + type ReadOption func(*ReadOptions) + func ZeroLengthSectionAsEOF(enable bool) ReadOption + type ReadOptions struct + BlockstoreUseWholeCIDs bool + ZeroLengthSectionAsEOF bool + type ReadWriteOption interface + type Reader struct + Header Header + Version uint64 + func NewReader(r io.ReaderAt, opts ...ReadOption) (*Reader, error) + func OpenReader(path string, opts ...ReadOption) (*Reader, error) + func (r *Reader) Close() error + func (r *Reader) DataReader() SectionReader + func (r *Reader) IndexReader() io.Reader + func (r *Reader) Roots() ([]cid.Cid, error) + type SectionReader interface + type WriteOption func(*WriteOptions) + func UseDataPadding(p uint64) WriteOption + func UseIndexPadding(p uint64) WriteOption + type WriteOptions struct + BlockstoreAllowDuplicatePuts bool + DataPadding uint64 + IndexPadding uint64 Other modules containing this package gitlab.dms3.io/ld/go-car