Commit 1382a525 authored by Brian Tiger Chow's avatar Brian Tiger Chow

refac(exchange) bitswap -> exchange/bitswap

Move go-ipfs/bitswap package to go-ipfs/exchange/bitswap

* Delineates the difference between the generic exchange interface and
  implementations (eg. BitSwap protocol)

  Thus, the bitswap protocol can be refined without having to overthink
  how future exchanges will work. Aspects common to BitSwap and other
  exchanges can be extracted out to the exchange package in piecemeal.

  Future exchange implementations can be placed in sibling packages next
  to exchange/bitswap. (eg. exchange/multilateral)
parent f6e006bd
......@@ -5,8 +5,8 @@ import (
"time"
ds "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/datastore.go"
bitswap "github.com/jbenet/go-ipfs/bitswap"
blocks "github.com/jbenet/go-ipfs/blocks"
exchange "github.com/jbenet/go-ipfs/exchange"
u "github.com/jbenet/go-ipfs/util"
mh "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multihash"
......@@ -16,11 +16,11 @@ import (
// It uses an internal `datastore.Datastore` instance to store values.
type BlockService struct {
Datastore ds.Datastore
Remote bitswap.Exchange
Remote exchange.Exchange
}
// NewBlockService creates a BlockService with given datastore instance.
func NewBlockService(d ds.Datastore, rem bitswap.Exchange) (*BlockService, error) {
func NewBlockService(d ds.Datastore, rem exchange.Exchange) (*BlockService, error) {
if d == nil {
return nil, fmt.Errorf("BlockService requires valid datastore")
}
......
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