sshclient

package
v0.1.0-beta.7 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2026 License: MIT Imports: 11 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

This section is empty.

Types

type OpenOptions

type OpenOptions struct {
	Connection      jumpserver.ClientConnection
	HostKeyCallback ssh.HostKeyCallback
	Timeout         time.Duration
	Stdout          io.Writer
	Stderr          io.Writer
	Terminal        TerminalOptions
}

type Runner

type Runner struct {
	Stdin           io.Reader
	Stdout          io.Writer
	Stderr          io.Writer
	HostKeyCallback ssh.HostKeyCallback
	Timeout         time.Duration
}

func (Runner) Run

func (r Runner) Run(ctx context.Context, connection jumpserver.ClientConnection) error

type Session

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

Session 是已经启动 shell 的双向 SSH 会话,供 CLI 和 GUI 共同使用。

func Open

func Open(ctx context.Context, options OpenOptions) (*Session, error)

func (*Session) Close

func (s *Session) Close() error

func (*Session) CloseInput

func (s *Session) CloseInput() error

func (*Session) ProbeLatency

func (s *Session) ProbeLatency() (time.Duration, error)

ProbeLatency 测量一次到 JumpServer SSH 网关的协议往返时间。 网关拒绝未知请求时仍然完成了应答,因此也构成有效测量。

func (*Session) Resize

func (s *Session) Resize(columns, rows int) error

func (*Session) Wait

func (s *Session) Wait() error

func (*Session) Write

func (s *Session) Write(data []byte) (int, error)

type TerminalOptions

type TerminalOptions struct {
	Name          string
	Columns, Rows int
}

Jump to

Keyboard shortcuts

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