remotecommand

package
v1.1.0-beta3 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2016 License: Apache-2.0, Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package remotecommand adds support for executing commands in containers, with support for separate stdin, stdout, and stderr streams, as well as TTY.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Executor

type Executor interface {
	// Stream initiates the transport of the standard shell streams. It will transport any
	// non-nil stream to a remote system, and return an error if a problem occurs. If tty
	// is set, the stderr stream is not used (raw TTY manages stdout and stderr over the
	// stdout stream).
	Stream(supportedProtocols []string, stdin io.Reader, stdout, stderr io.Writer, tty bool) error
}

Executor is an interface for transporting shell-style streams.

type StreamExecutor

type StreamExecutor interface {
	Executor
	httpstream.Dialer
}

StreamExecutor supports the ability to dial an httpstream connection and the ability to run a command line stream protocol over that dialer.

func NewExecutor

func NewExecutor(config *restclient.Config, method string, url *url.URL) (StreamExecutor, error)

NewExecutor connects to the provided server and upgrades the connection to multiplexed bidirectional streams. The current implementation uses SPDY, but this could be replaced with HTTP/2 once it's available, or something else. TODO: the common code between this and portforward could be abstracted.

func NewStreamExecutor

func NewStreamExecutor(upgrader httpstream.UpgradeRoundTripper, fn func(http.RoundTripper) http.RoundTripper, method string, url *url.URL) (StreamExecutor, error)

NewStreamExecutor upgrades the request so that it supports multiplexed bidirectional streams. This method takes a stream upgrader and an optional function that is invoked to wrap the round tripper. This method may be used by clients that are lower level than Kubernetes clients or need to provide their own upgrade round tripper.

Jump to

Keyboard shortcuts

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