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

Method wrapDockerCliWithStreams

pkg/compose/compose.go:284–301  ·  pkg/compose/compose.go::composeService.wrapDockerCliWithStreams

wrapDockerCliWithStreams wraps the Docker CLI to intercept and override stream methods

(baseCli command.Cli)

Source from the content-addressed store, hash-verified

282
283// wrapDockerCliWithStreams wraps the Docker CLI to intercept and override stream methods
284func (s *composeService) wrapDockerCliWithStreams(baseCli command.Cli) command.Cli {
285 wrapper := &streamOverrideWrapper{
286 Cli: baseCli,
287 }
288
289 // Wrap custom streams in Docker CLI's stream types
290 if s.outStream != nil {
291 wrapper.outStream = streams.NewOut(s.outStream)
292 }
293 if s.errStream != nil {
294 wrapper.errStream = streams.NewOut(s.errStream)
295 }
296 if s.inStream != nil {
297 wrapper.inStream = streams.NewIn(&readCloserAdapter{r: s.inStream})
298 }
299
300 return wrapper
301}
302
303// streamOverrideWrapper wraps command.Cli to override streams with custom implementations
304type streamOverrideWrapper struct {

Callers 1

NewComposeServiceFunction · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected