metadata

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2022 License: Apache-2.0, MIT Imports: 8 Imported by: 0

Documentation

Overview

Package metadata captures the metadata types known by the index-provider.

The metadata is used to provide information about how to retrieve data blocks associated to multihashes advertised by a provider. It is represented as an array of bytes in the indexer protocol, starting with a varint ProtocolID that defines how to decode the remaining bytes.

Two metadata types are currently represented here: BitswapMetadata and GraphsyncFilecoinV1Metadata.

Index

Constants

This section is empty.

Variables

View Source
var BitswapMetadata = stiapi.Metadata{
	ProtocolID: multicodec.TransportBitswap,
}

BitswapMetadata represents the indexing metadata that uses multicodec.TransportBitswap.

Functions

This section is empty.

Types

type ErrNotGraphsyncFilecoinV1 added in v0.5.0

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

ErrNotGraphsyncFilecoinV1 indicates a protocol does not use graphsync filecoin v1 transport. See: multicodec.TransportGraphsyncFilecoinv1.

func (ErrNotGraphsyncFilecoinV1) Error added in v0.5.0

type GraphsyncFilecoinV1Metadata added in v0.5.0

type GraphsyncFilecoinV1Metadata struct {
	// PieceCID identifies the piece this data can be found in
	PieceCID cid.Cid
	// VerifiedDeal indicates if the deal is verified
	VerifiedDeal bool
	// FastRetrieval indicates whether the provider claims there is an unsealed copy
	FastRetrieval bool
}

GraphsyncFilecoinV1Metadata represents the indexing metadata for multicodec.TransportGraphsyncFilecoinv1.

func (*GraphsyncFilecoinV1Metadata) FromIndexerMetadata added in v0.5.0

func (dtm *GraphsyncFilecoinV1Metadata) FromIndexerMetadata(m stiapi.Metadata) error

FromIndexerMetadata decodes the indexer metadata format into GraphsyncFilecoinV1Metadata if the protocol ID of the given metadata matches multicodec.TransportGraphsyncFilecoinv1. Otherwise, ErrNotGraphsyncFilecoinV1 error is returned.

func (*GraphsyncFilecoinV1Metadata) ToIndexerMetadata added in v0.5.0

func (dtm *GraphsyncFilecoinV1Metadata) ToIndexerMetadata() (stiapi.Metadata, error)

ToIndexerMetadata converts GraphsyncFilecoinV1Metadata into indexer Metadata format.

Jump to

Keyboard shortcuts

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