replacements

package
v0.0.0-...-a78b8c7 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StartMonitoringTTYSizeForContainer

func StartMonitoringTTYSizeForContainer(ctx context.Context, docker *client.Client, stdoutStream *streams.Out, containerID string)

Based on "resizeTty" from github.com/docker/cli/cli/command/container/attach.go.

func StartMonitoringTTYSizeForExec

func StartMonitoringTTYSizeForExec(ctx context.Context, docker *client.Client, stdoutStream *streams.Out, execID string)

Types

type HijackedIOStreamer

type HijackedIOStreamer struct {
	InputStream  *streams.In
	OutputStream *streams.Out
	ErrorStream  *streams.Out

	Resp types.HijackedResponse

	Tty bool
}

func (*HijackedIOStreamer) Stream

func (h *HijackedIOStreamer) Stream(ctx context.Context) error

FIXME: if the output stream ends first, this method will leak the input streaming goroutine until one last read() operation returns. In the context of this Kotlin library, the stdin stream will be closed by the Kotlin side as soon as the container exits if the stdin stream is an Okio-backed input stream, so the goroutine will exit once that happens. If the stdin stream is /dev/stdin, then the goroutine will exit after consuming one more read operation, which may not happen for quite some time. There doesn't seem to be an easy way to avoid this.

type Reader

type Reader struct {
	// contains filtered or unexported fields
}

Reader is a Reader with progress bar.

func NewProgressReader

func NewProgressReader(in io.ReadCloser, out progress.Output, size int64, id, action string) *Reader

NewProgressReader creates a new ProgressReader.

func (*Reader) Close

func (p *Reader) Close() error

Close closes the progress reader and its underlying reader.

func (*Reader) Read

func (p *Reader) Read(buf []byte) (n int, err error)

Jump to

Keyboard shortcuts

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