1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-09-15 19:37:28 +08:00
Files
kubo/exchange/interface.go
2014-09-22 04:06:15 -07:00

21 lines
588 B
Go

package exchange
import (
context "github.com/jbenet/go-ipfs/Godeps/_workspace/src/code.google.com/p/go.net/context"
blocks "github.com/jbenet/go-ipfs/blocks"
u "github.com/jbenet/go-ipfs/util"
)
// Any type that implements exchange.Interface may be used as an IPFS block
// exchange protocol.
type Interface interface {
// Block returns the block associated with a given key.
Block(context.Context, u.Key) (*blocks.Block, error)
// TODO Should callers be concerned with whether the block was made
// available on the network?
HasBlock(context.Context, blocks.Block) error
}