Documentation ¶
Index ¶
- func Proxy(ctx context.Context, id string, conn Conn, cli client.CommonAPIClient, ...) error
- func RuneCopy(dst io.Writer, src io.Reader) (written int, err error)
- func ScanRunesGreedy(data []byte, atEOF bool) (advance int, token []byte, err error)
- func WSIsClose(err error) bool
- type Command
- type Conn
- type WSConn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Proxy ¶
func Proxy(ctx context.Context, id string, conn Conn, cli client.CommonAPIClient, command Command) error
Proxy attaches to a docker container and proxies its stdin/out/err over a websocket using the terminado protocol.
func RuneCopy ¶
RuneCopy is like io.Copy, but only writes valid runes, waiting for more input if invalid. This uses ScanRunesGreedy to write as much as possible per read.
func ScanRunesGreedy ¶
ScanRunesGreedy is like bufio.ScanRunes, but will capture as many runes from the input as possible.
Types ¶
type Conn ¶
type Conn interface { ReadJSON(v interface{}) error WriteJSON(v interface{}) error Close() error IsClose(error) bool }
Conn is the interface for sending proxy data to the client.
type WSConn ¶
type WSConn struct {
// contains filtered or unexported fields
}
WSConn wraps a gobwas/ws connection.
Click to show internal directories.
Click to hide internal directories.