Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PrintContainerLogs ¶
PrintContainerLogs is used to print the output of a container to the stdout/err streams.
Types ¶
type ContainerLogWriter ¶
type ContainerLogWriter struct {
// contains filtered or unexported fields
}
ContainerLogWriter is an implementation of io.Writer used to capture and write a container's stdout and stderr to a specified io.Writer.
func NewContainerLogWriter ¶
func NewContainerLogWriter(name string, dst io.Writer) *ContainerLogWriter
NewContainerLogWriter is used to return a new instance of ContainerLogWriter, with a container's name and an output destination.
func (*ContainerLogWriter) Write ¶
func (w *ContainerLogWriter) Write(data []byte) (int, error)
Write is used to writes the given data to the underlying, destination io.Writer. The data will be split by each line, then outputed with the container's name as a prefix.
Note: the returned integer value will match the length of the data provided. This is due to an issue with the Docker stdcopy package, which expects the output length to match exactly the length of the data provided; not allowing any greater. https://github.com/moby/moby/issues/45377