mirror of
https://github.com/ipfs/kubo.git
synced 2025-09-10 14:34:24 +08:00

- Modified Godeps/Godeps.json by hand - [TEST] Updated welcome docs hash to sharness - [TEST] Updated contact doc - [TEST] disabled breaking test (t0080-repo refs local)
26 lines
722 B
Go
26 lines
722 B
Go
// package exchange defines the IPFS Exchange interface
|
|
package exchange
|
|
|
|
import (
|
|
"io"
|
|
|
|
context "github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context"
|
|
blocks "github.com/ipfs/go-ipfs/blocks"
|
|
u "github.com/ipfs/go-ipfs/util"
|
|
)
|
|
|
|
// Any type that implements exchange.Interface may be used as an IPFS block
|
|
// exchange protocol.
|
|
type Interface interface {
|
|
// GetBlock returns the block associated with a given key.
|
|
GetBlock(context.Context, u.Key) (*blocks.Block, error)
|
|
|
|
GetBlocks(context.Context, []u.Key) (<-chan *blocks.Block, error)
|
|
|
|
// TODO Should callers be concerned with whether the block was made
|
|
// available on the network?
|
|
HasBlock(context.Context, *blocks.Block) error
|
|
|
|
io.Closer
|
|
}
|