ssh

package
v0.0.0-...-7f005ae Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2025 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Overview

Package ssh contains utilities for making and managing ssh connections.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SSHOptsCmdline

func SSHOptsCmdline(sshOpts []string) ([]string, error)

SSHOptsCmdline converts list of ssh options to a valid cmdline.

Types

type ConcurrentSSHManager

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

func NewConcurrentSSHManager

func NewConcurrentSSHManager(sshRunner *Runner, retryDelay time.Duration) *ConcurrentSSHManager

func (*ConcurrentSSHManager) LogExecutorStates

func (m *ConcurrentSSHManager) LogExecutorStates()

func (*ConcurrentSSHManager) SSH

func (m *ConcurrentSSHManager) SSH(ctx context.Context, retryOnError bool, description string, exec Executor)

func (*ConcurrentSSHManager) WaitUntilAllSSHCompleted

func (m *ConcurrentSSHManager) WaitUntilAllSSHCompleted(ctx context.Context)

type Executor

type Executor func(ctx context.Context, r *Runner) error

type Runner

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

func NewRunner

func NewRunner(sshOpts []string) *Runner

func (*Runner) Run

func (r *Runner) Run(ctx context.Context, flags []string, posArgs []string) error

func (*Runner) TunnelLocalPortToRemotePort

func (r *Runner) TunnelLocalPortToRemotePort(ctx context.Context, localPort int, remoteHost string, remotePort int, sshHost string) error

TunnelLocalPortToRemotePort establishes an ssh tunnel from localPort to remoteHost:remotePort on sshHost.

type TunnelRegistry

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

TunnelRegistry records mappings of remote hostnames to local hostnames that represent tunnels from the local to remote hostnames.

func NewTunnelRegistry

func NewTunnelRegistry() *TunnelRegistry

func (*TunnelRegistry) Get

func (tr *TunnelRegistry) Get(remoteHostname string) (string, bool)

func (*TunnelRegistry) PrintToLog

func (tr *TunnelRegistry) PrintToLog()

func (*TunnelRegistry) Set

func (tr *TunnelRegistry) Set(remoteHostname, localHostname string)

func (*TunnelRegistry) String

func (tr *TunnelRegistry) String() string

Jump to

Keyboard shortcuts

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