syncer

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConnectSSH

func ConnectSSH(host string, port int, user, password string) (*ssh.Client, *sftp.Client, error)

ConnectSSH establishes an SSH connection

Types

type FileInfo

type FileInfo struct {
	Path    string
	RelPath string
	Size    int64
	ModTime time.Time
	IsDir   bool
}

FileInfo represents file information for synchronization

type SSHConfig

type SSHConfig struct {
	Host     string
	Port     int
	User     string
	Password string
}

SSHConfig holds SSH connection parameters

type SyncConfig

type SyncConfig struct {
	LocalPath  string
	RemotePath string
	Mode       string
	Workers    int
}

SyncConfig holds synchronization parameters

type Syncer

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

Syncer handles file synchronization

func New

func New(client *sftp.Client, syncConfig SyncConfig, logger *logrus.Logger) *Syncer

New creates a new Syncer instance with direct configuration

func (*Syncer) Sync

func (s *Syncer) Sync() error

Sync performs the file synchronization based on the mode

Jump to

Keyboard shortcuts

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