Skip to content

Commit

Permalink
make UnixFSHAMTShard implement the ADL interface (#11)
Browse files Browse the repository at this point in the history
* make UnixFSHAMTShard implement the ADL interface
* add checks that UnixFSBasicDir and PathedPBNode implement the ADL interface
  • Loading branch information
aschmahmann authored Sep 27, 2021
1 parent da54210 commit c7f1fe6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions directory/basicdir.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (

var _ ipld.Node = UnixFSBasicDir(nil)
var _ schema.TypedNode = UnixFSBasicDir(nil)
var _ ipld.ADL = UnixFSBasicDir(nil)

type UnixFSBasicDir = *_UnixFSBasicDir

Expand Down
5 changes: 5 additions & 0 deletions hamt/shardeddir.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const (

var _ ipld.Node = UnixFSHAMTShard(nil)
var _ schema.TypedNode = UnixFSHAMTShard(nil)
var _ ipld.ADL = UnixFSHAMTShard(nil)

// UnixFSHAMTShared is an IPLD Prime Node that provides a read interface
// to a UnixFS HAMT
Expand Down Expand Up @@ -53,6 +54,10 @@ func NewUnixFSHAMTShard(ctx context.Context, substrate dagpb.PBNode, data data.U
}, nil
}

func (n UnixFSHAMTShard) Substrate() ipld.Node {
return n._substrate
}

func (n UnixFSHAMTShard) Kind() ipld.Kind {
return n._substrate.Kind()
}
Expand Down
1 change: 1 addition & 0 deletions pathpbnode.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (

var _ ipld.Node = PathedPBNode(nil)
var _ schema.TypedNode = PathedPBNode(nil)
var _ ipld.ADL = PathedPBNode(nil)

type PathedPBNode = *_PathedPBNode

Expand Down

0 comments on commit c7f1fe6

Please sign in to comment.