sshcmd

package
v0.0.0-...-21f1268 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2026 License: MIT Imports: 12 Imported by: 0

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