github.com/yinchengtsinghua/golang-Eos-dpos-Ethereum@v0.0.0-20190121132951-92cc4225ed8e/dashboard/message.go (about)

     1  
     2  //此源码被清华学神尹成大魔王专业翻译分析并修改
     3  //尹成QQ77025077
     4  //尹成微信18510341407
     5  //尹成所在QQ群721929980
     6  //尹成邮箱 yinc13@mails.tsinghua.edu.cn
     7  //尹成毕业于清华大学,微软区块链领域全球最有价值专家
     8  //https://mvp.microsoft.com/zh-cn/PublicProfile/4033620
     9  //版权所有2017 Go Ethereum作者
    10  //此文件是Go以太坊库的一部分。
    11  //
    12  //Go-Ethereum库是免费软件:您可以重新分发它和/或修改
    13  //根据GNU发布的较低通用公共许可证的条款
    14  //自由软件基金会,或者许可证的第3版,或者
    15  //(由您选择)任何更高版本。
    16  //
    17  //Go以太坊图书馆的发行目的是希望它会有用,
    18  //但没有任何保证;甚至没有
    19  //适销性或特定用途的适用性。见
    20  //GNU较低的通用公共许可证,了解更多详细信息。
    21  //
    22  //你应该收到一份GNU较低级别的公共许可证副本
    23  //以及Go以太坊图书馆。如果没有,请参见<http://www.gnu.org/licenses/>。
    24  
    25  package dashboard
    26  
    27  import (
    28  	"encoding/json"
    29  	"time"
    30  )
    31  
    32  type Message struct {
    33  	General *GeneralMessage `json:"general,omitempty"`
    34  	Home    *HomeMessage    `json:"home,omitempty"`
    35  	Chain   *ChainMessage   `json:"chain,omitempty"`
    36  	TxPool  *TxPoolMessage  `json:"txpool,omitempty"`
    37  	Network *NetworkMessage `json:"network,omitempty"`
    38  	System  *SystemMessage  `json:"system,omitempty"`
    39  	Logs    *LogsMessage    `json:"logs,omitempty"`
    40  }
    41  
    42  type ChartEntries []*ChartEntry
    43  
    44  type ChartEntry struct {
    45  	Time  time.Time `json:"time,omitempty"`
    46  	Value float64   `json:"value,omitempty"`
    47  }
    48  
    49  type GeneralMessage struct {
    50  	Version string `json:"version,omitempty"`
    51  	Commit  string `json:"commit,omitempty"`
    52  }
    53  
    54  type HomeMessage struct {
    55   /*托多(Kurkomisi)*/
    56  }
    57  
    58  type ChainMessage struct {
    59   /*托多(Kurkomisi)*/
    60  }
    61  
    62  type TxPoolMessage struct {
    63   /*托多(Kurkomisi)*/
    64  }
    65  
    66  type NetworkMessage struct {
    67   /*托多(Kurkomisi)*/
    68  }
    69  
    70  type SystemMessage struct {
    71  	ActiveMemory   ChartEntries `json:"activeMemory,omitempty"`
    72  	VirtualMemory  ChartEntries `json:"virtualMemory,omitempty"`
    73  	NetworkIngress ChartEntries `json:"networkIngress,omitempty"`
    74  	NetworkEgress  ChartEntries `json:"networkEgress,omitempty"`
    75  	ProcessCPU     ChartEntries `json:"processCPU,omitempty"`
    76  	SystemCPU      ChartEntries `json:"systemCPU,omitempty"`
    77  	DiskRead       ChartEntries `json:"diskRead,omitempty"`
    78  	DiskWrite      ChartEntries `json:"diskWrite,omitempty"`
    79  }
    80  
    81  //logsmessage包装了一个日志块。如果源不存在,则块是流块。
    82  type LogsMessage struct {
    83  Source *LogFile        `json:"source,omitempty"` //日志文件的属性。
    84  Chunk  json.RawMessage `json:"chunk"`            //包含日志记录。
    85  }
    86  
    87  //日志文件包含日志文件的属性。
    88  type LogFile struct {
    89  Name string `json:"name"` //文件名。
    90  Last bool   `json:"last"` //指示实际日志文件是否是目录中的最后一个。
    91  }
    92  
    93  //请求表示客户端请求。
    94  type Request struct {
    95  	Logs *LogsRequest `json:"logs,omitempty"`
    96  }
    97  
    98  type LogsRequest struct {
    99  Name string `json:"name"` //请求处理程序根据此文件名搜索日志文件。
   100  Past bool   `json:"past"` //指示客户端是要上一个文件还是下一个文件。
   101  }