Documentation ¶
Index ¶
- Variables
- func AllConnectionsString() string
- func DisplayStateDrain(channel chan state.DisplayState)
- func FactoshiToFactoid(i uint64) string
- func FormatDuration(initial time.Time) string
- func GetDataDumps() []byte
- func HandleSearchResult(content *SearchedStruct, w http.ResponseWriter)
- func HeightToJsonStruct(height uint32) []byte
- func InitTemplates()
- func RequestData()
- func ServeControlPanel(displayStateChannel chan state.DisplayState, statePointer *state.State, ...)
- func SetRequestMutex(set bool)
- func SortedConnectionString() string
- type ABDisplayHolder
- type AblockHolder
- type AllConnectionsTotals
- type ConnectionInfo
- type ConnectionInfoArray
- type ConnectionsMap
- func (cm *ConnectionsMap) AddConnection(key string, val p2p.PeerMetrics)
- func (cm *ConnectionsMap) CleanDisconnected() int
- func (cm *ConnectionsMap) Connect(key string, val *p2p.PeerMetrics) bool
- func (cm *ConnectionsMap) Disconnect(key string, val *p2p.PeerMetrics) bool
- func (cm *ConnectionsMap) GetConnectedCopy() map[string]p2p.PeerMetrics
- func (cm *ConnectionsMap) GetConnection(key string) *p2p.PeerMetrics
- func (cm *ConnectionsMap) GetDisconnectedCopy() map[string]p2p.PeerMetrics
- func (cm *ConnectionsMap) RemoveConnection(key string)
- func (cm *ConnectionsMap) SortedConnections() ConnectionInfoArray
- func (cm *ConnectionsMap) TallyTotals()
- func (cm *ConnectionsMap) UpdateConnections(connections map[string]p2p.PeerMetrics)
- type DataDump
- type DblockHolder
- type ECBlockHolder
- type EblockHolder
- type EntryHolder
- type FBlockHolder
- type FactoidAck
- type IndexTemplateData
- type LastDirectoryBlockTransactions
- type SearchedStruct
Constants ¶
This section is empty.
Variables ¶
View Source
var ( UpdateTimeValue int = 5 // in seconds. How long to update the state and recent transactions DisplayState state.DisplayState StatePointer *state.State Controller *p2p.Network // Used for Disconnect LastRequest time.Time TimeRequestHold float64 = 3 // Amount of time in seconds before can request data again DisplayStateChannel chan state.DisplayState // Sync Mutex TemplateMutex sync.Mutex DisplayStateMutex sync.RWMutex )
View Source
var DoingRecentTransactions bool
Flag to tell if RecentTransactions is already being built
View Source
var RecentTransactionsMutex sync.Mutex
Functions ¶
func AllConnectionsString ¶
func AllConnectionsString() string
func DisplayStateDrain ¶
func DisplayStateDrain(channel chan state.DisplayState)
func FactoshiToFactoid ¶
FactoshiToFactoid converts a uint64 factoshi ammount into a fixed point number represented as a string
func FormatDuration ¶
func GetDataDumps ¶
func GetDataDumps() []byte
func HandleSearchResult ¶
func HandleSearchResult(content *SearchedStruct, w http.ResponseWriter)
func HeightToJsonStruct ¶
Used to send a height as json struct
func InitTemplates ¶
func InitTemplates()
func RequestData ¶
func RequestData()
func ServeControlPanel ¶
func ServeControlPanel(displayStateChannel chan state.DisplayState, statePointer *state.State, connections chan map[string]p2p.PeerMetrics, controller *p2p.Network, gitBuild string, nodeName string)
Main function. This intiates appropriate variables and starts the control panel serving
func SetRequestMutex ¶
func SetRequestMutex(set bool)
func SortedConnectionString ¶
func SortedConnectionString() string
Types ¶
type ABDisplayHolder ¶
type AblockHolder ¶
type AblockHolder struct { Header struct { PrevBackRefHash string `json:"prevbackrefhash"` DBHeight int `json:"dbheight"` HeaderExpansionSize int `json:"headerexpansionsize"` HeaderExpansionArea string `json:"headerexpansionarea"` MessageCount int `json:"messagecount"` BodySize int `json:"bodysize"` AdminChainID string `json:"adminchainid"` ChainID string `json:"chainid"` } `json:"header"` JsonABEntries []interface{} `json:"abentries"` BackReferenceHash string `json:"backreferencehash"` LookupHash string `json:"lookuphash"` ABEntries []interfaces.IABEntry ABDisplay []ABDisplayHolder }
type AllConnectionsTotals ¶
type AllConnectionsTotals struct { PeerQualityAvg int32 BytesSentTotal uint64 BytesReceivedTotal uint64 MessagesSent uint64 MessagesReceived uint64 BPSDown float64 BPSUp float64 }
func NewAllConnectionTotals ¶
func NewAllConnectionTotals() *AllConnectionsTotals
type ConnectionInfo ¶
type ConnectionInfoArray ¶
type ConnectionInfoArray []ConnectionInfo
func (ConnectionInfoArray) Len ¶
func (slice ConnectionInfoArray) Len() int
func (ConnectionInfoArray) Less ¶
func (slice ConnectionInfoArray) Less(i, j int) bool
func (ConnectionInfoArray) Swap ¶
func (slice ConnectionInfoArray) Swap(i, j int)
type ConnectionsMap ¶
type ConnectionsMap struct { Totals AllConnectionsTotals Lock sync.Mutex // contains filtered or unexported fields }
var AllConnections *ConnectionsMap
func NewConnectionsMap ¶
func NewConnectionsMap() *ConnectionsMap
func (*ConnectionsMap) AddConnection ¶
func (cm *ConnectionsMap) AddConnection(key string, val p2p.PeerMetrics)
func (*ConnectionsMap) CleanDisconnected ¶
func (cm *ConnectionsMap) CleanDisconnected() int
func (*ConnectionsMap) Connect ¶
func (cm *ConnectionsMap) Connect(key string, val *p2p.PeerMetrics) bool
func (*ConnectionsMap) Disconnect ¶
func (cm *ConnectionsMap) Disconnect(key string, val *p2p.PeerMetrics) bool
func (*ConnectionsMap) GetConnectedCopy ¶
func (cm *ConnectionsMap) GetConnectedCopy() map[string]p2p.PeerMetrics
func (*ConnectionsMap) GetConnection ¶
func (cm *ConnectionsMap) GetConnection(key string) *p2p.PeerMetrics
func (*ConnectionsMap) GetDisconnectedCopy ¶
func (cm *ConnectionsMap) GetDisconnectedCopy() map[string]p2p.PeerMetrics
func (*ConnectionsMap) RemoveConnection ¶
func (cm *ConnectionsMap) RemoveConnection(key string)
func (*ConnectionsMap) SortedConnections ¶
func (cm *ConnectionsMap) SortedConnections() ConnectionInfoArray
Used to send to front ent
func (*ConnectionsMap) TallyTotals ¶
func (cm *ConnectionsMap) TallyTotals()
func (*ConnectionsMap) UpdateConnections ¶
func (cm *ConnectionsMap) UpdateConnections(connections map[string]p2p.PeerMetrics)
type DataDump ¶
type DataDump struct { DataDump1 struct { ShortDump string RawDump string SyncingDump string } DataDump2 struct { NextDump string RawDump string PrevDump string } DataDump3 struct { RawDump string } DataDump4 struct { Authorities string Identities string MyNode string } DataDump5 struct { RawDump string SortedDump string } ElectionDataDump struct { Elections string SimulatedElection string } LogSettingsDump struct { CurrentLogSettings string } }
type DblockHolder ¶
type DblockHolder struct { Header struct { Version int `json:"version"` NetworkID int `json:"networkid"` BodyMR string `json:"bodymr"` PrevKeyMR string `json:"prevkeymr"` PrevFullHash string `json:"prevfullhash"` Timestamp uint32 `json:"timestamp"` DBHeight int `json:"dbheight"` BlockCount int `json:"blockcount"` ChainID string `json:"chainid"` FormatedTimeStamp string } `json:"header"` DBEntries []struct { ChainID string `json:"chainid"` KeyMR string `json:"keymr"` } `json:"dbentries"` JsonDBHash interface{} `json:"dbhash"` JsonKeyMR interface{} `json:"keymr"` EBlocks []EblockHolder AdminBlock struct { ChainID string KeyMr string } FactoidBlock struct { ChainID string KeyMr string } EntryCreditBlock struct { ChainID string KeyMr string } FullHash string KeyMR string }
type ECBlockHolder ¶
type ECBlockHolder struct { ECBlock interfaces.IEntryCreditBlock Length int }
type EblockHolder ¶
type EblockHolder struct { Header struct { ChainID string `json:"chainid"` BodyMR string `json:"bodymr"` PrevKeyMR string `json:"prevkeymr"` PrevFullHash string `json:"prevfullhash"` EBSequence int `json:"ebsequence"` DBHeight int `json:"dbheight"` EntryCount int `json:"entrycount"` } `json:"header"` Body struct { EBEntries []string `json:"ebentries"` } `json:"body"` KeyMR string BodyMR string FullHash string Entries []EntryHolder }
type EntryHolder ¶
type FBlockHolder ¶
type FactoidAck ¶
type IndexTemplateData ¶
type LastDirectoryBlockTransactions ¶
type LastDirectoryBlockTransactions struct { DirectoryBlock struct { KeyMR string BodyKeyMR string FullHash string DBHeight string Timestamp string PrevFullHash string PrevKeyMR string } FactoidTransactions []struct { TxID string Hash string TotalInput string Status string TotalInputs int TotalOutputs int } Entries []EntryHolder LastHeightChecked uint32 }
var RecentTransactions *LastDirectoryBlockTransactions
func (*LastDirectoryBlockTransactions) ContainsEntry ¶
func (d *LastDirectoryBlockTransactions) ContainsEntry(hash string) bool
func (*LastDirectoryBlockTransactions) ContainsTrans ¶
func (d *LastDirectoryBlockTransactions) ContainsTrans(txid string) bool
type SearchedStruct ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.