Documentation ¶
Index ¶
- Constants
- type NamespaceService
- func (nss *NamespaceService) DeleteNamespace(name string) error
- func (nss *NamespaceService) GetNamespaceDetail(name string) (*k8sResponse.NamespaceDetail, error)
- func (nss *NamespaceService) GetNamespaceList(info request.PageInfo) ([]k8sResponse.NamespaceBrief, int, error)
- func (nss *NamespaceService) GetNamespaceName() ([]string, error)
- type NodeService
- type PodService
- func (ps *PodService) DeletePod(namespace string, pod string) error
- func (ps *PodService) GetPodDetail(namespace string, pod string) (*modelK8s.PodDetail, error)
- func (ps *PodService) GetPodLog(namespace string, pod string, container string, lines int64, follow bool) (string, error)
- func (ps *PodService) GetPodWebSSH(namespace string, podName string, containerName string, cfg *rest.Config, ...) error
- func (ps *PodService) GetPods(namespace string, page int, pageSize int) ([]modelK8s.PodBrief, int, error)
- func (ps *PodService) NewTerminalSession(conn *websocket.Conn) (*TerminalSession, error)
- type PtyHandler
- type ResourceService
- type ServiceGroup
- type TerminalMessage
- type TerminalSession
Constants ¶
const END_OF_TRANSMISSION = "\u0004"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NamespaceService ¶
type NamespaceService struct{}
func (*NamespaceService) DeleteNamespace ¶
func (nss *NamespaceService) DeleteNamespace(name string) error
DeleteNamespace 删除namespace
func (*NamespaceService) GetNamespaceDetail ¶
func (nss *NamespaceService) GetNamespaceDetail(name string) (*k8sResponse.NamespaceDetail, error)
GetNamespaceDetail 获取某个namespace详情
func (*NamespaceService) GetNamespaceList ¶
func (nss *NamespaceService) GetNamespaceList(info request.PageInfo) ([]k8sResponse.NamespaceBrief, int, error)
GetNamespaceList 获取namespace list
func (*NamespaceService) GetNamespaceName ¶
func (nss *NamespaceService) GetNamespaceName() ([]string, error)
GetNamespaceName 获取命名空间名称
type NodeService ¶
type NodeService struct{}
func (*NodeService) GetNodeDetail ¶
func (n *NodeService) GetNodeDetail(name string) (*modelK8s.NodeDetail, error)
func (*NodeService) GetNodePods ¶
func (n *NodeService) GetNodePods(name string, info request.PageInfo) ([]modelK8s.RelatedPod, int64, error)
GetNodePods 获取节点上的pod信息
type PodService ¶
type PodService struct{}
func (*PodService) DeletePod ¶
func (ps *PodService) DeletePod(namespace string, pod string) error
DeletePod 删除pod
func (*PodService) GetPodDetail ¶
GetPodDetail 获取指定pod详情
func (*PodService) GetPodLog ¶
func (ps *PodService) GetPodLog(namespace string, pod string, container string, lines int64, follow bool) (string, error)
GetPodLog 获取pod日志
func (*PodService) GetPodWebSSH ¶
func (ps *PodService) GetPodWebSSH(namespace string, podName string, containerName string, cfg *rest.Config, ptyHandler PtyHandler) error
GetPodWebSSH pod webSSH
func (*PodService) GetPods ¶
func (ps *PodService) GetPods(namespace string, page int, pageSize int) ([]modelK8s.PodBrief, int, error)
GetPods 获取集群pods
func (*PodService) NewTerminalSession ¶
func (ps *PodService) NewTerminalSession(conn *websocket.Conn) (*TerminalSession, error)
type PtyHandler ¶
type PtyHandler interface { io.Reader io.Writer remotecommand.TerminalSizeQueue }
PtyHandler is what remoteCommand expects from a pty
type ResourceService ¶
type ResourceService struct{}
func (*ResourceService) GetResourceRaw ¶
func (rs *ResourceService) GetResourceRaw(name string, resource string, namespace string) (raw interface{}, err error)
type ServiceGroup ¶
type ServiceGroup struct { NodeService ResourceService NamespaceService PodService }
type TerminalMessage ¶
type TerminalMessage struct { Op string `json:"op"` Data string `json:"data"` //SessionID string `json:"sessionID"` Rows uint16 `json:"rows"` Cols uint16 `json:"cols"` }
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
}
func (*TerminalSession) Next ¶
func (t *TerminalSession) Next() *remotecommand.TerminalSize
Next TerminalSize handles pty->process resize events Called in a loop from remotecommand as long as the process is running