wsremotecommand

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Executor

type Executor struct {
	Upgrader *WebSocketUpgrader
	// contains filtered or unexported fields
}

func NewWebSocketExecutor

func NewWebSocketExecutor(config *rest.Config, url *url.URL, protocols []string) (*Executor, error)

func (*Executor) Close

func (e *Executor) Close() error

Close send the 'exit\r\n' command to k8s if recevied the kill or exit signal, cleanup the tty process in container.

func (*Executor) Stream

func (e *Executor) Stream(options StreamOptions) error

type StreamOptions

type StreamOptions struct {
	Stdin *websocket.Conn
}

StreamOptions holds information pertaining to the current streaming session: input/output streams

type WebSocketUpgrader

type WebSocketUpgrader struct {

	// Dialer is the dialer used to connect.  Used if non-nil.
	Dialer *websocket.Dialer

	Conn *websocket.Conn

	Header http.Header
	// contains filtered or unexported fields
}

WebSocketUpgrade knows how to upgrade an HTTP request to one that supports multiplexed streams. After RoundTrip() is invoked, Conn will be set and usable.

func RoundTripperFor

func RoundTripperFor(config *rest.Config) (*WebSocketUpgrader, http.RoundTripper, error)

RoundTripperFor returns a http header with the rest config.

func (*WebSocketUpgrader) RoundTrip

func (w *WebSocketUpgrader) RoundTrip(r *http.Request) (*http.Response, error)

Jump to

Keyboard shortcuts

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