Documentation
¶
Overview ¶
Package syncer provides SSH/SFTP file synchronization and an explicit remote container restart helper.
Synchronization and restart are intentionally separate. Syncer.Sync uploads files according to SyncConfig and never restarts containers. Callers that need restart behavior must explicitly call RestartContainer after their own application-level decision.
Index ¶
Constants ¶
const ( // SyncModeFull completely replaces the remote directory with local files. SyncModeFull = "full" // SyncModeIncremental uploads only new or modified files. SyncModeIncremental = "incremental" )
Variables ¶
This section is empty.
Functions ¶
func ConnectSSH ¶
ConnectSSH establishes an SSH connection
func RestartContainer ¶ added in v1.0.2
func RestartContainer(sshClient *ssh.Client, config ContainerRestartConfig, logger *logrus.Logger) error
RestartContainer explicitly restarts a remote container using the provided SSH client.
Types ¶
type ContainerRestartConfig ¶ added in v1.0.2
ContainerRestartConfig controls a manually requested container restart.
type SyncConfig ¶
SyncConfig holds synchronization parameters
type Syncer ¶
type Syncer struct {
// contains filtered or unexported fields
}
Syncer handles file synchronization
func NewWithSSHClient ¶ added in v1.0.2
func NewWithSSHClient(sshClient *ssh.Client, client *sftp.Client, syncConfig SyncConfig, logger *logrus.Logger) *Syncer
NewWithSSHClient creates a new Syncer with SSH command execution capabilities.
func (*Syncer) RestartContainer ¶ added in v1.0.2
func (s *Syncer) RestartContainer(config ContainerRestartConfig) error
RestartContainer explicitly restarts a remote container using the attached SSH client.
func (*Syncer) SetSSHClient ¶ added in v1.0.2
SetSSHClient attaches an SSH client to an existing Syncer for remote commands.