Documentation ¶
Index ¶
- Constants
- Variables
- func Asset(name string) ([]byte, error)
- func AssetDigest(name string) ([sha256.Size]byte, error)
- func AssetDir(name string) ([]string, error)
- func AssetInfo(name string) (os.FileInfo, error)
- func AssetNames() []string
- func AssetString(name string) (string, error)
- func Digests() (map[string][sha256.Size]byte, error)
- func MustAsset(name string) []byte
- func MustAssetString(name string) string
- func RestoreAsset(dir, name string) error
- func RestoreAssets(dir, name string) error
- type ActivityType
- type ChainMessage
- type ChartEntries
- type ChartEntry
- type CommitteeMessage
- type Config
- type Dashboard
- type FtPoolMessage
- type GeneralMessage
- type HomeMessage
- type LogFile
- type LogsMessage
- type LogsRequest
- type Message
- type NetworkMessage
- type RemovedPeerType
- type Request
- type SystemMessage
- type TxPoolMessage
Constants ¶
const ( RemoveKnown RemovedPeerType = "known" RemoveAttempt RemovedPeerType = "attempt" RemoveBundle RemovedPeerType = "bundle" Active ActivityType = "active" Inactive ActivityType = "inactive" )
Variables ¶
var DefaultConfig = Config{ Host: "localhost", Port: 8080, Refresh: 5 * time.Second, }
DefaultConfig contains default settings for the dashboard.
Functions ¶
func Asset ¶
Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.
func AssetDigest ¶
AssetDigest returns the digest of the file with the given name. It returns an error if the asset could not be found or the digest could not be loaded.
func AssetDir ¶
AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:
data/ foo.txt img/ a.png b.png
then AssetDir("data") would return []string{"foo.txt", "img"}, AssetDir("data/img") would return []string{"a.png", "b.png"}, AssetDir("foo.txt") and AssetDir("notexist") would return an error, and AssetDir("") will return []string{"data"}.
func AssetInfo ¶
AssetInfo loads and returns the asset info for the given name. It returns an error if the asset could not be found or could not be loaded.
func AssetString ¶
AssetString returns the asset contents as a string (instead of a []byte).
func MustAsset ¶
MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.
func MustAssetString ¶
MustAssetString is like AssetString but panics when Asset would return an error. It simplifies safe initialization of global variables.
func RestoreAsset ¶
RestoreAsset restores an asset under the given directory.
func RestoreAssets ¶
RestoreAssets restores an asset under the given directory recursively.
Types ¶
type ChainMessage ¶
type ChainMessage struct {
FastChain *fastChainInfo `json:"fastChain,omitempty"` // fastChain info tree.
}
type ChartEntries ¶
type ChartEntries []*ChartEntry
type ChartEntry ¶
type ChartEntry struct {
Value float64 `json:"value"`
}
type CommitteeMessage ¶
type CommitteeMessage struct { Number uint64 `json:"number,omitempty"` IsCommitteeMember bool `json:"isCommitteeMember,omitempty"` IsLeader bool `json:"isLeader,omitempty"` Committee []string `json:"committee,omitempty"` BackCommittee []string `json:"backCommittee,omitempty"` }
CommitteeMessage contains the info of committee.
type Config ¶
type Config struct { // Host is the host interface on which to start the dashboard server. If this // field is empty, no dashboard will be started. Host string `toml:",omitempty"` // Port is the TCP port number on which to start the dashboard server. The // default zero value is/ valid and will pick a port number randomly (useful // for ephemeral nodes). Port int `toml:",omitempty"` // Refresh is the refresh rate of the data updates, the chartEntry will be collected this often. Refresh time.Duration `toml:",omitempty"` }
Config contains the configuration parameters of the dashboard.
type Dashboard ¶
type Dashboard struct {
// contains filtered or unexported fields
}
Dashboard contains the dashboard internals.
type FtPoolMessage ¶
type FtPoolMessage struct { FtStatusQueued ChartEntries `json:"ftStatusQueued,omitempty"` FtStatusPending ChartEntries `json:"ftStatusPending,omitempty"` FruitPendingDiscardCounter ChartEntries `json:"fruitPendingDiscardCounter,omitempty"` FruitpendingReplaceCounter ChartEntries `json:"fruitpendingReplaceCounter,omitempty"` AllDiscardCounter ChartEntries `json:"allDiscardCounter,omitempty"` AllReplaceCounter ChartEntries `json:"allReplaceCounter,omitempty"` AllReceivedCounter ChartEntries `json:"allReceivedCounter,omitempty"` AllTimesCounter ChartEntries `json:"allTimesCounter,omitempty"` AllFilterCounter ChartEntries `json:"allFilterCounter,omitempty"` AllMinedCounter ChartEntries `json:"allMinedCounter,omitempty"` AllSendCounter ChartEntries `json:"allSendCounter,omitempty"` AllSendTimesCounter ChartEntries `json:"allSendTimesCounter,omitempty"` }
FtPoolMessage contains the collected ftpool data samples.
type GeneralMessage ¶
type HomeMessage ¶
type HomeMessage struct { }
type LogFile ¶
type LogFile struct { Name string `json:"name"` // The name of the file. Last bool `json:"last"` // Denotes if the actual log file is the last one in the directory. }
LogFile contains the attributes of a log file.
type LogsMessage ¶
type LogsMessage struct { Source *LogFile `json:"source,omitempty"` // Attributes of the log file. Chunk json.RawMessage `json:"chunk"` // Contains log records. }
LogsMessage wraps up a log chunk. If 'Source' isn't present, the chunk is a stream chunk.
type LogsRequest ¶
type LogsRequest struct { Name string `json:"name"` // The request handler searches for log file based on this file name. Past bool `json:"past"` // Denotes whether the client wants the previous or the next file. }
LogsRequest contains the attributes of the log file the client wants to receive.
type Message ¶
type Message struct { General *GeneralMessage `json:"general,omitempty"` Home *HomeMessage `json:"home,omitempty"` Chain *ChainMessage `json:"chain,omitempty"` Committee *CommitteeMessage `json:"committee,omitempty"` TxPool *TxPoolMessage `json:"txpool,omitempty"` FtPool *FtPoolMessage `json:"ftpool,omitempty"` Network *NetworkMessage `json:"network,omitempty"` System *SystemMessage `json:"system,omitempty"` Logs *LogsMessage `json:"logs,omitempty"` }
type NetworkMessage ¶
type NetworkMessage struct { Peers *peerContainer `json:"peers,omitempty"` // Peer tree. Diff []*peerEvent `json:"diff,omitempty"` // Events that change the peer tree. }
NetworkMessage contains information about the peers organized based on their IP address and node ID.
type RemovedPeerType ¶
type RemovedPeerType string
RemovedPeerType contains three kind of remove peer type.
type Request ¶
type Request struct {
Logs *LogsRequest `json:"logs,omitempty"`
}
Request represents the client request.
type SystemMessage ¶
type SystemMessage struct { ActiveMemory ChartEntries `json:"activeMemory,omitempty"` VirtualMemory ChartEntries `json:"virtualMemory,omitempty"` NetworkIngress ChartEntries `json:"networkIngress,omitempty"` NetworkEgress ChartEntries `json:"networkEgress,omitempty"` ProcessCPU ChartEntries `json:"processCPU,omitempty"` SystemCPU ChartEntries `json:"systemCPU,omitempty"` DiskRead ChartEntries `json:"diskRead,omitempty"` DiskWrite ChartEntries `json:"diskWrite,omitempty"` }
SystemMessage contains the metered system data samples.
type TxPoolMessage ¶
type TxPoolMessage struct { TxStatusQueued ChartEntries `json:"txStatusQueued,omitempty"` TxStatusPending ChartEntries `json:"txStatusPending,omitempty"` PromotedSend ChartEntries `json:"promotedSend,omitempty"` ReplacedSend ChartEntries `json:"replacedSend,omitempty"` PendingDiscardCounter ChartEntries `json:"pendingDiscardCounter,omitempty"` PendingReplaceCounter ChartEntries `json:"pendingReplaceCounter,omitempty"` PendingRateLimitCounter ChartEntries `json:"pendingRateLimitCounter,omitempty"` PendingNofundsCounter ChartEntries `json:"pendingNofundsCounter,omitempty"` QueuedDiscardCounter ChartEntries `json:"queuedDiscardCounter,omitempty"` QueuedReplaceCounter ChartEntries `json:"queuedReplaceCounter,omitempty"` QueuedRateLimitCounter ChartEntries `json:"queuedRateLimitCounter,omitempty"` QueuedNofundsCounter ChartEntries `json:"queuedNofundsCounter,omitempty"` InvalidTxCounter ChartEntries `json:"invalidTxCounter,omitempty"` UnderpricedTxCounter ChartEntries `json:"underpricedTxCounter,omitempty"` }
TxPoolMessage contains the collected txpool data samples.