MCPcopy Create free account
hub / github.com/baidu/EasyFaaS / initializeIO

Method initializeIO

pkg/funclet/init.go:178–195  ·  view source on GitHub ↗
(containerID string)

Source from the content-addressed store, hash-verified

176}
177
178func (f *Funclet) initializeIO(containerID string) (std *stdio, err error) {
179 var pr1, pr2 io.ReadCloser
180 std = &stdio{}
181 pr1, std.stdout, err = os.Pipe()
182 if err != nil {
183 return nil, err
184 }
185 logger1 := logs.NewLogger().WithField("container", containerID).WithField("type", "stdout")
186 go ReaderToLog(pr1, logger1)
187
188 pr2, std.stderr, err = os.Pipe()
189 if err != nil {
190 return nil, err
191 }
192 logger2 := logs.NewLogger().WithField("container", containerID).WithField("type", "stderr")
193 go ReaderToLog(pr2, logger2)
194 return
195}

Callers 1

StartContainerMethod · 0.95

Calls 3

NewLoggerFunction · 0.92
ReaderToLogFunction · 0.85
WithFieldMethod · 0.80

Tested by

no test coverage detected