ops

package
v0.0.0-...-a60d376 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultSCPPath = "/usr/bin/scp"

DefaultSCPPath is the default path to the scp binary

Variables

This section is empty.

Functions

func SSHSession

func SSHSession(options ...func(*common.Options)) bool

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

func SSHSessionWithContext(ctx context.Context, options ...func(*common.Options)) bool

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

Jump to

Keyboard shortcuts

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