MCPcopy
hub / github.com/docker/compose / Event

Method Event

cmd/display/json.go:55–72  ·  view source on GitHub ↗
(e api.Resource)

Source from the content-addressed store, hash-verified

53}
54
55func (p *jsonWriter) Event(e api.Resource) {
56 message := &jsonMessage{
57 DryRun: p.dryRun,
58 Tail: false,
59 ID: e.ID,
60 Status: e.StatusText(),
61 Text: e.Text,
62 Details: e.Details,
63 ParentID: e.ParentID,
64 Current: e.Current,
65 Total: e.Total,
66 Percent: e.Percent,
67 }
68 marshal, err := json.Marshal(message)
69 if err == nil {
70 _, _ = fmt.Fprintln(p.out, string(marshal))
71 }
72}
73
74func (p *jsonWriter) On(events ...api.Resource) {
75 for _, e := range events {

Callers 2

TestJsonWriter_EventFunction · 0.95
OnMethod · 0.95

Calls 1

StatusTextMethod · 0.80

Tested by 1

TestJsonWriter_EventFunction · 0.76