Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PeerLastSeen ¶
type PeerLastSeen struct {
// contains filtered or unexported fields
}
TODO: Merge PeerLastSeen code into common/p2putil? Similar to libp2p's 'identify' package's ObservedAddr, but for IDs rather than specific multiaddresses
func NewPeerLastSeen ¶
func NewPeerLastSeen(dur time.Duration, cb PeerLastSeenCB) (*PeerLastSeen, error)
func (*PeerLastSeen) LastSeen ¶
Returns timestamp of when peer with given 'id' was last seen Use absolute time rather than duration in case 'id' is not in the map and we return the default 0-value
func (*PeerLastSeen) UpdateLastSeen ¶
func (pls *PeerLastSeen) UpdateLastSeen(id peer.ID) error
type PeerLastSeenCB ¶
Click to show internal directories.
Click to hide internal directories.