internal

package
v0.0.0-...-5337229 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 10, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrintContainerLogs

func PrintContainerLogs(name string, out io.Reader)

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL