Documentation
¶
Index ¶
- Constants
- Variables
- func Execute(command string, resultWriter io.Writer) error
- func GetBash() string
- func GetFlagVar() string
- func IsDangerCommand(b []byte) bool
- func PTY2Websocket(ws WebsocketWriter, pty interfaces.Console)
- func ServeWebsocket(wsc Websocketer, cols, rows int) error
- func Start(pty Console) error
- func Websocket2PTY(ws Websocketer, pty interfaces.Console)
- type Console
- type WebsocketReader
- type WebsocketWriter
- type Websocketer
Constants ¶
View Source
const ( // TextMessage denotes a text data message. The text message payload is // interpreted as UTF-8 encoded text data. TextMessage = 1 // BinaryMessage denotes a binary data message. BinaryMessage = 2 // CloseMessage denotes a close control message. The optional message // payload contains a numeric code and text. Use the FormatCloseMessage // function to format a close message payload. CloseMessage = 8 // PingMessage denotes a ping control message. The optional message payload // is UTF-8 encoded text. PingMessage = 9 // PongMessage denotes a pong control message. The optional message payload // is UTF-8 encoded text. PongMessage = 10 )
The message types are defined in RFC 6455, section 11.8.
Variables ¶
View Source
var ( ErrProcessNotStarted = errors.New("Process has not been started") ErrInvalidCmd = errors.New("Invalid command") )
Functions ¶
func IsDangerCommand ¶ added in v0.0.2
func PTY2Websocket ¶
func PTY2Websocket(ws WebsocketWriter, pty interfaces.Console)
PTY2Websocket pty to websocket
func ServeWebsocket ¶
func ServeWebsocket(wsc Websocketer, cols, rows int) error
ServeWebsocket ServeWebsocket(wsc,120,60)
func Websocket2PTY ¶
func Websocket2PTY(ws Websocketer, pty interfaces.Console)
Websocket2PTY websocket to pty
Types ¶
type WebsocketReader ¶
WebsocketReader websocket reader
type WebsocketWriter ¶
WebsocketWriter websocket writer
type Websocketer ¶
type Websocketer interface {
WebsocketWriter
WebsocketReader
}
Websocketer websocket interface github.com/admpub/websocket github.com/gorilla/websocket
Source Files
¶
Click to show internal directories.
Click to hide internal directories.