Categorygithub.com/ipld/go-codec-dagpb
modulepackage
1.6.0
Repository: https://github.com/ipld/go-codec-dagpb.git
Documentation: pkg.go.dev

# README

go-dagpb

An implementation of the IPLD DAG-PB spec for go-ipld-prime

Use Decode(ipld.NodeAssembler, io.Reader) and Encode(ipld.Node, io.Writer) directly, or import this package to have this codec registered into the go-ipld-prime CID link loader.

Nodes encoded with this codec must conform to the DAG-PB spec. Specifically, they should have the non-optional fields shown in the DAG-PB schema:

type PBNode struct {
  Links [PBLink]
  Data optional Bytes
}

type PBLink struct {
  Hash Link
  Name optional String
  Tsize optional Int
}

Use dagpb.Type.PBNode and friends directly for strictness guarantees. Basic ipld.Nodes will need to have the appropraite fields (and no others) to successfully encode using this codec.

License & Copyright

Copyright © 2020 Protocol Labs

Licensed under either of

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

# Functions

AddSupportToChooser takes an existing node prototype chooser and subs in PBNode for the dag-pb multicodec code.
AppendEncode is like Encode, but it uses a destination buffer directly.
Decode provides an IPLD codec decode interface for DAG-PB data.
DecodeBytes is like Decode, but it uses an input buffer directly.
Deprecated: use Decode instead.
Encode provides an IPLD codec encode interface for DAG-PB data.
Deprecated: use Encode instead.
Deprecated: use Encode instead.
Deprecated: use Decode instead.

# Variables

ErrIntOverflow is returned a varint overflows during decode, it indicates malformed data.
Type is a struct embeding a NodePrototype/Type for every Node implementation in this package.

# Structs

No description provided by the author