From: Sebastien Douheret Date: Mon, 15 May 2017 08:57:25 +0000 (+0200) Subject: Fix invalid json encoding definition X-Git-Tag: v0.0.1-alpha~39 X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=commitdiff_plain;h=2028752efc680c4c409f6f36bcf88104493d42c4;p=src%2Fxds%2Fxds-server.git Fix invalid json encoding definition --- diff --git a/lib/apiv1/exec.go b/lib/apiv1/exec.go index f7beea6..b0bfd41 100644 --- a/lib/apiv1/exec.go +++ b/lib/apiv1/exec.go @@ -22,7 +22,7 @@ type ExecArgs struct { // ExecOutMsg Message send on each output (stdout+stderr) of executed command type ExecOutMsg struct { CmdID string `json:"cmdID"` - Timestamp string `json:timestamp` + Timestamp string `json:"timestamp"` Stdout string `json:"stdout"` Stderr string `json:"stderr"` } @@ -30,13 +30,15 @@ type ExecOutMsg struct { // ExecExitMsg Message send when executed command exited type ExecExitMsg struct { CmdID string `json:"cmdID"` - Timestamp string `json:timestamp` + Timestamp string `json:"timestamp"` Code int `json:"code"` Error error `json:"error"` } -// Event name send in WS +// ExecOutEvent Event send in WS when characters are received const ExecOutEvent = "exec:output" + +// ExecExitEvent Event send in WS when program exited const ExecExitEvent = "exec:exit" var execCommandID = 1 diff --git a/lib/apiv1/make.go b/lib/apiv1/make.go index eac6210..9596e13 100644 --- a/lib/apiv1/make.go +++ b/lib/apiv1/make.go @@ -22,7 +22,7 @@ type MakeArgs struct { // MakeOutMsg Message send on each output (stdout+stderr) of make command type MakeOutMsg struct { CmdID string `json:"cmdID"` - Timestamp string `json:timestamp` + Timestamp string `json:"timestamp"` Stdout string `json:"stdout"` Stderr string `json:"stderr"` } @@ -30,13 +30,15 @@ type MakeOutMsg struct { // MakeExitMsg Message send on make command exit type MakeExitMsg struct { CmdID string `json:"cmdID"` - Timestamp string `json:timestamp` + Timestamp string `json:"timestamp"` Code int `json:"code"` Error error `json:"error"` } -// Event name send in WS +// MakeOutEvent Event send in WS when characters are received on stdout/stderr const MakeOutEvent = "make:output" + +// MakeExitEvent Event send in WS when command exited const MakeExitEvent = "make:exit" var makeCommandID = 1