Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateAttachHandler ¶ added in v0.2.6
CreateAttachHandler is called from main for /v1/sockjs
func WaitForTerminal ¶ added in v0.2.6
func WaitForTerminal(k8sClient kubernetes.Interface, cfg *rest.Config, request *restful.Request, sessionId string)
WaitForTerminal is called from apihandler.handleAttach as a goroutine Waits for the SockJS connection to be opened by the client the session to be bound in handleTerminalSession
Types ¶
type App ¶
type App struct { Config config.Config ServiceProvider *serviceprovider.Container }
App is the structure to set config & service provider of APP
func (*App) InitilizeService ¶
func (a *App) InitilizeService()
InitilizeService weavering services with global variables inside server package
func (*App) LoadConfig ¶
LoadConfig consumes a string of path to the json config file and read config file into Config.
type PtyHandler ¶ added in v0.2.6
type PtyHandler interface { io.Reader io.Writer remotecommand.TerminalSizeQueue }
PtyHandler is what remotecommand expects from a pty
type TerminalMessage ¶ added in v0.2.6
TerminalMessage is the messaging protocol between ShellController and TerminalSession.
OP DIRECTION FIELD(S) USED DESCRIPTION --------------------------------------------------------------------- bind fe->be SessionID Id sent back from TerminalResponse stdin fe->be Data Keystrokes/paste buffer resize fe->be Rows, Cols New terminal size stdout be->fe Data Output from the process toast be->fe Data OOB message to be shown to the user
type TerminalResponse ¶ added in v0.2.6
type TerminalResponse struct {
Id string `json:"id"`
}
TerminalResponse is sent by handleExecShell. The Id is a random session id that binds the original REST request and the SockJS connection. Any clientapi in possession of this Id can hijack the terminal session.
type TerminalSession ¶ added in v0.2.6
type TerminalSession struct {
// contains filtered or unexported fields
}
TerminalSession implements PtyHandler (using a SockJS connection)
func (TerminalSession) Close ¶ added in v0.2.6
func (t TerminalSession) Close(status uint32, reason string)
Close shuts down the SockJS connection and sends the status code and reason to the client Can happen if the process exits or if there is an error starting up the process For now the status code is unused and reason is shown to the user (unless "")
func (TerminalSession) Next ¶ added in v0.2.6
func (t TerminalSession) Next() *remotecommand.TerminalSize
TerminalSize handles pty->process resize events Called in a loop from remotecommand as long as the process is running
func (TerminalSession) Read ¶ added in v0.2.6
func (t TerminalSession) Read(p []byte) (int, error)
Read handles pty->process messages (stdin, resize) Called in a loop from remotecommand as long as the process is running
func (TerminalSession) Toast ¶ added in v0.2.6
func (t TerminalSession) Toast(p string) error
Toast can be used to send the user any OOB messages hterm puts these in the center of the terminal
Source Files
¶
- app.go
- handler_app.go
- handler_deployment.go
- handler_log.go
- handler_namespace.go
- handler_network.go
- handler_ovs.go
- handler_pod.go
- handler_prometheus.go
- handler_registry.go
- handler_service.go
- handler_shell.go
- handler_storage.go
- handler_terminal.go
- handler_user.go
- handler_version.go
- handler_volume.go
- route.go
- route_filter.go
- testutils.go