{"modulePath":"github.com/DCNT-developer/dcnt","version":"v0.0.0-20190910072103-303b43720a74","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package controlPanel\n\n## Variables\n\n```go\nvar (\n\tUpdateTimeValue int = 5 // in seconds. How long to update the state and recent transactions\n\n\tDisplayState state.DisplayState\n\tStatePointer *state.State\n\tController   *p2p.Controller // Used for Disconnect\n\n\tLastRequest     time.Time\n\tTimeRequestHold float64 = 3 // Amount of time in seconds before can request data again\n\n\tDisplayStateChannel chan state.DisplayState\n\n\t// Sync Mutex\n\tTemplateMutex     sync.Mutex\n\tDisplayStateMutex sync.RWMutex\n)\n```\n\n```go\nvar DoingRecentTransactions bool\n```\nFlag to tell if RecentTransactions is already being built\n\n```go\nvar RecentTransactionsMutex sync.Mutex\n```\n\n## Functions\n\n```go\nfunc AllConnectionsString() string\n```\n\n```go\nfunc DisplayStateDrain(channel chan state.DisplayState)\n```\n\n```go\nfunc FactoshiToFactoid(i uint64) string\n```\nFactoshiToFactoid converts a uint64 factoshi ammount into a fixed point number represented as a string\n\n```go\nfunc FormatDuration(initial time.Time) string\n```\n\n```go\nfunc GetDataDumps() []byte\n```\n\n```go\nfunc HandleSearchResult(content *SearchedStruct, w http.ResponseWriter)\n```\n\n```go\nfunc HeightToJsonStruct(height uint32) []byte\n```\nUsed to send a height as json struct\n\n```go\nfunc InitTemplates()\n```\n\n```go\nfunc RequestData()\n```\n\n```go\nfunc ServeControlPanel(displayStateChannel chan state.DisplayState, statePointer *state.State, connections chan interface{}, controller *p2p.Controller, gitBuild string, nodeName string)\n```\nMain function. This intiates appropriate variables and starts the control panel serving\n\n```go\nfunc SetRequestMutex(set bool)\n```\n\n```go\nfunc SortedConnectionString() string\n```\n\n## Types\n\n```go\ntype ABDisplayHolder struct {\n\tType      string\n\tOtherInfo string\n}\n```\n\n```go\ntype AblockHolder struct {\n\tHeader struct {\n\t\tPrevBackRefHash     string `json:\"prevbackrefhash\"`\n\t\tDBHeight            int    `json:\"dbheight\"`\n\t\tHeaderExpansionSize int    `json:\"headerexpansionsize\"`\n\t\tHeaderExpansionArea string `json:\"headerexpansionarea\"`\n\t\tMessageCount        int    `json:\"messagecount\"`\n\t\tBodySize            int    `json:\"bodysize\"`\n\t\tAdminChainID        string `json:\"adminchainid\"`\n\t\tChainID             string `json:\"chainid\"`\n\t} `json:\"header\"`\n\tJsonABEntries     []interface{} `json:\"abentries\"`\n\tBackReferenceHash string        `json:\"backreferencehash\"`\n\tLookupHash        string        `json:\"lookuphash\"`\n\n\tABEntries []interfaces.IABEntry\n\tABDisplay []ABDisplayHolder\n}\n```\n\n```go\ntype AllConnectionsTotals struct {\n\tPeerQualityAvg     int32\n\tBytesSentTotal     uint32\n\tBytesReceivedTotal uint32\n\tMessagesSent       uint32\n\tMessagesReceived   uint32\n}\n```\n\n```go\nfunc NewAllConnectionTotals() *AllConnectionsTotals\n```\n\n```go\ntype ConnectionInfo struct {\n\tConnected               bool\n\tHash                    string // Hash of PeerHash (Peerhash contains illegal characters for html ID)\n\tConnection              p2p.ConnectionMetrics\n\tConnectionTimeFormatted string\n\tPeerHash                string\n}\n```\n\n```go\ntype ConnectionInfoArray []ConnectionInfo\n```\n\n```go\nfunc (slice ConnectionInfoArray) Len() int\n```\n\n```go\nfunc (slice ConnectionInfoArray) Less(i, j int) bool\n```\n\n```go\nfunc (slice ConnectionInfoArray) Swap(i, j int)\n```\n\n```go\ntype ConnectionsMap struct {\n\tTotals AllConnectionsTotals\n\tLock   sync.Mutex\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nvar AllConnections *ConnectionsMap\n```\n\n```go\nfunc NewConnectionsMap() *ConnectionsMap\n```\n\n```go\nfunc (cm *ConnectionsMap) AddConnection(key string, val p2p.ConnectionMetrics)\n```\n\n```go\nfunc (cm *ConnectionsMap) CleanDisconnected() int\n```\n\n```go\nfunc (cm *ConnectionsMap) Connect(key string, val *p2p.ConnectionMetrics) bool\n```\n\n```go\nfunc (cm *ConnectionsMap) Disconnect(key string, val *p2p.ConnectionMetrics) bool\n```\n\n```go\nfunc (cm *ConnectionsMap) GetConnectedCopy() map[string]p2p.ConnectionMetrics\n```\n\n```go\nfunc (cm *ConnectionsMap) GetConnection(key string) *p2p.ConnectionMetrics\n```\n\n```go\nfunc (cm *ConnectionsMap) GetDisconnectedCopy() map[string]p2p.ConnectionMetrics\n```\n\n```go\nfunc (cm *ConnectionsMap) RemoveConnection(key string)\n```\n\n```go\nfunc (cm *ConnectionsMap) SortedConnections() ConnectionInfoArray\n```\nUsed to send to front ent\n\n```go\nfunc (cm *ConnectionsMap) TallyTotals()\n```\n\n```go\nfunc (cm *ConnectionsMap) UpdateConnections(connections map[string]p2p.ConnectionMetrics)\n```\n\n```go\ntype DataDump struct {\n\tDataDump1 struct {\n\t\tShortDump   string\n\t\tRawDump     string\n\t\tSyncingDump string\n\t}\n\tDataDump2 struct {\n\t\tNextDump string\n\t\tRawDump  string\n\t\tPrevDump string\n\t}\n\tDataDump3 struct {\n\t\tRawDump string\n\t}\n\tDataDump4 struct {\n\t\tAuthorities string\n\t\tIdentities  string\n\t\tMyNode      string\n\t}\n\tDataDump5 struct {\n\t\tRawDump    string\n\t\tSortedDump string\n\t}\n\tElectionDataDump struct {\n\t\tElections         string\n\t\tSimulatedElection string\n\t}\n\tLogSettingsDump struct {\n\t\tCurrentLogSettings string\n\t}\n}\n```\n\n```go\ntype DblockHolder struct {\n\tHeader struct {\n\t\tVersion      int    `json:\"version\"`\n\t\tNetworkID    int    `json:\"networkid\"`\n\t\tBodyMR       string `json:\"bodymr\"`\n\t\tPrevKeyMR    string `json:\"prevkeymr\"`\n\t\tPrevFullHash string `json:\"prevfullhash\"`\n\t\tTimestamp    uint32 `json:\"timestamp\"`\n\t\tDBHeight     int    `json:\"dbheight\"`\n\t\tBlockCount   int    `json:\"blockcount\"`\n\t\tChainID      string `json:\"chainid\"`\n\n\t\tFormatedTimeStamp string\n\t} `json:\"header\"`\n\tDBEntries []struct {\n\t\tChainID string `json:\"chainid\"`\n\t\tKeyMR   string `json:\"keymr\"`\n\t} `json:\"dbentries\"`\n\tJsonDBHash interface{} `json:\"dbhash\"`\n\tJsonKeyMR  interface{} `json:\"keymr\"`\n\n\tEBlocks    []EblockHolder\n\tAdminBlock struct {\n\t\tChainID string\n\t\tKeyMr   string\n\t}\n\tFactoidBlock struct {\n\t\tChainID string\n\t\tKeyMr   string\n\t}\n\tEntryCreditBlock struct {\n\t\tChainID string\n\t\tKeyMr   string\n\t}\n\tFullHash string\n\tKeyMR    string\n}\n```\n\n```go\ntype ECBlockHolder struct {\n\tECBlock interfaces.IEntryCreditBlock\n\tLength  int\n}\n```\n\n```go\ntype EblockHolder struct {\n\tHeader struct {\n\t\tChainID      string `json:\"chainid\"`\n\t\tBodyMR       string `json:\"bodymr\"`\n\t\tPrevKeyMR    string `json:\"prevkeymr\"`\n\t\tPrevFullHash string `json:\"prevfullhash\"`\n\t\tEBSequence   int    `json:\"ebsequence\"`\n\t\tDBHeight     int    `json:\"dbheight\"`\n\t\tEntryCount   int    `json:\"entrycount\"`\n\t} `json:\"header\"`\n\tBody struct {\n\t\tEBEntries []string `json:\"ebentries\"`\n\t} `json:\"body\"`\n\n\tKeyMR    string\n\tBodyMR   string\n\tFullHash string\n\tEntries  []EntryHolder\n}\n```\n\n```go\ntype EntryHolder struct {\n\tChainID string   `json:\"chainid\"`\n\tContent string   `json:\"content\"`\n\tExtIDs  []string `json:\"extids\"`\n\tVersion int      `json:\"version\"`\n\n\tHeight        string\n\tHash          string\n\tContentLength int\n\tContentHash   string\n\tECCost        string\n\n\tTime string\n}\n```\n\n```go\ntype FBlockHolder struct {\n\tfactoid.FBlock\n\tLength int\n}\n```\n\n```go\ntype FactoidAck struct {\n\tID      int    `json:\"id\"`\n\tJsonrpc string `json:\"jsonrpc\"`\n\tResult  struct {\n\t\tStatus                string  `json:\"status\"`\n\t\tTransactionDate       float64 `json:\"transactiondate\"`\n\t\tTransactionDateString string  `json:\"transactiondatestring\"`\n\t\tTxid                  string  `json:\"txid\"`\n\t} `json:\"result\"`\n}\n```\n\n```go\ntype IndexTemplateData struct {\n\tGitBuild string\n\tVersion  string\n\tNodeName string\n}\n```\n\n```go\ntype LastDirectoryBlockTransactions struct {\n\tDirectoryBlock struct {\n\t\tKeyMR     string\n\t\tBodyKeyMR string\n\t\tFullHash  string\n\t\tDBHeight  string\n\t\tTimestamp string\n\n\t\tPrevFullHash string\n\t\tPrevKeyMR    string\n\t}\n\tFactoidTransactions []struct {\n\t\tTxID         string\n\t\tHash         string\n\t\tTotalInput   string\n\t\tStatus       string\n\t\tTotalInputs  int\n\t\tTotalOutputs int\n\t}\n\tEntries []EntryHolder\n\n\tLastHeightChecked uint32\n}\n```\n\n```go\nvar RecentTransactions *LastDirectoryBlockTransactions\n```\n\n```go\nfunc (d *LastDirectoryBlockTransactions) ContainsEntry(hash string) bool\n```\n\n```go\nfunc (d *LastDirectoryBlockTransactions) ContainsTrans(txid string) bool\n```\n\n```go\ntype SearchedStruct struct {\n\tType    string      `json:\"type\"`\n\tContent interface{} `json:\"item\"`\n\n\tInput string `json:\"input\"`\n}\n```\n\n","path":"github.com/DCNT-developer/dcnt/controlPanel","name":"controlPanel","synopsis":"","isRedistributable":true}
