metadata

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2022 License: Apache-2.0, MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EncodeMetadata

func EncodeMetadata(entries Metadata) ([]byte, error)

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

func (*Item) MarshalCBOR added in v0.2.0

func (t *Item) MarshalCBOR(w io.Writer) error

func (*Item) UnmarshalCBOR added in v0.2.0

func (t *Item) UnmarshalCBOR(r io.Reader) error

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 []byte) (Metadata, error)

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

Jump to

Keyboard shortcuts

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