Commit 72525912 authored by Jeromy's avatar Jeromy

implement path type

parent f0f00316
...@@ -7,7 +7,6 @@ import ( ...@@ -7,7 +7,6 @@ import (
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/code.google.com/p/go.net/context" "github.com/jbenet/go-ipfs/Godeps/_workspace/src/code.google.com/p/go.net/context"
"io" "io"
gopath "path" gopath "path"
"strings"
"time" "time"
mdag "github.com/jbenet/go-ipfs/merkledag" mdag "github.com/jbenet/go-ipfs/merkledag"
...@@ -29,10 +28,7 @@ type Reader struct { ...@@ -29,10 +28,7 @@ type Reader struct {
err error err error
} }
func NewReader(path string, dag mdag.DAGService, resolver *path.Resolver, compression int) (*Reader, error) { func NewReader(path path.Path, dag mdag.DAGService, resolver *path.Resolver, compression int) (*Reader, error) {
if strings.HasPrefix(path, "/ipfs/") {
path = path[6:]
}
reader := &Reader{ reader := &Reader{
signalChan: make(chan struct{}), signalChan: make(chan struct{}),
...@@ -58,7 +54,7 @@ func NewReader(path string, dag mdag.DAGService, resolver *path.Resolver, compre ...@@ -58,7 +54,7 @@ func NewReader(path string, dag mdag.DAGService, resolver *path.Resolver, compre
// writeToBuf will write the data to the buffer, and will signal when there // writeToBuf will write the data to the buffer, and will signal when there
// is new data to read // is new data to read
_, filename := gopath.Split(path) _, filename := gopath.Split(path.String())
go reader.writeToBuf(dagnode, filename, 0) go reader.writeToBuf(dagnode, filename, 0)
return reader, nil return reader, nil
......
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