Documentation ¶
Index ¶
Constants ¶
View Source
const DefaultReconnectInterval = 5 * time.Second
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConnectionStatus ¶
type ConnectionStatus string
ConnectionStatus is an enum for the peer connection status in the gossip layer.
const ( // ConnStatusDisconnected means that there is no real connection established in the gossip layer for that peer. ConnStatusDisconnected ConnectionStatus = "disconnected" // ConnStatusConnected means that there is a real connection established in the gossip layer for that peer. ConnStatusConnected ConnectionStatus = "connected" )
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
DB is the peer database, storing previously seen peers and any collected properties of them.
func (*DB) UpdatePeer ¶
UpdatePeer updates a peer in the database.
type Peer ¶
type Peer struct { ID peer.ID PublicKey ed25519.PublicKey PeerAddresses []multiaddr.Multiaddr ConnStatus *atomic.Value RemoveCh chan struct{} DoneCh chan struct{} }
func NewPeerFromAddrInfo ¶
func NewPeerFromMultiAddr ¶
func (*Peer) GetConnStatus ¶
func (p *Peer) GetConnStatus() ConnectionStatus
func (*Peer) SetConnStatus ¶
func (p *Peer) SetConnStatus(cs ConnectionStatus)
func (*Peer) ToAddrInfo ¶
type PeerDescriptor ¶
type PeerDescriptor struct {
Addresses []multiaddr.Multiaddr `json:"addresses"`
}
PeerDescriptor defines a peer record in the manual peering layer.
Click to show internal directories.
Click to hide internal directories.