blobindex

package
v0.0.0-...-75d1051 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 18, 2026 License: Apache-2.0, MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Archive

func Archive(index ShardedDagIndex, writer io.Writer) error

Archive writes a ShardedDagIndex to a CAR file

func NewDecodeFailureError

func NewDecodeFailureError(reason error) error

NewDecodeFailureError returns an error for a decode failure.

func NewUnknownFormatError

func NewUnknownFormatError(reason error) error

NewUnknownFormatError returns an error for an unknown format.

Types

type MapShardedDagIndex

type MapShardedDagIndex struct {
	// contains filtered or unexported fields
}

MapShardedDagIndex is an in-memory implementation of ShardedDagIndex using MultihashMap.

func Extract

func Extract(r io.Reader) (*MapShardedDagIndex, error)

Extract extracts a sharded dag index from a car

func NewShardedDagIndex

func NewShardedDagIndex(shardSizeHint int) *MapShardedDagIndex

NewShardedDagIndex constructs an empty sharded DAG index. shardSizeHint is used to preallocate the number of shards that will be added. Set to -1 if unknown.

func View

func View(root cid.Cid, blocks map[cid.Cid][]byte) (*MapShardedDagIndex, error)

func (*MapShardedDagIndex) Archive

func (sdi *MapShardedDagIndex) Archive(w io.Writer) error

func (*MapShardedDagIndex) SetSlice

func (sdi *MapShardedDagIndex) SetSlice(shard mh.Multihash, slice mh.Multihash, byteRange Range)

func (*MapShardedDagIndex) Shards

type MultihashMap

type MultihashMap[T any] interface {
	bytemap.ByteMap[mh.Multihash, T]
}

MultihashMap is a map for mapping multihash digests to arbitrary data types.

func NewMultihashMap

func NewMultihashMap[T any](sizeHint int) MultihashMap[T]

NewMultihashMap returns a new map of multihash to a data type

type Range

type Range = dm.RangeModel

Range describes a start and end byte offset within a shard (inclusive).

type ShardedDagIndex

type ShardedDagIndex interface {
	// Index information for shards the DAG is split across.
	Shards() MultihashMap[MultihashMap[Range]]
}

ShardedDagIndex is a blob index for a DAG stored over one or more shards.

Directories

Path Synopsis
gen command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL