Skip to content

Commit

Permalink
chore!: make PBLinkItr private - not intended for public use
Browse files Browse the repository at this point in the history
  • Loading branch information
rvagg committed Mar 8, 2023
1 parent 0601da0 commit a1d0566
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions iter/iter.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@ import (
"github.com/ipld/go-ipld-prime"
)

// PBLinkItr behaves like an list of links iterator, even thought the HAMT behavior is more complicated
type PBLinkItr interface {
// pbLinkItr behaves like an list of links iterator, even thought the HAMT behavior is more complicated
type pbLinkItr interface {
Next() (int64, dagpb.PBLink, error)
Done() bool
}

type TransformNameFunc func(dagpb.String) dagpb.String

func NewUnixFSDirMapIterator(itr PBLinkItr, transformName TransformNameFunc) ipld.MapIterator {
func NewUnixFSDirMapIterator(itr pbLinkItr, transformName TransformNameFunc) ipld.MapIterator {
return &UnixFSDir__MapItr{itr, transformName}
}

// UnixFSDir__MapItr throught the links as if they were a map
// Note: for now it does return links with no name, where the key is just String("")
type UnixFSDir__MapItr struct {
_substrate PBLinkItr
_substrate pbLinkItr
transformName TransformNameFunc
}

Expand Down Expand Up @@ -53,11 +53,11 @@ func (itr *UnixFSDir__MapItr) Done() bool {
}

type UnixFSDir__Itr struct {
_substrate PBLinkItr
_substrate pbLinkItr
transformName TransformNameFunc
}

func NewUnixFSDirIterator(itr PBLinkItr, transformName TransformNameFunc) *UnixFSDir__Itr {
func NewUnixFSDirIterator(itr pbLinkItr, transformName TransformNameFunc) *UnixFSDir__Itr {
return &UnixFSDir__Itr{itr, transformName}
}
func (itr *UnixFSDir__Itr) Next() (k dagpb.String, v dagpb.Link) {
Expand Down

0 comments on commit a1d0566

Please sign in to comment.