package stdcopy
import "github.com/docker/docker/pkg/stdcopy"
Index ¶
- Constants
- Variables
- func StdCopy(dstout, dsterr io.Writer, src io.Reader) (written int64, err error)
- type StdType
- type StdWriter
Constants ¶
const ( StdWriterPrefixLen = 8 StdWriterFdIndex = 0 StdWriterSizeIndex = 4 )
Variables ¶
Functions ¶
func StdCopy ¶
StdCopy is a modified version of io.Copy.
StdCopy will demultiplex `src`, assuming that it contains two streams, previously multiplexed together using a StdWriter instance. As it reads from `src`, StdCopy will write to `dstout` and `dsterr`.
StdCopy will read until it hits EOF on `src`. It will then return a nil error. In other words: if `err` is non nil, it indicates a real underlying error.
`written` will hold the total number of bytes written to `dstout` and `dsterr`.
Types ¶
type StdType ¶
type StdType [StdWriterPrefixLen]byte
type StdWriter ¶
func NewStdWriter ¶
NewStdWriter instantiates a new Writer. Everything written to it will be encapsulated using a custom format, and written to the underlying `w` stream. This allows multiple write streams (e.g. stdout and stderr) to be muxed into a single connection. `t` indicates the id of the stream to encapsulate. It can be stdcopy.Stdin, stdcopy.Stdout, stdcopy.Stderr.
func (*StdWriter) Write ¶
Source Files ¶
- Version
- v1.8.2
- Published
- Sep 10, 2015
- Platform
- js/wasm
- Imports
- 4 packages
- Last checked
- 3 minutes ago –
Tools for package owners.