Skip to content

Commit

Permalink
Merge pull request #28 from ipld/chore/allow-node-getter
Browse files Browse the repository at this point in the history
feat: only require the NodeGetter interface instead of the DAG interface
  • Loading branch information
Stebalien authored Mar 27, 2020
2 parents 3e2cf7a + 8a30145 commit a0fe2b4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions car.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit a0fe2b4

Please sign in to comment.