Documentation ¶
Index ¶
- type CommandConfig
- type CommandManager
- type CommandResult
- type SSHDialer
- type UnixCommandManager
- func (u *UnixCommandManager) Run(ctx context.Context, config CommandConfig) (CommandResult, error)
- func (u *UnixCommandManager) RunLocal(ctx context.Context, config CommandConfig) (CommandResult, error)
- func (u *UnixCommandManager) RunRemote(ctx context.Context, config CommandConfig) (CommandResult, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommandConfig ¶
CommandConfig holds configurations for command execution.
type CommandManager ¶
type CommandManager interface { // RunLocal executes a command on the local system. RunLocal(ctx context.Context, config CommandConfig) (CommandResult, error) // RunRemote executes a command on a remote system via SSH. RunRemote(ctx context.Context, config CommandConfig) (CommandResult, error) // Run executes a command on the local system if the host is localhost, otherwise it executes the command on the remote system. Run(ctx context.Context, config CommandConfig) (CommandResult, error) }
CommandManager provides methods to execute commands, both locally and remotely.
type CommandResult ¶
type CommandResult struct { STDOUT string STDERR string ExitCode int Duration time.Duration Command string Timestamp time.Time }
CommandResult encapsulates the results from a command execution.
type UnixCommandManager ¶
type UnixCommandManager struct { Hostname string SSHClient SSHDialer common.Credentials }
func (*UnixCommandManager) Run ¶
func (u *UnixCommandManager) Run(ctx context.Context, config CommandConfig) (CommandResult, error)
func (*UnixCommandManager) RunLocal ¶
func (u *UnixCommandManager) RunLocal(ctx context.Context, config CommandConfig) (CommandResult, error)
func (*UnixCommandManager) RunRemote ¶
func (u *UnixCommandManager) RunRemote(ctx context.Context, config CommandConfig) (CommandResult, error)
Click to show internal directories.
Click to hide internal directories.