github.com/clem109/go-ethereum@v1.8.3-0.20180316121352-fe6cf00f480a/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 ChartEntries []*ChartEntry 32 33 type ChartEntry struct { 34 Time time.Time `json:"time,omitempty"` 35 Value float64 `json:"value,omitempty"` 36 } 37 38 type GeneralMessage struct { 39 Version string `json:"version,omitempty"` 40 Commit string `json:"commit,omitempty"` 41 } 42 43 type HomeMessage struct { 44 /* TODO (kurkomisi) */ 45 } 46 47 type ChainMessage struct { 48 /* TODO (kurkomisi) */ 49 } 50 51 type TxPoolMessage struct { 52 /* TODO (kurkomisi) */ 53 } 54 55 type NetworkMessage struct { 56 /* TODO (kurkomisi) */ 57 } 58 59 type SystemMessage struct { 60 ActiveMemory ChartEntries `json:"activeMemory,omitempty"` 61 VirtualMemory ChartEntries `json:"virtualMemory,omitempty"` 62 NetworkIngress ChartEntries `json:"networkIngress,omitempty"` 63 NetworkEgress ChartEntries `json:"networkEgress,omitempty"` 64 ProcessCPU ChartEntries `json:"processCPU,omitempty"` 65 SystemCPU ChartEntries `json:"systemCPU,omitempty"` 66 DiskRead ChartEntries `json:"diskRead,omitempty"` 67 DiskWrite ChartEntries `json:"diskWrite,omitempty"` 68 } 69 70 type LogsMessage struct { 71 Log []string `json:"log,omitempty"` 72 }