remotecommand

package
v0.0.0-...-d547166 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2016 License: Apache-2.0, Apache-2.0 Imports: 13 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

View Source
const (
	// The SPDY subprotocol "channel.k8s.io" is used for remote command
	// attachment/execution. This represents the initial unversioned subprotocol,
	// which has the known bugs http://issues.k8s.io/13394 and
	// http://issues.k8s.io/13395.
	StreamProtocolV1Name = "channel.k8s.io"
	// The SPDY subprotocol "v2.channel.k8s.io" is used for remote command
	// attachment/execution. It is the second version of the subprotocol and
	// resolves the issues present in the first version.
	StreamProtocolV2Name = "v2.channel.k8s.io"
)

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(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 *client.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