config

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2026 License: AGPL-3.0 Imports: 1 Imported by: 0

Documentation

Overview

Package config provides configuration types for SSH-based automation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NodeConfig added in v0.4.0

type NodeConfig struct {
	// SSH connection settings
	SSHHost  string
	SSHPort  string
	SSHLogin string
	SSHKey   string

	// User settings
	RootUser    string
	NonRootUser string

	// Database settings (when applicable)
	DBPort         string
	DBRootPassword string

	// Extra arguments passed via command line
	Args map[string]string

	// Logger for structured logging. Defaults to slog.Default() if nil.
	Logger *slog.Logger

	// IsDryRunMode indicates whether to simulate execution without making changes.
	// When true, ssh.Run() will log commands and return "[dry-run]" marker instead of executing.
	IsDryRunMode bool
}

NodeConfig holds all configuration variables for remote server operations.

func (NodeConfig) GetArg added in v0.4.0

func (c NodeConfig) GetArg(key string) string

GetArg retrieves an argument from the Args map. Returns empty string if not found.

func (NodeConfig) GetArgOr added in v0.4.0

func (c NodeConfig) GetArgOr(key, defaultValue string) string

GetArgOr retrieves an argument from the Args map with a default value.

func (NodeConfig) GetLoggerOrDefault added in v0.10.0

func (c NodeConfig) GetLoggerOrDefault() *slog.Logger

GetLoggerOrDefault returns the configured logger or slog.Default() if nil.

func (NodeConfig) SSHAddr added in v0.4.0

func (c NodeConfig) SSHAddr() string

SSHAddr returns the full SSH address as host:port. Defaults to port 22 if SSHPort is not set.

Jump to

Keyboard shortcuts

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