Documentation
¶
Overview ¶
You can use the "packr clean" command to clean up this, and any other packr generated files.
Index ¶
Constants ¶
const ( // CfgBindAddress defines the config flag of the analysis dashboard binding address. CfgBindAddress = "analysis.dashboard.bindAddress" // CfgDev defines the config flag of the analysis dashboard dev mode. CfgDev = "analysis.dashboard.dev" // CfgBasicAuthEnabled defines the config flag of the analysis dashboard basic auth enabler. CfgBasicAuthEnabled = "analysis.dashboard.basic_auth.enabled" // CfgBasicAuthUsername defines the config flag of the analysis dashboard basic auth username. CfgBasicAuthUsername = "analysis.dashboard.basic_auth.username" // CfgBasicAuthPassword defines the config flag of the analysis dashboard basic auth password. CfgBasicAuthPassword = "analysis.dashboard.basic_auth.password" // CfgMongoDBEnabled defines the config flag of the analysis dashboard to enable mongoDB. CfgMongoDBEnabled = "analysis.dashboard.mongodb.enabled" // CfgMongoDBUsername defines the config flag of the analysis dashboard mongoDB username. CfgMongoDBUsername = "analysis.dashboard.mongodb.username" // CfgMongoDBPassword defines the config flag of the analysis dashboard mongoDB password. CfgMongoDBPassword = "analysis.dashboard.mongodb.password" // CfgMongoDBHostAddress defines the config flag of the analysis dashboard mongoDB binding address. CfgMongoDBHostAddress = "analysis.dashboard.mongodb.hostAddress" )
const ( // MsgTypePing defines a ping message type. MsgTypePing byte = iota // MsgTypeFPC defines a FPC update message. MsgTypeFPC // MsgTypeAddNode defines an addNode update message for autopeering visualizer. MsgTypeAddNode // MsgTypeRemoveNode defines a removeNode update message for autopeering visualizer. MsgTypeRemoveNode // MsgTypeConnectNodes defines a connectNodes update message for autopeering visualizer. MsgTypeConnectNodes // MsgTypeDisconnectNodes defines a disconnectNodes update message for autopeering visualizer. MsgTypeDisconnectNodes )
const PluginName = "Analysis-Dashboard"
PluginName is the name of the dashboard plugin.
Variables ¶
var ErrForbidden = errors.New("forbidden")
ErrForbidden defines the forbidden error.
var ErrInternalError = errors.New("internal error")
ErrInternalError defines the internal error.
var ErrInvalidParameter = errors.New("invalid parameter")
ErrInvalidParameter defines the invalid parameter error.
var ErrNotFound = errors.New("not found")
ErrNotFound defines the not found error.
Functions ¶
func NetworkGraph ¶
NetworkGraph returns the autopeering network graph.
func NumOfNeighbors ¶
func NumOfNeighbors() map[string]*NeighborMetric
NumOfNeighbors returns a map of nodeIDs to their neighbor count.
Types ¶
type EventHandlers ¶
type EventHandlers struct { // Addnode defines the handler called when adding a new node. AddNode func(nodeId string) // RemoveNode defines the handler called when adding removing a node. RemoveNode func(nodeId string) // ConnectNodes defines the handler called when connecting two nodes. ConnectNodes func(sourceId string, targetId string) // DisconnectNodes defines the handler called when connecting two nodes. DisconnectNodes func(sourceId string, targetId string) }
EventHandlers holds the handler for each event of the record manager.
type EventHandlersConsumer ¶
type EventHandlersConsumer = func(handler *EventHandlers)
EventHandlersConsumer defines the consumer function of an *EventHandlers.
type FPCRecord ¶
type FPCRecord struct { // ConflictID defines the ID of the conflict. ConflictID string `json:"conflictid" bson:"conflictid"` // NodeID defines the ID of the node. NodeID string `json:"nodeid" bson:"nodeid"` // Rounds defines number of rounds performed to finalize the conflict. Rounds int `json:"rounds" bson:"rounds"` // Opinions contains the opinion of each round. Opinions []int32 `json:"opinions" bson:"opinions"` // Outcome defines final opinion of the conflict. Outcome int32 `json:"outcome" bson:"outcome"` // Time defines the time when the conflict has been finalized. Time primitive.DateTime `json:"datetime" bson:"datetime"` }
FPCRecord defines the FPC record to be stored into a mongoDB.
type FPCUpdate ¶
type FPCUpdate struct {
Conflicts conflictSet `json:"conflictset" bson:"conflictset"`
}
FPCUpdate contains an FPC update.
type NeighborMetric ¶
NeighborMetric contains the number of inbound/outbound neighbors.