Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3-routing
Commits
e57a9ba4
Commit
e57a9ba4
authored
Jan 27, 2015
by
Brian Tiger Chow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refac(gcr/s,c) remove network/dialer
remove dialer from GCR client
parent
26109c0e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
8 deletions
+3
-8
grandcentral/client.go
grandcentral/client.go
+1
-4
grandcentral/server.go
grandcentral/server.go
+2
-4
No files found.
grandcentral/client.go
View file @
e57a9ba4
...
...
@@ -6,7 +6,6 @@ import (
context
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/code.google.com/p/go.net/context"
proto
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/code.google.com/p/goprotobuf/proto"
inet
"github.com/jbenet/go-ipfs/p2p/net"
peer
"github.com/jbenet/go-ipfs/p2p/peer"
routing
"github.com/jbenet/go-ipfs/routing"
pb
"github.com/jbenet/go-ipfs/routing/dht/pb"
...
...
@@ -23,14 +22,12 @@ var ErrTODO = errors.New("TODO")
type
Client
struct
{
peerstore
peer
.
Peerstore
proxy
proxy
.
Proxy
dialer
inet
.
Network
local
peer
.
ID
}
// TODO take in datastore/cache
func
NewClient
(
d
inet
.
Network
,
px
proxy
.
Proxy
,
ps
peer
.
Peerstore
,
local
peer
.
ID
)
(
*
Client
,
error
)
{
func
NewClient
(
px
proxy
.
Proxy
,
ps
peer
.
Peerstore
,
local
peer
.
ID
)
(
*
Client
,
error
)
{
return
&
Client
{
dialer
:
d
,
proxy
:
px
,
local
:
local
,
peerstore
:
ps
,
...
...
grandcentral/server.go
View file @
e57a9ba4
...
...
@@ -4,7 +4,6 @@ import (
context
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/code.google.com/p/go.net/context"
proto
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/code.google.com/p/goprotobuf/proto"
datastore
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-datastore"
inet
"github.com/jbenet/go-ipfs/p2p/net"
peer
"github.com/jbenet/go-ipfs/p2p/peer"
dhtpb
"github.com/jbenet/go-ipfs/routing/dht/pb"
proxy
"github.com/jbenet/go-ipfs/routing/grandcentral/proxy"
...
...
@@ -16,14 +15,13 @@ import (
type
Server
struct
{
local
peer
.
ID
datastore
datastore
.
ThreadSafeDatastore
dialer
inet
.
Network
peerstore
peer
.
Peerstore
*
proxy
.
Loopback
// so server can be injected into client
}
// NewServer creates a new GrandCentral routing Server
func
NewServer
(
ds
datastore
.
ThreadSafeDatastore
,
d
inet
.
Network
,
ps
peer
.
Peerstore
,
local
peer
.
ID
)
(
*
Server
,
error
)
{
s
:=
&
Server
{
local
,
ds
,
d
,
ps
,
nil
}
func
NewServer
(
ds
datastore
.
ThreadSafeDatastore
,
ps
peer
.
Peerstore
,
local
peer
.
ID
)
(
*
Server
,
error
)
{
s
:=
&
Server
{
local
,
ds
,
ps
,
nil
}
s
.
Loopback
=
&
proxy
.
Loopback
{
Handler
:
s
,
Local
:
local
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment