Skip to content

Releases: lpg-it/fileuploader

v1.0.0

19 Sep 03:48

Choose a tag to compare

Universal File Synchronization Library v1.0.0

This is the initial release of the Universal File Synchronization Library - a flexible Go-based library for synchronizing local files to a remote server via SSH/SFTP.

Features

  • Multiple Sync Modes:
    • Full Replacement: Completely replaces the remote directory with local files
    • Incremental Sync: Only uploads new or modified files while preserving remote-only files
  • Concurrent Uploads: Uses worker pools for faster uploads with configurable concurrency
  • Progress Tracking: Visual progress bar showing upload status with speed and completion percentage
  • Safety Measures: Automatic backup and rollback capabilities
  • Pure Parameter-Driven: No configuration file requirements - you provide parameters directly
  • Flexible Logging: Integrates with your own logger instance

Usage

import "github.com/lpg-it/fileuploader/syncer"

// Connect to SSH server
sshClient, sftpClient, err := syncer.ConnectSSH(host, port, user, password)

// Create sync configuration
syncConfig := syncer.SyncConfig{
    LocalPath:  "/local/path",
    RemotePath: "/remote/path",
    Mode:       "full",     // or "incremental"
    Workers:    10,
}

// Create and run syncer
fileSyncer := syncer.New(sftpClient, syncConfig, logger)
err := fileSyncer.Sync()