doc.go 983 Bytes
Newer Older
Rod Vagg's avatar
Rod Vagg committed
1
/*
2 3 4
Package dagpb provides an implementation of the LD DAG-PB spec
(https://gitlab.dms3.io/ld/specs/blob/master/block-layer/codecs/dag-pb.md) for
go-ld-prime (https://gitlab.dms3.io/ld/go-ld-prime/).
Rod Vagg's avatar
Rod Vagg committed
5

6
Use Decode() and Encode() directly, or import this package to have this codec
7
registered into the go-ld-prime multicodec registry and available from the
8
cidlink.DefaultLinkSystem.
Rod Vagg's avatar
Rod Vagg committed
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24

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
25
ld.Node's will need to have the appropriate fields (and no others) to
Rod Vagg's avatar
Rod Vagg committed
26 27 28
successfully encode using this codec.
*/
package dagpb
29 30

//go:generate go run gen.go
31
//go:generate gofmt -w ldsch_minima.go ldsch_satisfaction.go ldsch_types.go