Documentation
¶
Overview ¶
package diagnostics implements a network diagnostics service that allows a request to traverse the network and gather information on every node connected to it.
Index ¶
Constants ¶
View Source
const ResponseTimeout = time.Second * 10
Variables ¶
This section is empty.
Functions ¶
func GetGraphJson ¶
Types ¶
type DiagInfo ¶
type DiagInfo struct { // This nodes ID ID string // A list of peers this node currently has open connections to Connections []connDiagInfo // A list of keys provided by this node // (currently not filled) Keys []string // How long this node has been running for // TODO rename Uptime LifeSpan time.Duration // Incoming Bandwidth Usage BwIn uint64 // Outgoing Bandwidth Usage BwOut uint64 // Information about the version of code this node is running CodeVersion string }
type Diagnostics ¶
type Diagnostics struct {
// contains filtered or unexported fields
}
Diagnostics is a net service that manages requesting and responding to diagnostic requests
func NewDiagnostics ¶
NewDiagnostics instantiates a new diagnostics service running on the given network
func (*Diagnostics) GetDiagnostic ¶
func (d *Diagnostics) GetDiagnostic(timeout time.Duration) ([]*DiagInfo, error)
GetDiagnostic runs a diagnostics request across the entire network
func (*Diagnostics) HandleMessage ¶
func (d *Diagnostics) HandleMessage(ctx context.Context, mes msg.NetMessage) msg.NetMessage
Click to show internal directories.
Click to hide internal directories.