Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ProtocolBitswap protocol.ID = "/ipfs/bitswap"
Functions ¶
This section is empty.
Types ¶
type BitSwapNetwork ¶
type BitSwapNetwork interface { // SendMessage sends a BitSwap message to a peer. SendMessage( context.Context, peer.ID, bsmsg.BitSwapMessage) error // SendRequest sends a BitSwap message to a peer and waits for a response. SendRequest( context.Context, peer.ID, bsmsg.BitSwapMessage) (incoming bsmsg.BitSwapMessage, err error) // SetDelegate registers the Reciver to handle messages received from the // network. SetDelegate(Receiver) Routing }
BitSwapNetwork provides network connectivity for BitSwap sessions
func NewFromIpfsHost ¶
func NewFromIpfsHost(host host.Host, r routing.IpfsRouting) BitSwapNetwork
NewFromIpfsHost returns a BitSwapNetwork supported by underlying IPFS host
type Receiver ¶
type Receiver interface { ReceiveMessage( ctx context.Context, sender peer.ID, incoming bsmsg.BitSwapMessage) ( destination peer.ID, outgoing bsmsg.BitSwapMessage) ReceiveError(error) // Connected/Disconnected warns bitswap about peer connections PeerConnected(peer.ID) PeerDisconnected(peer.ID) }
Implement Receiver to receive messages from the BitSwapNetwork
Click to show internal directories.
Click to hide internal directories.