aboutsummaryrefslogtreecommitdiffstats
path: root/dashboard/message.go
diff options
context:
space:
mode:
authorKurkó Mihály <kurkomisi@users.noreply.github.com>2018-07-11 15:59:04 +0800
committerPéter Szilágyi <peterke@gmail.com>2018-07-11 15:59:04 +0800
commita9835c1816bc49ee54c82b4f2a5b05cbcd89881b (patch)
treee1badefd627aa3a7c4e1937eab22b8fe3eb204d1 /dashboard/message.go
parent2eedbe799f5eb8766e4808d8a1810cc1c90c4b93 (diff)
downloaddexon-a9835c1816bc49ee54c82b4f2a5b05cbcd89881b.tar.gz
dexon-a9835c1816bc49ee54c82b4f2a5b05cbcd89881b.tar.zst
dexon-a9835c1816bc49ee54c82b4f2a5b05cbcd89881b.zip
cmd, dashboard, log: log collection and exploration (#17097)
* cmd, dashboard, internal, log, node: logging feature * cmd, dashboard, internal, log: requested changes * dashboard, vendor: gofmt, govendor, use vendored file watcher * dashboard, log: gofmt -s -w, goimports * dashboard, log: gosimple
Diffstat (limited to 'dashboard/message.go')
-rw-r--r--dashboard/message.go25
1 files changed, 23 insertions, 2 deletions
diff --git a/dashboard/message.go b/dashboard/message.go
index 84b8d7443..46856b9e6 100644
--- a/dashboard/message.go
+++ b/dashboard/message.go
@@ -16,7 +16,10 @@
package dashboard
-import "time"
+import (
+ "encoding/json"
+ "time"
+)
type Message struct {
General *GeneralMessage `json:"general,omitempty"`
@@ -67,6 +70,24 @@ type SystemMessage struct {
DiskWrite ChartEntries `json:"diskWrite,omitempty"`
}
+// LogsMessage wraps up a log chunk. If Source isn't present, the chunk is a stream chunk.
type LogsMessage struct {
- Log []string `json:"log,omitempty"`
+ Source *LogFile `json:"source,omitempty"` // Attributes of the log file.
+ Chunk json.RawMessage `json:"chunk"` // Contains log records.
+}
+
+// LogFile contains the attributes of a log file.
+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.
+}
+
+// Request represents the client request.
+type Request struct {
+ Logs *LogsRequest `json:"logs,omitempty"`
+}
+
+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.
}