Skip to content

Commit

Permalink
client fixes + deps
Browse files Browse the repository at this point in the history
  • Loading branch information
djdv committed Sep 4, 2019
1 parent f4be172 commit 146cd24
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 14 deletions.
4 changes: 2 additions & 2 deletions plugin/plugins/filesystem/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"runtime"
"strings"

"github.com/hugelgupf/p9/p9"
"github.com/djdv/p9/p9"
config "github.com/ipfs/go-ipfs-config"
"github.com/ipfs/go-ipfs/plugin/plugins/filesystem"
logging "github.com/ipfs/go-log"
Expand Down Expand Up @@ -86,7 +86,7 @@ func ReadDir(path string, fsRef p9.File, offset uint64) ([]p9.Dirent, error) {
}
logger.Debugf("walked to %q :\nQIDs:%v, FID:%v\n\n", path, qids, targetRef)

if _, _, err = targetRef.Open(0); err != nil {
if _, _, err = targetRef.Open(p9.ReadOnly); err != nil {
return nil, err
}

Expand Down
7 changes: 4 additions & 3 deletions plugin/plugins/filesystem/client/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ func main() {
logger := logging.Logger("fs-client")
logging.SetLogLevel("fs-client", "info")

client, err := p9client.Dial()
//client, err := p9client.Dial()
client, err := p9client.Dial(p9client.Address("/ip4/127.0.0.1/tcp/564"))
if err != nil {
log.Fatal(err)
}
Expand All @@ -26,8 +27,8 @@ func main() {
logger.Infof("Attached to root:\n%#v\n\n", rootRef)

logger.Info(p9client.ReadDir("/", rootRef, 0))
logger.Info(p9client.ReadDir("/ipfs", rootRef, 0))
logger.Info(p9client.ReadDir("/ipfs/QmS4ustL54uo8FzR9455qaxZwuMiUhyvMcX9Ba8nUH4uVv", rootRef, 0))
//logger.Info(p9client.ReadDir("/ipfs", rootRef, 0))
//logger.Info(p9client.ReadDir("/ipfs/QmS4ustL54uo8FzR9455qaxZwuMiUhyvMcX9Ba8nUH4uVv", rootRef, 0))
//readDBG("/ipfs/QmPZ9gcCEpqKTo6aq61g2nXGUhM4iCL3ewB6LDXZCtioEB", rootRef)
client.Close()
}
2 changes: 1 addition & 1 deletion plugin/plugins/filesystem/filesystem.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"encoding/json"
"path/filepath"

"github.com/hugelgupf/p9/p9"
"github.com/djdv/p9/p9"
plugin "github.com/ipfs/go-ipfs/plugin"
fsnodes "github.com/ipfs/go-ipfs/plugin/plugins/filesystem/nodes"
logging "github.com/ipfs/go-log"
Expand Down
4 changes: 2 additions & 2 deletions plugin/plugins/filesystem/nodes/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package fsnodes
import (
"context"

"github.com/hugelgupf/p9/p9"
"github.com/hugelgupf/p9/unimplfs"
"github.com/djdv/p9/p9"
"github.com/djdv/p9/unimplfs"
logging "github.com/ipfs/go-log"
coreiface "github.com/ipfs/interface-go-ipfs-core"
corepath "github.com/ipfs/interface-go-ipfs-core/path"
Expand Down
2 changes: 1 addition & 1 deletion plugin/plugins/filesystem/nodes/ipfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"io"

"github.com/hugelgupf/p9/p9"
"github.com/djdv/p9/p9"
files "github.com/ipfs/go-ipfs-files"
logging "github.com/ipfs/go-log"
coreiface "github.com/ipfs/interface-go-ipfs-core"
Expand Down
4 changes: 2 additions & 2 deletions plugin/plugins/filesystem/nodes/pinfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
gopath "path"

"github.com/hugelgupf/p9/p9"
"github.com/djdv/p9/p9"
logging "github.com/ipfs/go-log"
coreiface "github.com/ipfs/interface-go-ipfs-core"
coreoptions "github.com/ipfs/interface-go-ipfs-core/options"
Expand All @@ -15,7 +15,7 @@ type PinFS struct {
}

//TODO: [review] check fields
func initPinFS(ctx context.Context, core coreiface.CoreAPI, logger logging.EventLogger) p9.Attacher {
func InitPinFS(ctx context.Context, core coreiface.CoreAPI, logger logging.EventLogger) p9.Attacher {
pd := &PinFS{
IPFSBase: IPFSBase{
Path: newRootPath("/ipfs"),
Expand Down
4 changes: 2 additions & 2 deletions plugin/plugins/filesystem/nodes/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"fmt"

"github.com/hugelgupf/p9/p9"
"github.com/djdv/p9/p9"
cid "github.com/ipfs/go-cid"
logging "github.com/ipfs/go-log"
coreiface "github.com/ipfs/interface-go-ipfs-core"
Expand Down Expand Up @@ -99,7 +99,7 @@ func (ri *RootIndex) Walk(names []string) ([]p9.QID, p9.File, error) {
//NOTE: if doClone is false, it implies len(names) > 0
switch names[0] {
case "ipfs":
pinDir, err := initPinFS(ri.Ctx, ri.core, ri.Logger).Attach()
pinDir, err := InitPinFS(ri.Ctx, ri.core, ri.Logger).Attach()
if err != nil {
return nil, nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion plugin/plugins/filesystem/nodes/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"hash/fnv"
"time"

"github.com/hugelgupf/p9/p9"
"github.com/djdv/p9/p9"
"github.com/ipfs/go-cid"
ipld "github.com/ipfs/go-ipld-format"
logging "github.com/ipfs/go-log"
Expand Down

0 comments on commit 146cd24

Please sign in to comment.