ssh

package
v0.0.0-...-12cf33c Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EcsSSH

type EcsSSH interface {
	Connect(ip string, port int, username string, password string, key string, mode int8, userID int) error
	AddPublicKeyToRemoteHost(publicKey string) error
	Run(command string) (string, error)
	Close() error
	Web2SSH(ws *websocket.Conn)
}

func NewSSH

func NewSSH(logger *zap.Logger) EcsSSH

NewSSH 创建新的SSH连接管理器

type MyReader

type MyReader struct {
	// contains filtered or unexported fields
}

MyReader 实现从WebSocket读取数据的io.Reader接口

func (MyReader) Read

func (r MyReader) Read(p []byte) (n int, err error)

Read 从WebSocket读取用户输入的命令数据

type MyWriter

type MyWriter struct {
	// contains filtered or unexported fields
}

MyWriter 实现向WebSocket写入数据的io.Writer接口

func (MyWriter) Write

func (w MyWriter) Write(p []byte) (n int, err error)

Write 向WebSocket发送终端输出数据

Jump to

Keyboard shortcuts

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