Commit e57a9ba4 authored by Brian Tiger Chow's avatar Brian Tiger Chow

refac(gcr/s,c) remove network/dialer

remove dialer from GCR client
parent 26109c0e
......@@ -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,
......
......@@ -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,
......
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