Documentation ¶
Overview ¶
package decision implements the decision engine for the bitswap service.
Index ¶
- Variables
- type Engine
- func (e *Engine) AddBlock(block blocks.Block)
- func (e *Engine) LedgerForPeer(p peer.ID) *Receipt
- func (e *Engine) MessageReceived(p peer.ID, m bsmsg.BitSwapMessage) error
- func (e *Engine) MessageSent(p peer.ID, m bsmsg.BitSwapMessage) error
- func (e *Engine) Outbox() <-chan (<-chan *Envelope)
- func (e *Engine) PeerConnected(p peer.ID)
- func (e *Engine) PeerDisconnected(p peer.ID)
- func (e *Engine) Peers() []peer.ID
- func (e *Engine) WantlistForPeer(p peer.ID) (out []*wl.Entry)
- type Envelope
- type Receipt
Constants ¶
This section is empty.
Variables ¶
View Source
var FIFO = func(a, b *peerRequestTask) bool {
return a.created.Before(b.created)
}
FIFO is a basic task comparator that returns tasks in the order created.
View Source
var V1 = func(a, b *peerRequestTask) bool { if a.Target == b.Target { return a.Priority > b.Priority } return FIFO(a, b) }
V1 respects the target peer's wantlist priority. For tasks involving different peers, the oldest task is prioritized.
Functions ¶
This section is empty.
Types ¶
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
func (*Engine) MessageReceived ¶
MessageReceived performs book-keeping. Returns error if passed invalid arguments.
func (*Engine) MessageSent ¶
func (*Engine) PeerConnected ¶
func (*Engine) PeerDisconnected ¶
Click to show internal directories.
Click to hide internal directories.