Documentation ¶
Index ¶
- Constants
- type Peer
- type PeerSet
- func (ps *PeerSet) CloseSession(id int)
- func (ps *PeerSet) FindSession(id int) *Session
- func (ps *PeerSet) GetPeer(pid peer.ID) Peer
- func (ps *PeerSet) GetPeerList() []Peer
- func (ps *PeerSet) HasAnyOpenSession() bool
- func (ps *PeerSet) HasOpenSession(pid peer.ID) bool
- func (ps *PeerSet) IncreaseInvalidBundlesCounter(pid peer.ID)
- func (ps *PeerSet) IncreaseReceivedBundlesCounter(pid peer.ID)
- func (ps *PeerSet) IncreaseReceivedBytesCounter(pid peer.ID, msgType message.Type, c int64)
- func (ps *PeerSet) IncreaseSentBytesCounter(msgType message.Type, c int64, pid *peer.ID)
- func (ps *PeerSet) IteratePeers(consumer func(peer *Peer))
- func (ps *PeerSet) Len() int
- func (ps *PeerSet) NumberOfOpenSessions() int
- func (ps *PeerSet) OpenSession(pid peer.ID) *Session
- func (ps *PeerSet) ReceivedBytes() map[message.Type]int64
- func (ps *PeerSet) ReceivedBytesMessageType(msgType message.Type) int64
- func (ps *PeerSet) RemovePeer(pid peer.ID)
- func (ps *PeerSet) SentBytes() map[message.Type]int64
- func (ps *PeerSet) SentBytesMessageType(msgType message.Type) int64
- func (ps *PeerSet) StartedAt() time.Time
- func (ps *PeerSet) TotalReceivedBytes() int64
- func (ps *PeerSet) TotalSentBytes() int64
- func (ps *PeerSet) UpdateHeight(pid peer.ID, height uint32, lastBlockHash hash.Hash)
- func (ps *PeerSet) UpdateInfo(pid peer.ID, moniker string, agent string, consKeys []*bls.PublicKey, ...)
- func (ps *PeerSet) UpdateLastReceived(pid peer.ID)
- func (ps *PeerSet) UpdateLastSent(pid peer.ID)
- func (ps *PeerSet) UpdateStatus(pid peer.ID, status StatusCode)
- type Session
- type StatusCode
Constants ¶
View Source
const ( StatusCodeBanned = StatusCode(-1) StatusCodeUnknown = StatusCode(0) StatusCodeDisconnected = StatusCode(1) StatusCodeConnected = StatusCode(2) StatusCodeKnown = StatusCode(3) StatusCodeTrusty = StatusCode(4) )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Peer ¶
type Peer struct { Status StatusCode Moniker string Agent string PeerID peer.ID ConsensusKeys []*bls.PublicKey Services services.Services LastSent time.Time LastReceived time.Time LastBlockHash hash.Hash Height uint32 ReceivedBundles int InvalidBundles int ReceivedBytes map[message.Type]int64 SentBytes map[message.Type]int64 }
func (*Peer) HasNetworkService ¶ added in v0.15.0
func (*Peer) IsKnownOrTrusty ¶
type PeerSet ¶
type PeerSet struct {
// contains filtered or unexported fields
}
func NewPeerSet ¶
func (*PeerSet) CloseSession ¶
func (*PeerSet) FindSession ¶
func (*PeerSet) GetPeerList ¶
func (*PeerSet) HasAnyOpenSession ¶
func (*PeerSet) HasOpenSession ¶ added in v0.11.0
func (*PeerSet) IncreaseInvalidBundlesCounter ¶
func (*PeerSet) IncreaseReceivedBundlesCounter ¶
func (*PeerSet) IncreaseReceivedBytesCounter ¶
func (*PeerSet) IncreaseSentBytesCounter ¶ added in v0.15.0
func (*PeerSet) IteratePeers ¶ added in v0.15.0
func (*PeerSet) NumberOfOpenSessions ¶
func (*PeerSet) ReceivedBytes ¶ added in v0.15.0
func (*PeerSet) ReceivedBytesMessageType ¶ added in v0.15.0
func (*PeerSet) RemovePeer ¶
func (*PeerSet) SentBytesMessageType ¶ added in v0.15.0
func (*PeerSet) TotalReceivedBytes ¶ added in v0.13.0
func (*PeerSet) TotalSentBytes ¶ added in v0.13.0
func (*PeerSet) UpdateHeight ¶
func (*PeerSet) UpdateInfo ¶ added in v0.15.0
func (*PeerSet) UpdateLastReceived ¶ added in v0.15.0
func (*PeerSet) UpdateLastSent ¶ added in v0.15.0
func (*PeerSet) UpdateStatus ¶
func (ps *PeerSet) UpdateStatus(pid peer.ID, status StatusCode)
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
func (*Session) LastActivityAt ¶
func (*Session) SetLastResponseCode ¶
func (s *Session) SetLastResponseCode(code message.ResponseCode)
type StatusCode ¶
type StatusCode int
func (StatusCode) String ¶
func (code StatusCode) String() string
Click to show internal directories.
Click to hide internal directories.