sshcmd

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2026 License: MIT Imports: 12 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 NewSshClientCmd

func NewSshClientCmd() *gcli.Command

func NewSshExecCmd

func NewSshExecCmd() *gcli.Command

Types

type MultiExecutor

type MultiExecutor struct {
	Executor    *SshExecutor
	Concurrency int
}

func NewMultiExecutor

func NewMultiExecutor(executor *SshExecutor, concurrency int) *MultiExecutor

func (*MultiExecutor) ExecuteAll

func (m *MultiExecutor) ExecuteAll(ips []string, script string, writer io.Writer) map[string]sshExecResult

type SshExecutor

type SshExecutor struct {
	*sshc.Client
	AutoConfirm bool
	EnvVars     map[string]string
}

func NewSshExecutor

func NewSshExecutor(username, password string) *SshExecutor

NewSshExecutor creates a new SSH executor with the given username and password. Default values: Port=22, Timeout=30s, Keepalive=30s, StrictHost=false.

Example:

executor := sshc.NewSshExecutor("root", "password")
executor.Port = 2222
executor.Timeout = 60 * time.Second

func (*SshExecutor) ExecuteOnHost

func (e *SshExecutor) ExecuteOnHost(ip, script string) (string, time.Duration, error)

Jump to

Keyboard shortcuts

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