mirror of https://github.com/docker/compose.git
Enhance JSON progress events with more fields.
Signed-off-by: Cody Rigney <cody.rigney@docker.com>
This commit is contained in:
parent
bc733508d6
commit
44337d2bbf
|
@ -33,8 +33,12 @@ type jsonMessage struct {
|
||||||
DryRun bool `json:"dry-run,omitempty"`
|
DryRun bool `json:"dry-run,omitempty"`
|
||||||
Tail bool `json:"tail,omitempty"`
|
Tail bool `json:"tail,omitempty"`
|
||||||
ID string `json:"id,omitempty"`
|
ID string `json:"id,omitempty"`
|
||||||
|
ParentID string `json:"parent_id,omitempty"`
|
||||||
Text string `json:"text,omitempty"`
|
Text string `json:"text,omitempty"`
|
||||||
Status string `json:"status,omitempty"`
|
Status string `json:"status,omitempty"`
|
||||||
|
Current int64 `json:"current,omitempty"`
|
||||||
|
Total int64 `json:"total,omitempty"`
|
||||||
|
Percent int `json:"percent,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *jsonWriter) Start(ctx context.Context) error {
|
func (p *jsonWriter) Start(ctx context.Context) error {
|
||||||
|
@ -53,6 +57,10 @@ func (p *jsonWriter) Event(e Event) {
|
||||||
ID: e.ID,
|
ID: e.ID,
|
||||||
Text: e.Text,
|
Text: e.Text,
|
||||||
Status: e.StatusText,
|
Status: e.StatusText,
|
||||||
|
ParentID: e.ParentID,
|
||||||
|
Current: e.Current,
|
||||||
|
Total: e.Total,
|
||||||
|
Percent: e.Percent,
|
||||||
}
|
}
|
||||||
marshal, err := json.Marshal(message)
|
marshal, err := json.Marshal(message)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
|
|
Loading…
Reference in New Issue