Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BitSwapMessage ¶
type BitSwapMessage interface {
// Wantlist returns a slice of unique keys that represent data wanted by
// the sender.
Wantlist() []Entry
// Blocks returns a slice of unique blocks.
Blocks() []blocks.Block
// AddEntry adds an entry to the Wantlist.
AddEntry(key cid.Cid, priority int)
Cancel(key cid.Cid)
Empty() bool
// A full wantlist is an authoritative copy, a 'non-full' wantlist is a patch-set
Full() bool
AddBlock(blocks.Block)
Exportable
Loggable() map[string]interface{}
}
BitSwapMessage is the basic interface for interacting building, encoding, and decoding messages sent on the BitSwap protocol.
func FromNet ¶
func FromNet(r io.Reader) (BitSwapMessage, error)
FromNet generates a new BitswapMessage from incoming data on an io.Reader.
func FromPBReader ¶
func FromPBReader(pbr ggio.Reader) (BitSwapMessage, error)
FromPBReader generates a new Bitswap message from a gogo-protobuf reader
Click to show internal directories.
Click to hide internal directories.