{"modulePath":"github.com/parallelcointeam/exploder","version":"v2.1.3+incompatible","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package main\n\n## Variables\n\n```go\nvar (\n\tBlockdataLog = backendLog.Logger(\"BLKD\")\n)\n```\nLoggers per subsystem.  A single backend logger is created and all subsytem loggers created from it will write to the backend.  When adding new subsystems, add the subsystem logger variable here and to the subsystemLoggers map.\n\nLoggers can not be used before the log rotator has been initialized with a log file.  This must be performed early during application startup by calling initLogRotator.\n\n## Functions\n\n```go\nfunc FileServer(r chi.Router, path string, root http.FileSystem, CacheControlMaxAge int64)\n```\nFileServer conveniently sets up a http.FileServer handler to serve static files from a http.FileSystem.\n\n## Types\n\n```go\ntype BlockDataToMemdb struct {\n\tHeight int\n\t// contains filtered or unexported fields\n}\n```\nBlockDataToMemdb models the block data and block data basic as maps\n\n```go\nfunc NewBlockDataToMemdb(m ...*sync.Mutex) *BlockDataToMemdb\n```\nNewBlockDataToMemdb returns a new BlockDataToMemdb\n\n```go\nfunc (s *BlockDataToMemdb) Get(idx int) *blockdata.BlockData\n```\nGet returns blockdata for block idx\n\n```go\nfunc (s *BlockDataToMemdb) GetBestBlock() *blockdata.BlockData\n```\nGetBestBlock returns the best block\n\n```go\nfunc (s *BlockDataToMemdb) GetBestBlockSummary() *apitypes.BlockDataBasic\n```\nGetBestBlockSummary returns the block data summary for the best block\n\n```go\nfunc (s *BlockDataToMemdb) GetFeeInfo(idx int) *dcrjson.FeeInfoBlock\n```\nGetFeeInfo returns the fee info for block idx\n\n```go\nfunc (s *BlockDataToMemdb) GetHeader(idx int) *dcrjson.GetBlockHeaderVerboseResult\n```\nGetHeader returns the block header for block idx\n\n```go\nfunc (s *BlockDataToMemdb) GetHeight() int\n```\nGetHeight returns the blockdata height\n\n```go\nfunc (s *BlockDataToMemdb) GetStakeDiffEstimate(idx int) *dcrjson.EstimateStakeDiffResult\n```\nGetStakeDiffEstimate returns the stake difficulty estimates for block idx\n\n```go\nfunc (s *BlockDataToMemdb) GetStakeInfoExtended(idx int) *apitypes.StakeInfoExtended\n```\nGetStakeInfoExtended returns the stake info for block idx\n\n```go\nfunc (s *BlockDataToMemdb) GetSummary(idx int) *apitypes.BlockDataBasic\n```\nGetSummary returns the block data summary for block idx\n\n```go\nfunc (s *BlockDataToMemdb) Store(data *blockdata.BlockData, _ *wire.MsgBlock) error\n```\nStore writes blockdata.BlockData to memdb\n\n```go\ntype WebBlockInfo struct {\n\tBlockDataBasic *apitypes.BlockExplorerBasic         `json:\"block\"`\n\tStakeInfoExt   *apitypes.StakeInfoExtendedEstimates `json:\"stake\"`\n}\n```\nWebBlockInfo represents the JSON object used to send block data and stake info to the web client\n\n```go\ntype WebSocketMessage struct {\n\tEventId  string `json:\"event\"`\n\tMesssage string `json:\"message\"`\n}\n```\nWebSocketMessage represents the JSON object used to send and received typed messages to the web client.\n\n```go\ntype WebsocketHub struct {\n\tsync.RWMutex\n\n\tRegister        chan *hubSpoke\n\tUnregister      chan *hubSpoke\n\tHubRelay        chan hubSignal\n\tNewBlockInfo    chan WebBlockInfo\n\tNewBlockSummary chan apitypes.BlockDataBasic\n\tNewStakeSummary chan apitypes.StakeInfoExtendedEstimates\n\t// contains filtered or unexported fields\n}\n```\nWebsocketHub and its event loop manage all websocket client connections. WebsocketHub is responsible for closing all connections registered with it. If the event loop is running, calling (\\*WebsocketHub).Stop() will handle it.\n\n```go\nfunc NewWebsocketHub() *WebsocketHub\n```\nNewWebsocketHub creates a new WebsocketHub\n\n```go\nfunc (wsh *WebsocketHub) NumClients() int\n```\nNumClients returns the number of clients connected to the websocket hub\n\n```go\nfunc (wsh *WebsocketHub) RegisterClient(c *hubSpoke)\n```\nRegisterClient registers a websocket connection with the hub.\n\n```go\nfunc (wsh *WebsocketHub) Stop()\n```\nStop kills the run() loop and unregisteres all clients (connections).\n\n```go\nfunc (wsh *WebsocketHub) UnregisterClient(c *hubSpoke)\n```\nUnregisterClient unregisters the input websocket connection via the main run() loop.  This call will block if the run() loop is not running.\n\n","path":"github.com/parallelcointeam/exploder","name":"main","synopsis":"","isRedistributable":true}
