Commit 2738d720 authored by Brian Tiger Chow's avatar Brian Tiger Chow

feat(bitswap) add interface

parent dde6ad49
package bitswap
import (
"time"
blocks "github.com/jbenet/go-ipfs/blocks"
u "github.com/jbenet/go-ipfs/util"
)
type Exchange interface {
// Block returns the block associated with a given key.
// TODO(brian): pass a context instead of a timeout
// TODO(brian): rename -> Block
GetBlock(k u.Key, timeout time.Duration) (*blocks.Block, error)
// HasBlock asserts the existence of this block
// TODO(brian): rename -> HasBlock
// TODO(brian): accept a value, not a pointer
// TODO(brian): remove error return value. Should callers be concerned with
// whether the block was made available on the network?
HaveBlock(*blocks.Block) error
}
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