go-ethereum: github.com/axiomzen/go-ethereum/dashboard Index | Files

package dashboard

import "github.com/axiomzen/go-ethereum/dashboard"

Index

Package Files

assets.go config.go cpu.go dashboard.go geoip.go log.go message.go peers.go system.go

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.

func Asset Uses

func Asset(name string) ([]byte, error)

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 Uses

func AssetDigest(name string) ([sha256.Size]byte, error)

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 Uses

func AssetDir(name string) ([]string, error)

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 Uses

func AssetInfo(name string) (os.FileInfo, error)

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 AssetNames Uses

func AssetNames() []string

AssetNames returns the names of the assets.

func AssetString Uses

func AssetString(name string) (string, error)

AssetString returns the asset contents as a string (instead of a []byte).

func Digests Uses

func Digests() (map[string][sha256.Size]byte, error)

Digests returns a map of all known files and their checksums.

func MustAsset Uses

func MustAsset(name string) []byte

MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.

func MustAssetString Uses

func MustAssetString(name string) string

MustAssetString is like AssetString but panics when Asset would return an error. It simplifies safe initialization of global variables.

func RestoreAsset Uses

func RestoreAsset(dir, name string) error

RestoreAsset restores an asset under the given directory.

func RestoreAssets Uses

func RestoreAssets(dir, name string) error

RestoreAssets restores an asset under the given directory recursively.

type ActivityType Uses

type ActivityType string

type ChainMessage Uses

type ChainMessage struct {
}

type ChartEntries Uses

type ChartEntries []*ChartEntry

type ChartEntry Uses

type ChartEntry struct {
    Value float64 `json:"value"`
}

type Config Uses

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 Uses

type Dashboard struct {
    // contains filtered or unexported fields
}

Dashboard contains the dashboard internals.

func New Uses

func New(config *Config, commit string, logdir string) *Dashboard

New creates a new dashboard instance with the given configuration.

func (*Dashboard) APIs Uses

func (db *Dashboard) APIs() []rpc.API

APIs implements the node.Service interface.

func (*Dashboard) Protocols Uses

func (db *Dashboard) Protocols() []p2p.Protocol

Protocols implements the node.Service interface.

func (*Dashboard) Start Uses

func (db *Dashboard) Start(server *p2p.Server) error

Start starts the data collection thread and the listening server of the dashboard. Implements the node.Service interface.

func (*Dashboard) Stop Uses

func (db *Dashboard) Stop() error

Stop stops the data collection thread and the connection listener of the dashboard. Implements the node.Service interface.

type GeneralMessage Uses

type GeneralMessage struct {
    Version string `json:"version,omitempty"`
    Commit  string `json:"commit,omitempty"`
}

type HomeMessage Uses

type HomeMessage struct {
}

type LogFile Uses

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 Uses

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 Uses

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 Uses

type Message struct {
    General *GeneralMessage `json:"general,omitempty"`
    Home    *HomeMessage    `json:"home,omitempty"`
    Chain   *ChainMessage   `json:"chain,omitempty"`
    TxPool  *TxPoolMessage  `json:"txpool,omitempty"`
    Network *NetworkMessage `json:"network,omitempty"`
    System  *SystemMessage  `json:"system,omitempty"`
    Logs    *LogsMessage    `json:"logs,omitempty"`
}

type NetworkMessage Uses

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 Uses

type RemovedPeerType string

type Request Uses

type Request struct {
    Logs *LogsRequest `json:"logs,omitempty"`
}

Request represents the client request.

type SystemMessage Uses

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 Uses

type TxPoolMessage struct {
}

Package dashboard imports 29 packages (graph). Updated 2019-07-06. Refresh now. Tools for package owners.