exec

package
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 13, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	STDIN   = "stdin"
	CONNECT = "connect"
)

shell command type

Variables

This section is empty.

Functions

This section is empty.

Types

type Message

type Message struct {
	Method string      `json:"method"`
	Data   interface{} `json:"data"`
}

Message is the socket message of ssh

type Option

type Option struct {
	Cluster   string
	Namespace string
	Pod       string
	Container string
	Terminal  bool

	Cmd string
}

Option is the option of exec proxy

type SocketShell

type SocketShell struct {
	Connection *websocket.Conn
	Command    string
	Exit       bool
}

SocketShell 并不是 ssh 的全称,ssh的全称是 Sentry Socket 这里这样定义的目的只是描述 shell 的实现形式

func NewSocketShell

func NewSocketShell() *SocketShell

NewSocketShell is the function to init a new socket shell

func (*SocketShell) Connect

func (s *SocketShell) Connect(option Option) error

Connect is the function to connect to remote k8s pod

func (*SocketShell) Listen

func (s *SocketShell) Listen()

Listen is the function to listen to remote k8s pod

func (*SocketShell) StdinSend

func (s *SocketShell) StdinSend()

StdinSend is the function to send message from stdin to remote k8s pod

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL