github.com/needkane/go-ethereum@v1.7.4-0.20180131070256-c212876ea2b7/dashboard/message.go (about) 1 // Copyright 2017 The go-ethereum Authors 2 // This file is part of the go-ethereum library. 3 // 4 // The go-ethereum library is free software: you can redistribute it and/or modify 5 // it under the terms of the GNU Lesser General Public License as published by 6 // the Free Software Foundation, either version 3 of the License, or 7 // (at your option) any later version. 8 // 9 // The go-ethereum library is distributed in the hope that it will be useful, 10 // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 // GNU Lesser General Public License for more details. 13 // 14 // You should have received a copy of the GNU Lesser General Public License 15 // along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>. 16 17 package dashboard 18 19 import "time" 20 21 type Message struct { 22 General *GeneralMessage `json:"general,omitempty"` 23 Home *HomeMessage `json:"home,omitempty"` 24 Chain *ChainMessage `json:"chain,omitempty"` 25 TxPool *TxPoolMessage `json:"txpool,omitempty"` 26 Network *NetworkMessage `json:"network,omitempty"` 27 System *SystemMessage `json:"system,omitempty"` 28 Logs *LogsMessage `json:"logs,omitempty"` 29 } 30 31 type GeneralMessage struct { 32 Version string `json:"version,omitempty"` 33 Commit string `json:"commit,omitempty"` 34 } 35 36 type HomeMessage struct { 37 ActiveMemory ChartEntries `json:"activeMemory,omitempty"` 38 VirtualMemory ChartEntries `json:"virtualMemory,omitempty"` 39 NetworkIngress ChartEntries `json:"networkIngress,omitempty"` 40 NetworkEgress ChartEntries `json:"networkEgress,omitempty"` 41 ProcessCPU ChartEntries `json:"processCPU,omitempty"` 42 SystemCPU ChartEntries `json:"systemCPU,omitempty"` 43 DiskRead ChartEntries `json:"diskRead,omitempty"` 44 DiskWrite ChartEntries `json:"diskWrite,omitempty"` 45 } 46 47 type ChartEntries []*ChartEntry 48 49 type ChartEntry struct { 50 Time time.Time `json:"time,omitempty"` 51 Value float64 `json:"value,omitempty"` 52 } 53 54 type ChainMessage struct { 55 /* TODO (kurkomisi) */ 56 } 57 58 type TxPoolMessage struct { 59 /* TODO (kurkomisi) */ 60 } 61 62 type NetworkMessage struct { 63 /* TODO (kurkomisi) */ 64 } 65 66 type SystemMessage struct { 67 /* TODO (kurkomisi) */ 68 } 69 70 type LogsMessage struct { 71 Log []string `json:"log,omitempty"` 72 }