Documentation
¶
Index ¶
- func DialSSH(cfg SyncConfig) (*ssh.Client, error)
- func GenerateEd25519Key(privateKeyPath string) (string, error)
- func ReadPublicKey(privateKeyPath string) (string, error)
- func RestartRemote(ctx context.Context, cfg SyncConfig, containerName string) error
- func TestSSH(ctx context.Context, cfg SyncConfig) error
- type SyncConfig
- type SyncResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateEd25519Key ¶
GenerateEd25519Key generates an ed25519 key pair and writes to disk. Returns the public key string.
func ReadPublicKey ¶ added in v0.0.5
ReadPublicKey reads the public key file from disk.
func RestartRemote ¶
func RestartRemote(ctx context.Context, cfg SyncConfig, containerName string) error
RestartRemote runs docker restart on the remote host via SSH.
Types ¶
type SyncConfig ¶
type SyncConfig struct {
Host string
Port int
User string
PrivateKeyPath string
SourceDir string
Exclude []string
DeleteExtra bool
KnownHostsPath string // path to known_hosts file (required)
}
SyncConfig holds configuration for a sync operation.
type SyncResult ¶
type SyncResult struct {
Host string `json:"host"`
FilesSent int `json:"files_sent"`
FilesDel int `json:"files_deleted"`
Error string `json:"error,omitempty"`
DurationMs int64 `json:"duration_ms"`
}
SyncResult holds the result of a sync operation.
func Sync ¶
func Sync(ctx context.Context, cfg SyncConfig) (*SyncResult, error)
Sync performs an SFTP sync from source to remote.
Click to show internal directories.
Click to hide internal directories.