Skip to content

An implementation of the DAG-PB spec for Go

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

ipld/go-codec-dagpb

Folders and files

NameName
Last commit message
Last commit date
Mar 22, 2024
Sep 28, 2020
Dec 8, 2020
Dec 8, 2020
Mar 15, 2021
Apr 20, 2021
Mar 16, 2022
Apr 7, 2021
Aug 25, 2022
Aug 25, 2022
Feb 16, 2025
Feb 11, 2025
Apr 7, 2021
Aug 12, 2021
Aug 25, 2022
Feb 15, 2022
Mar 30, 2021
Aug 25, 2022
Feb 11, 2025

Repository files navigation

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.