sshx

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2025 License: MIT Imports: 14 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Auth

func Auth(gateway *GatewayConfig) (ssh.AuthMethod, error)

func ConnectToNextJumpHost

func ConnectToNextJumpHost(ctx context.Context, currentClient *ssh.Client, user string, host string, port int, method ssh.AuthMethod) (*ssh.Client, error)

func GetIntField

func GetIntField(data map[string]interface{}, key string, defaultValue int) int

GetIntField 获取字段值,若不存在则返回默认值,返回值为 int

func GetStringField

func GetStringField(data map[string]interface{}, key string, defaultValue string) string

GetStringField 获取字段值,若不存在则返回默认值

Types

type GatewayConfig

type GatewayConfig struct {
	AuthType   string
	Host       string
	Port       int
	Username   string
	Password   string
	PrivateKey string
	Passphrase string
	Sort       int
}

type MultiGatewayManager

type MultiGatewayManager struct {
	Gateways []*GatewayConfig
}

func NewMultiGatewayManager

func NewMultiGatewayManager(config []*GatewayConfig) *MultiGatewayManager

func (*MultiGatewayManager) Connect

func (mgm *MultiGatewayManager) Connect(ctx context.Context) (*ssh.Client, error)

type SSHConnect

type SSHConnect struct {
	StdinPipe io.WriteCloser
	// contains filtered or unexported fields
}

func NewSSHConnect

func NewSSHConnect(client *ssh.Client, conn *websocket.Conn, height, width int) (sshConn *SSHConnect, err error)

func (*SSHConnect) SendMessageToWebSocket

func (s *SSHConnect) SendMessageToWebSocket(msg string) error

func (*SSHConnect) Start

func (s *SSHConnect) Start()

func (*SSHConnect) Stop

func (s *SSHConnect) Stop()

func (*SSHConnect) WindowChange

func (s *SSHConnect) WindowChange(h int, w int) error

type TerminalMessage

type TerminalMessage struct {
	Operation string `json:"operation"`
	Data      string `json:"data"`
	Cols      int    `json:"cols"`
	Rows      int    `json:"rows"`
}

func NewMessage

func NewMessage(operation string, data string, cols, rows int) TerminalMessage

func ParseTerminalMessage

func ParseTerminalMessage(value []byte) (TerminalMessage, error)

Jump to

Keyboard shortcuts

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