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: Bitswap and GraphsyncFilecoinV1.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bitswap ¶ added in v0.5.1
type Bitswap struct {
}
Bitswap represents the indexing metadata that uses multicodec.TransportBitswap.
func (Bitswap) MarshalBinary ¶ added in v0.5.1
func (Bitswap) UnmarshalBinary ¶ added in v0.5.1
type ErrInvalidMetadata ¶ added in v0.5.1
type ErrInvalidMetadata struct {
Message string
}
func (ErrInvalidMetadata) Error ¶ added in v0.5.1
func (e ErrInvalidMetadata) Error() string
type GraphsyncFilecoinV1 ¶ added in v0.5.1
type GraphsyncFilecoinV1 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
}
GraphsyncFilecoinV1 represents the indexing metadata for multicodec.TransportGraphsyncFilecoinv1.
func (*GraphsyncFilecoinV1) ID ¶ added in v0.5.1
func (dtm *GraphsyncFilecoinV1) ID() multicodec.Code
func (*GraphsyncFilecoinV1) MarshalBinary ¶ added in v0.5.1
func (dtm *GraphsyncFilecoinV1) MarshalBinary() ([]byte, error)
MarshalBinary implements encoding.BinaryMarshaler.
func (*GraphsyncFilecoinV1) ReadFrom ¶ added in v0.5.1
func (dtm *GraphsyncFilecoinV1) ReadFrom(r io.Reader) (n int64, err error)
func (*GraphsyncFilecoinV1) UnmarshalBinary ¶ added in v0.5.1
func (dtm *GraphsyncFilecoinV1) UnmarshalBinary(data []byte) error
UnmarshalBinary implements encoding.BinaryUnmarshaler.
type Metadata ¶ added in v0.5.1
type Metadata struct {
// contains filtered or unexported fields
}
Metadata is data that provides information about how to retrieve the advertised content. Note that the content may be avaiable for retrieval over multiple protocols.
func (Metadata) Equal ¶ added in v0.5.1
Equal checks whether this Metadata is equal with the other Metadata. The two are considered equal if they have the same transports with the same order.
func (*Metadata) MarshalBinary ¶ added in v0.5.1
MarshalBinary implements encoding.BinaryMarshaler.
func (*Metadata) UnmarshalBinary ¶ added in v0.5.1
UnmarshalBinary implements encoding.BinaryUnmarshaler.
type Protocol ¶ added in v0.5.1
type Protocol interface {
encoding.BinaryMarshaler
encoding.BinaryUnmarshaler
io.ReaderFrom // Implement io.ReaderFrom so that transport can be incrementally decoded.
// ID is the multicodec of the transport protocol represented by this Protocol.
ID() multicodec.Code
}
Protocol represents the retrieval transport protocol of an advertisement.