Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Executor ¶
type Executor interface {
// Execute runs a command and returns its standard output as a string.
// It should return an error if the command fails to execute or exits with a non-zero status.
Execute(ctx context.Context, cmd string) (string, error)
// Close cleans up any resources associated with the executor.
Close() error
}
Executor defines an interface for running commands on a target host.
func NewExecutorFromURI ¶
NewExecutorFromURI creates a new Executor based on the provided target URI and options.
type ExecutorOptions ¶
type ExecutorOptions struct {
IdentityFile string
PasswordEnv string
AskPass bool
Insecure bool
Timeout time.Duration
}
ExecutorOptions holds configuration for creating an Executor.
type LocalExecutor ¶
type LocalExecutor struct{}
LocalExecutor executes commands on the local machine.
func NewLocalExecutor ¶
func NewLocalExecutor() *LocalExecutor
NewLocalExecutor returns a new LocalExecutor.
func (*LocalExecutor) Close ¶
func (e *LocalExecutor) Close() error
Close is a no-op for LocalExecutor.
type OSInfo ¶
type OSInfo struct {
Family OSFamily
Distro string // For Linux: ID from os-release
Version string // For Linux: VERSION_ID from os-release
OSName string // For Windows: Caption
}
OSInfo holds the fingerprinted operating system data.
type SSHExecutor ¶
type SSHExecutor struct {
// contains filtered or unexported fields
}
SSHExecutor executes commands on a remote host via SSH.
func NewSSHExecutor ¶
func NewSSHExecutor(opts SSHOptions) (*SSHExecutor, error)
NewSSHExecutor connects to an SSH server and returns an SSHExecutor.
func (*SSHExecutor) Close ¶
func (e *SSHExecutor) Close() error
Close closes the underlying SSH connection.
type SSHOptions ¶
type SSHOptions struct {
Host string
Port string
User string
IdentityFile string
Password string //nolint:gosec // false positive for struct field name
Insecure bool
Timeout time.Duration
}
SSHOptions holds the configuration for an SSH connection.
type Scanner ¶
type Scanner struct {
// contains filtered or unexported fields
}
Scanner performs host inventory scanning.
func NewScanner ¶
NewScanner creates a new Scanner using the provided Executor.
type WinRMExecutor ¶
type WinRMExecutor struct {
// contains filtered or unexported fields
}
WinRMExecutor executes commands on a remote Windows host via WinRM.
func NewWinRMExecutor ¶
func NewWinRMExecutor(opts WinRMOptions) (*WinRMExecutor, error)
NewWinRMExecutor connects to a WinRM endpoint and returns a WinRMExecutor.
func (*WinRMExecutor) Close ¶
func (e *WinRMExecutor) Close() error
Close is a no-op for WinRMExecutor as the client does not maintain an active TCP connection pool.