message.go 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. package dashboard
  17. import "time"
  18. type Message struct {
  19. Home *HomeMessage `json:"home,omitempty"`
  20. Chain *ChainMessage `json:"chain,omitempty"`
  21. TxPool *TxPoolMessage `json:"txpool,omitempty"`
  22. Network *NetworkMessage `json:"network,omitempty"`
  23. System *SystemMessage `json:"system,omitempty"`
  24. Logs *LogsMessage `json:"logs,omitempty"`
  25. }
  26. type HomeMessage struct {
  27. Memory *Chart `json:"memory,omitempty"`
  28. Traffic *Chart `json:"traffic,omitempty"`
  29. }
  30. type Chart struct {
  31. History []*ChartEntry `json:"history,omitempty"`
  32. New *ChartEntry `json:"new,omitempty"`
  33. }
  34. type ChartEntry struct {
  35. Time time.Time `json:"time,omitempty"`
  36. Value float64 `json:"value,omitempty"`
  37. }
  38. type ChainMessage struct {
  39. /* TODO (kurkomisi) */
  40. }
  41. type TxPoolMessage struct {
  42. /* TODO (kurkomisi) */
  43. }
  44. type NetworkMessage struct {
  45. /* TODO (kurkomisi) */
  46. }
  47. type SystemMessage struct {
  48. /* TODO (kurkomisi) */
  49. }
  50. type LogsMessage struct {
  51. Log string `json:"log,omitempty"`
  52. }