remotecommand

package
v1.11.11 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ServeAttach

func ServeAttach(w http.ResponseWriter, req *http.Request, attacher Attacher, podName string, uid types.UID, container string, streamOpts *Options, idleTimeout, streamCreationTimeout time.Duration, supportedProtocols []string)

ServeAttach handles requests to attach to a container. After creating/receiving the required streams, it delegates the actual attachment to the attacher.

func ServeExec

func ServeExec(w http.ResponseWriter, req *http.Request, executor Executor, podName string, uid types.UID, container string, cmd []string, streamOpts *Options, idleTimeout, streamCreationTimeout time.Duration, supportedProtocols []string)

ServeExec handles requests to execute a command in a container. After creating/receiving the required streams, it delegates the actual execution to the executor.

Types

type Attacher

type Attacher interface {
	// AttachToContainer attaches to a container in the pod, copying data
	// between in/out/err and the container's stdin/stdout/stderr.
	AttachToContainer(name string, uid types.UID, container string, in io.Reader, out, err io.WriteCloser, tty bool, resize <-chan remotecommand.TerminalSize, timeout time.Duration) error
}

Attacher knows how to attach to a container in a pod.

type Executor

type Executor interface {
	// ExecInContainer executes a command in a container in the pod, copying data
	// between in/out/err and the container's stdin/stdout/stderr.
	ExecInContainer(name string, uid types.UID, container string, cmd []string, in io.Reader, out, err io.WriteCloser, tty bool, resize <-chan remotecommand.TerminalSize, timeout time.Duration) error
}

Executor knows how to execute a command in a container in a pod.

type Options

type Options struct {
	Stdin  bool
	Stdout bool
	Stderr bool
	TTY    bool
}

Options contains details about which streams are required for remote command execution.

func NewOptions

func NewOptions(req *http.Request) (*Options, error)

NewOptions creates a new Options from the Request.

Jump to

Keyboard shortcuts

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