ssh

package
v0.0.126 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package ssh provides kool ssh utilities (local port forward, etc.).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildSSHForwardArgv

func BuildSSHForwardArgv(localPort int, remoteHost string, remotePort int, sshHost string) []string

BuildSSHForwardArgv returns ssh args after the binary name for a local forward.

func Handle

func Handle(args []string) error

Handle is the production entry for kool ssh.

func HandleWith

func HandleWith(args []string, opts HandleOpts) error

HandleWith is the injectable entry used by tests.

Types

type HandleOpts

type HandleOpts struct {
	Stdout io.Writer
	Stderr io.Writer
	// RunSSH runs the ssh process and blocks until exit. Nil → real exec.
	// argv is the full argument list after "ssh" (not including binary name).
	RunSSH func(argv []string) error
	// WaitLocalReady waits until localPort accepts TCP. Nil → default dial loop.
	WaitLocalReady func(localPort int, timeout time.Duration) error
}

HandleOpts injects IO and process runner for tests.

Jump to

Keyboard shortcuts

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