MCPcopy
hub / github.com/kubernetes/client-go / stream

Method stream

tools/remotecommand/v3.go:85–107  ·  view source on GitHub ↗
(conn streamCreator)

Source from the content-addressed store, hash-verified

83}
84
85func (p *streamProtocolV3) stream(conn streamCreator) error {
86 if err := p.createStreams(conn); err != nil {
87 return err
88 }
89
90 // now that all the streams have been created, proceed with reading & copying
91
92 errorChan := watchErrorStream(p.errorStream, &errorDecoderV3{})
93
94 p.handleResizes()
95
96 p.copyStdin()
97
98 var wg sync.WaitGroup
99 p.copyStdout(&wg)
100 p.copyStderr(&wg)
101
102 // we're waiting for stdout/stderr to finish copying
103 wg.Wait()
104
105 // waits for errorStream to finish reading with an error or nil
106 return <-errorChan
107}
108
109type errorDecoderV3 struct {
110 errorDecoderV2

Callers

nothing calls this directly

Calls 6

createStreamsMethod · 0.95
handleResizesMethod · 0.95
watchErrorStreamFunction · 0.85
copyStdinMethod · 0.80
copyStdoutMethod · 0.80
copyStderrMethod · 0.80

Tested by

no test coverage detected