Documentation
¶
Index ¶
Constants ¶
const DefaultSCPPath = "/usr/bin/scp"
DefaultSCPPath is the default path to the scp binary
Variables ¶
This section is empty.
Functions ¶
func SSHSession ¶
SSHSession creates SSH sessions to multiple machines and executes commands or copy operations. It takes functional options to configure the SSH connection and runs the operation concurrently on all specified machines. Returns true if all operations succeed, false otherwise. This function uses a background context. For cancellation support, use SSHSessionWithContext.
func SSHSessionWithContext ¶
SSHSessionWithContext creates SSH sessions with context support for cancellation. If the context is cancelled before all operations complete, the function returns early. Returns true if all operations succeed, false otherwise.
Types ¶
type Formatter ¶
type Formatter interface {
FormatResult(hostname, output string, err error) string
FormatError(err error) string
}
Formatter defines the interface for output formatting.
type JSONFormatter ¶
type JSONFormatter struct{}
JSONFormatter implements JSON output formatting.
func (*JSONFormatter) FormatError ¶
func (f *JSONFormatter) FormatError(err error) string
func (*JSONFormatter) FormatResult ¶
func (f *JSONFormatter) FormatResult(hostname, output string, err error) string
type TextFormatter ¶
type TextFormatter struct{}
TextFormatter implements plain text output formatting.
func (*TextFormatter) FormatError ¶
func (f *TextFormatter) FormatError(err error) string
func (*TextFormatter) FormatResult ¶
func (f *TextFormatter) FormatResult(hostname, output string, err error) string