Documentation ¶
Index ¶
- func DisableLog()
- func UseLogger(logger btclog.Logger)
- type ObjectManager
- func (om *ObjectManager) DonePeer(p *peer.Peer)
- func (om *ObjectManager) HandleInsert(object *wire.MsgObject) uint64
- func (om *ObjectManager) HaveInventory(invVect *wire.InvVect) (bool, error)
- func (om *ObjectManager) NewPeer(p *peer.Peer)
- func (om *ObjectManager) QueueInv(inv *wire.MsgInv, p *peer.Peer)
- func (om *ObjectManager) QueueObject(object *wire.MsgObject, p *peer.Peer)
- func (om *ObjectManager) ReadyPeer(p *peer.Peer)
- func (om *ObjectManager) Start()
- func (om *ObjectManager) Stop() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DisableLog ¶
func DisableLog()
DisableLog disables all library log output. Logging output is disabled by default until either UseLogger or SetLogWriter are called.
Types ¶
type ObjectManager ¶
type ObjectManager struct {
// contains filtered or unexported fields
}
ObjectManager provides a concurrency safe object manager for handling all incoming and outgoing.
func NewObjectManager ¶
func NewObjectManager(s server, db database.Db, requestExpire, cleanupInterval time.Duration) *ObjectManager
NewObjectManager returns a new bitmessage object manager. Use Start to begin processing objects and inv messages asynchronously.
func (*ObjectManager) DonePeer ¶
func (om *ObjectManager) DonePeer(p *peer.Peer)
DonePeer informs the object manager that a peer has disconnected.
func (*ObjectManager) HandleInsert ¶
func (om *ObjectManager) HandleInsert(object *wire.MsgObject) uint64
HandleInsert inserts a new object into the database and relays it to the peers.
func (*ObjectManager) HaveInventory ¶
func (om *ObjectManager) HaveInventory(invVect *wire.InvVect) (bool, error)
HaveInventory returns whether or not the inventory represented by the passed inventory vector is known. This includes checking all of the various places inventory can be.
func (*ObjectManager) NewPeer ¶
func (om *ObjectManager) NewPeer(p *peer.Peer)
NewPeer informs the object manager of a newly active peer.
func (*ObjectManager) QueueInv ¶
func (om *ObjectManager) QueueInv(inv *wire.MsgInv, p *peer.Peer)
QueueInv adds the passed inv message and peer to the object handling queue.
func (*ObjectManager) QueueObject ¶
func (om *ObjectManager) QueueObject(object *wire.MsgObject, p *peer.Peer)
QueueObject adds the passed object message and peer to the object handling queue.
func (*ObjectManager) ReadyPeer ¶
func (om *ObjectManager) ReadyPeer(p *peer.Peer)
ReadyPeer signals that a peer is ready to download more objects.
func (*ObjectManager) Start ¶
func (om *ObjectManager) Start()
Start begins the core object handler which processes object messages.
func (*ObjectManager) Stop ¶
func (om *ObjectManager) Stop() error
Stop gracefully shuts down the object manager by stopping all asynchronous handlers and waiting for them to finish.