Documentation ¶
Index ¶
- Constants
- func CreateAttachHandler(path string) http.Handler
- func WaitForTerminal(k8sClient kubernetes.Interface, cfg *rest.Config, ...)
- type Handler
- func (h *Handler) CreateDeployment(c *gin.Context)
- func (h *Handler) CreateFLApp(c *gin.Context)
- func (h *Handler) CreateIngress(c *gin.Context)
- func (h *Handler) CreateSecret(c *gin.Context)
- func (h *Handler) CreateService(c *gin.Context)
- func (h *Handler) DeleteDeployment(c *gin.Context)
- func (h *Handler) DeleteFLApp(c *gin.Context)
- func (h *Handler) DeleteIngress(c *gin.Context)
- func (h *Handler) DeleteSecret(c *gin.Context)
- func (h *Handler) DeleteService(c *gin.Context)
- func (h *Handler) ExecShell(c *gin.Context)
- func (h *Handler) GetDeployment(c *gin.Context)
- func (h *Handler) GetFLApp(c *gin.Context)
- func (h *Handler) GetIngress(c *gin.Context)
- func (h *Handler) GetPod(c *gin.Context)
- func (h *Handler) GetSecret(c *gin.Context)
- func (h *Handler) GetService(c *gin.Context)
- func (h *Handler) ListDeployments(c *gin.Context)
- func (h *Handler) ListFLAppPods(c *gin.Context)
- func (h *Handler) ListFLApps(c *gin.Context)
- func (h *Handler) ListIngresses(c *gin.Context)
- func (h *Handler) ListNamespaces(c *gin.Context)
- func (h *Handler) ListPodEvents(c *gin.Context)
- func (h *Handler) ListPods(c *gin.Context)
- func (h *Handler) ListSecrets(c *gin.Context)
- func (h *Handler) ListServices(c *gin.Context)
- func (h *Handler) Run(stopCh <-chan struct{}) error
- func (h *Handler) UpdateDeployment(c *gin.Context)
- type PtyHandler
- type SessionMap
- type TerminalMessage
- type TerminalSession
Constants ¶
const END_OF_TRANSMISSION = "\u0004"
Variables ¶
This section is empty.
Functions ¶
func CreateAttachHandler ¶
CreateAttachHandler is called from main for /api/sockjs
func WaitForTerminal ¶
func WaitForTerminal(k8sClient kubernetes.Interface, cfg *rest.Config, namespace, podName, containerName, 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 Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler .
func NewHandler ¶
func NewHandler( restConfig *rest.Config, kubeClient *clientset.Clientset, crdClientset *crdclientset.Clientset, ) *Handler
NewHandler returns a new handler.
func (*Handler) CreateDeployment ¶
CreateDeployment create a deployment.
func (*Handler) CreateIngress ¶
CreateIngress create a ingress.
func (*Handler) CreateSecret ¶
CreateSecret create a secret.
func (*Handler) CreateService ¶
CreateService create a service.
func (*Handler) DeleteDeployment ¶
DeleteDeployment delete a deployment with name.
func (*Handler) DeleteIngress ¶
DeleteIngress delete a ingress with name.
func (*Handler) DeleteSecret ¶
DeleteSecret delete a secret with name.
func (*Handler) DeleteService ¶
DeleteService delete a service with name.
func (*Handler) GetDeployment ¶
GetDeployment returns a deloyment with name.
func (*Handler) GetIngress ¶
GetIngress returns a ingress with name.
func (*Handler) GetService ¶
GetService returns a service with name.
func (*Handler) ListDeployments ¶
ListDeployments returns services in namespace.
func (*Handler) ListIngresses ¶
ListIngresses returns ingresses in namespace.
func (*Handler) ListPodEvents ¶
ListPodEvents returns pod's events.
func (*Handler) ListSecrets ¶
ListSecrets returns secrets in namespace.
func (*Handler) ListServices ¶
ListServices returns services in namespace.
func (*Handler) UpdateDeployment ¶
UpdateDeployment update a deployment.
type PtyHandler ¶
type PtyHandler interface { io.Reader io.Writer remotecommand.TerminalSizeQueue }
PtyHandler is what remotecommand expects from a pty
type SessionMap ¶
type SessionMap struct { Sessions map[string]TerminalSession Lock sync.RWMutex }
SessionMap stores a map of all TerminalSession objects and a lock to avoid concurrent conflict
func (*SessionMap) Close ¶
func (sm *SessionMap) Close(sessionId string, 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 (*SessionMap) Get ¶
func (sm *SessionMap) Get(sessionId string) TerminalSession
Get return a given terminalSession by sessionId
func (*SessionMap) Set ¶
func (sm *SessionMap) Set(sessionId string, session TerminalSession)
Set store a TerminalSession to SessionMap
type TerminalMessage ¶
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 TerminalSession ¶
type TerminalSession struct {
// contains filtered or unexported fields
}
TerminalSession implements PtyHandler (using a SockJS connection)
func (TerminalSession) Next ¶
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 ¶
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 ¶
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