Skip to content

Commit

Permalink
add RootPath docs
Browse files Browse the repository at this point in the history
  • Loading branch information
djdv committed Dec 11, 2019
1 parent 76d7d79 commit 0167805
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions plugin/plugins/filesystem/meta/meta_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package meta

import corepath "github.com/ipfs/interface-go-ipfs-core/path"

func ExampleRootPath() {
VirtualRootCid := RootPath("/ipfs").Cid()
iPath := corepath.Join(RootPath("/ipfs"), "Qm...")
}
1 change: 1 addition & 0 deletions plugin/plugins/filesystem/meta/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ func IpldStat(ctx context.Context, attr *p9.Attr, node ipld.Node, mask p9.AttrMa
return filledAttrs, nil
}

// RootPath wraps a namespace string path as a CoreAPI compatible path
type RootPath string

func (rp RootPath) String() string { return string(rp) }
Expand Down

0 comments on commit 0167805

Please sign in to comment.