-
Notifications
You must be signed in to change notification settings - Fork 6
/
doc.go
31 lines (25 loc) · 995 Bytes
/
doc.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/*
Package dagpb provides an implementation of the IPLD DAG-PB spec
(https://github.com/ipld/specs/blob/master/block-layer/codecs/dag-pb.md) for
go-ipld-prime (https://github.com/ipld/go-ipld-prime/).
Use Decode() and Encode() directly, or import this package to have this codec
registered into the go-ipld-prime multicodec registry and available from the
cidlink.DefaultLinkSystem.
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.Node's will need to have the appropriate fields (and no others) to
successfully encode using this codec.
*/
package dagpb
//go:generate go run gen.go
//go:generate gofmt -w ipldsch_minima.go ipldsch_satisfaction.go ipldsch_types.go