spdy

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2021 License: MPL-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Handshake

func Handshake(req *http.Request, w http.ResponseWriter, serverProtocols []string) (string, error)

Handshake performs a subprotocol negotiation.

Types

type Args

type Args struct {
	Container string
	Command   []string
}

Args is the argument for the execute command

type Connection

type Connection interface {
	// CreateStream creates a new Stream with the supplied headers.
	CreateStream(headers http.Header) (net.Conn, error)

	// Accept accepts a new stream
	Accept() net.Conn

	// Close resets all streams and closes the connection.
	Close() error
}

Connection represents an upgraded HTTP connection with SDPY

func Client

func Client(conn net.Conn) (Connection, error)

Client starts a new SPDY client connection on the net.Conn

func Server

func Server(conn net.Conn) (Connection, error)

Server starts a new SPDY server connection on the net.Conn

func UpgradeResponse

func UpgradeResponse(w http.ResponseWriter, req *http.Request) (Connection, error)

UpgradeResponse upgrades an HTTP response to a SPDY multi-stream connection

type RemoteCommand

type RemoteCommand struct {
	URL         string
	TLSConfig   *tls.Config
	BearerToken string
}

RemoteCommand executes a remote command on Kubernetes

func (*RemoteCommand) Execute

func (r *RemoteCommand) Execute(args *Args) ([]byte, error)

Execute executes a specific command

type RoundTripper

type RoundTripper struct {
	//tlsConfig holds the TLS configuration for the connection.
	TLSConfig *tls.Config

	BearerToken string
	// contains filtered or unexported fields
}

RoundTripper upgrades an HTTP connection to enable streams with the SDPY protocol

func (*RoundTripper) NewConnection

func (r *RoundTripper) NewConnection(resp *http.Response) (Connection, error)

NewConnection validates the upgrade response.

func (*RoundTripper) RoundTrip

func (r *RoundTripper) RoundTrip(req *http.Request) (*http.Response, error)

RoundTrip executes the Request and upgrades it. After a successful upgrade, clients may call SpdyRoundTripper.Connection() to retrieve the upgraded connection.

Jump to

Keyboard shortcuts

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