Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConnManager ¶
type ConnManager interface { // TagPeer tags a peer with a string, associating a weight with the tag. TagPeer(peer.ID, string, int) // Untag removes the tagged value from the peer. UntagPeer(p peer.ID, tag string) // GetTagInfo returns the metadata associated with the peer, // or nil if no metadata has been recorded for the peer. GetTagInfo(p peer.ID) *TagInfo // TrimOpenConns terminates open connections based on an implementation-defined // heuristic. TrimOpenConns(ctx context.Context) // Notifee returns an implementation that can be called back to inform of // opened and closed connections. Notifee() inet.Notifiee }
ConnManager tracks connections to peers, and allows consumers to associate metadata with each peer.
It enables connections to be trimmed based on implementation-defined heuristics.
type NullConnMgr ¶
type NullConnMgr struct{}
func (NullConnMgr) GetTagInfo ¶
func (_ NullConnMgr) GetTagInfo(peer.ID) *TagInfo
func (NullConnMgr) Notifee ¶
func (_ NullConnMgr) Notifee() inet.Notifiee
func (NullConnMgr) TrimOpenConns ¶
func (_ NullConnMgr) TrimOpenConns(context.Context)
Click to show internal directories.
Click to hide internal directories.