executor

package
v0.0.0-...-d25dbbd Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package executor provides SSH-based execution of Software Delivery template actions against managed remote servers.

The SSHExecutor is the sole concrete implementation of software.ComponentExecutor for server-target components. All placeholder substitution has already been applied to the ResolvedTemplate by the catalog loader; this package only interprets strategy strings and runs the resulting shell commands over SSH.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LocalExecutor

type LocalExecutor struct{}

LocalExecutor implements software.ComponentExecutor for AppOS-local components. Local components are read-mostly inventory entries; install and upgrade remain unsupported.

func NewLocalExecutor

func NewLocalExecutor(_ core.App) (*LocalExecutor, error)

func (*LocalExecutor) Detect

func (*LocalExecutor) Reinstall

func (*LocalExecutor) RunPreflight

type SSHExecutor

type SSHExecutor struct {
	// contains filtered or unexported fields
}

SSHExecutor implements software.ComponentExecutor against a remote server via SSH. It holds a single persistent SSH client connection that is reused for all commands, avoiding per-command TCP+SSH handshake overhead. It is created once per operation scope and is not safe for concurrent use.

func NewSSHExecutor

func NewSSHExecutor(app core.App, serverID, userID string) (*SSHExecutor, error)

NewSSHExecutor resolves the SSH configuration for serverID and establishes the underlying SSH connection. All subsequent commands reuse this single connection. userID may be empty; in that case the system account credential flow is used.

func (*SSHExecutor) Close

func (e *SSHExecutor) Close()

Close releases the underlying SSH client connection if one was established. Safe to call on a nil receiver.

func (*SSHExecutor) Detect

Detect checks whether the component binary is present and returns the detected version. installed_hint commands are tried in order; the first successful output determines installed state. version_command is run only when the component is detected as installed.

func (*SSHExecutor) Install

Install executes the install step defined by the template strategy. Supported strategies: "package" (apt-get), "script" (managed script). An empty strategy means the component is not installable via Software Delivery.

func (*SSHExecutor) Reinstall

Reinstall re-executes the primary reinstall step.

func (*SSHExecutor) RunPreflight

RunPreflight evaluates OS support, root privilege, and network availability against the template's PreflightSpec.

func (*SSHExecutor) SetOutputLogger

func (e *SSHExecutor) SetOutputLogger(logger func(string))

SetOutputLogger attaches a best-effort line logger for long-running command output.

func (*SSHExecutor) Uninstall

Uninstall executes the uninstall step defined by the template strategy. Supported strategies: "package" (apt-get remove), "script" (managed script with args).

func (*SSHExecutor) Upgrade

Upgrade executes the upgrade step defined by the template strategy. Supported strategies: "package" (apt-get --only-upgrade), "script" (managed script with args).

func (*SSHExecutor) Verify

Verify checks the component's current state using the template's verify strategy. Only "systemd" strategy is supported for server-target components.

Jump to

Keyboard shortcuts

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