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

Method On

cmd/display/tty.go:188–203  ·  cmd/display/tty.go::ttyWriter.On
(events ...api.Resource)

Source from the content-addressed store, hash-verified

186}
187
188func (w *ttyWriter) On(events ...api.Resource) {
189 w.mtx.Lock()
190 defer w.mtx.Unlock()
191 for _, e := range events {
192 if e.ID == "Compose" {
193 _, _ = fmt.Fprintln(w.info, ErrorColor(e.Details))
194 continue
195 }
196
197 if w.operation != "start" && (e.Text == api.StatusStarted || e.Text == api.StatusStarting) && !w.detached {
198 // skip those events to avoid mix with container logs
199 continue
200 }
201 w.event(e)
202 }
203}
204
205func (w *ttyWriter) event(e api.Resource) {
206 // Suspend print while a build is in progress, to avoid collision with buildkit Display

Callers

nothing calls this directly

Calls 2

eventMethod · 0.95
LockMethod · 0.45

Tested by

no test coverage detected