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 ¶
NewDecodeFailureError returns an error for a decode failure.
func NewUnknownFormatError ¶
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 (*MapShardedDagIndex) Shards ¶
func (sdi *MapShardedDagIndex) Shards() MultihashMap[MultihashMap[Range]]
type MultihashMap ¶
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.