index

package
v0.1.16 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MultiIndexSorted

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

func NewMultiIndexSorted

func NewMultiIndexSorted(sizeOfBucket uint32) *MultiIndexSorted

NewMultiIndexSorted creates a new MultiIndexSorted with the specified bucket size.

func (*MultiIndexSorted) BucketCount

func (m *MultiIndexSorted) BucketCount() uint32

BucketCount returns the number of buckets in the MultiIndex.

func (*MultiIndexSorted) Codec

func (m *MultiIndexSorted) Codec() multicodec.Code

Codec returns the multicodec code for the MultiIndex.

func (*MultiIndexSorted) ForEach

func (m *MultiIndexSorted) ForEach(f func(mh multihash.Multihash, offset uint64) error) error

ForEach iterates over all records in the MultiIndex and calls the provided function for each one.

func (*MultiIndexSorted) GetAll

func (m *MultiIndexSorted) GetAll(c cid.Cid, fn func(uint64) bool) error

GetAll searches for all occurrences of a CID and calls the provided function for each one.

func (*MultiIndexSorted) GetBucketRecords

func (m *MultiIndexSorted) GetBucketRecords(index uint32) (uint32, []*index.Record, error)

GetBucketRecords returns the records of a specific bucket by its index.

func (*MultiIndexSorted) Load

func (m *MultiIndexSorted) Load(records []index.Record) error

Load loads a list of records into the MultiIndex.

func (*MultiIndexSorted) Marshal

func (m *MultiIndexSorted) Marshal(w io.Writer) (uint64, error)

Marshal writes the MultiIndex struct to a writer.

func (*MultiIndexSorted) TotalRecordCount

func (m *MultiIndexSorted) TotalRecordCount() uint32

TotalRecordCount returns the total number of records in the MultiIndex.

func (*MultiIndexSorted) Unmarshal

func (m *MultiIndexSorted) Unmarshal(r io.Reader) error

Unmarshal reads the MultiIndex struct from a reader.

Jump to

Keyboard shortcuts

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