Unverified Commit a0fe2b43 authored by Steven Allen's avatar Steven Allen Committed by GitHub

Merge pull request #28 from ipld/chore/allow-node-getter

feat: only require the NodeGetter interface instead of the DAG interface
parents 3e2cf7af 8a301457
......@@ -33,18 +33,18 @@ type CarHeader struct {
}
type carWriter struct {
ds format.DAGService
ds format.NodeGetter
w io.Writer
walk WalkFunc
}
type WalkFunc func(format.Node) ([]*format.Link, error)
func WriteCar(ctx context.Context, ds format.DAGService, roots []cid.Cid, w io.Writer) error {
func WriteCar(ctx context.Context, ds format.NodeGetter, roots []cid.Cid, w io.Writer) error {
return WriteCarWithWalker(ctx, ds, roots, w, DefaultWalkFunc)
}
func WriteCarWithWalker(ctx context.Context, ds format.DAGService, roots []cid.Cid, w io.Writer, walk WalkFunc) error {
func WriteCarWithWalker(ctx context.Context, ds format.NodeGetter, roots []cid.Cid, w io.Writer, walk WalkFunc) error {
h := &CarHeader{
Roots: roots,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment