MCPcopy Index your code
hub / github.com/containerd/containerd / Write

Method Write

core/remotes/docker/fetcher.go:180–195  ·  view source on GitHub ↗

Write implements the standard Write interface: it writes data to the internal buffer. If the read end is closed with an error, that err is returned as err; otherwise err is ErrClosedPipe.

(data []byte)

Source from the content-addressed store, hash-verified

178// buffer. If the read end is closed with an error, that err is returned as err;
179// otherwise err is ErrClosedPipe.
180func (w *pipeWriter) Write(data []byte) (int, error) {
181 w.cond.L.Lock()
182 defer w.cond.L.Unlock()
183
184 if w.werr != nil {
185 return 0, w.werr
186 }
187
188 if w.buf == nil {
189 w.buf = w.bufPool.Get()
190 }
191
192 n, err := w.buf.Write(data)
193 w.cond.Signal()
194 return n, err
195}
196
197// Close closes the writer; subsequent reads from the read half of the pipe will
198// return io.EOF once the internal buffer get empty.

Callers

nothing calls this directly

Calls 4

LockMethod · 0.65
UnlockMethod · 0.65
GetMethod · 0.65
WriteMethod · 0.65

Tested by

no test coverage detected