metadata

package
v0.13.10 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Prototype struct {
	Metadata schema.TypedPrototype
}

Functions

func EncodeMetadata

func EncodeMetadata(entries Metadata) datamodel.Node

EncodeMetadata encodes metadata to an IPLD node then serializes to raw bytes

Types

type Item

type Item struct {
	Link         cid.Cid
	BlockPresent bool
}

Item is a single link traversed in a repsonse

type Metadata

type Metadata []Item

Metadata is information about metadata contained in a response, which can be serialized back and forth to bytes

func DecodeMetadata

func DecodeMetadata(data datamodel.Node) (Metadata, error)

DecodeMetadata assembles metadata from a raw byte array, first deserializing as a node and then assembling into a metadata struct.

func (Metadata) ToGraphSyncMetadata

func (md Metadata) ToGraphSyncMetadata() []message.GraphSyncLinkMetadatum

Jump to

Keyboard shortcuts

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