diff options
Diffstat (limited to 'dashboard/message.go')
-rw-r--r-- | dashboard/message.go | 25 |
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. } |