sync

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2025 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileInfo

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

FileInfo represents file information for comparison

type Options

type Options struct {
	Checksum        bool   // Use checksum comparison
	DryRun          bool   // Show what would be copied without copying
	Interactive     bool   // Interactive mode (not used in sync package directly)
	Verbose         bool   // Enable verbose output
	Recursive       bool   // Recursively sync directories
	Delete          bool   // Delete extraneous files from destination
	Threads         int    // Number of concurrent threads
	Method          string // Comparison method: mtime, checksum, size
	SkipBrokenLinks bool   // Skip broken symbolic links instead of reporting errors
	// TAR-specific options
	TarCompress bool   // Use gzip compression for TAR files
	GPGEncrypt  bool   // Encrypt TAR files with GPG
	GPGSign     bool   // Sign TAR files with GPG
	GPGKeyID    string // GPG key ID for encryption/signing
	GPGKeyring  string // Path to GPG keyring
}

Options holds configuration for the synchronization process

type Stats

type Stats struct {
	FilesChecked int64
	FilesCopied  int64
	FilesDeleted int64
	BytesCopied  int64
	BytesDeleted int64
	DirsCreated  int64
	Errors       []string
	// Preview-specific stats
	FilesToCopy   int64
	FilesToDelete int64
	BytesToCopy   int64
	BytesToDelete int64
	DirsToCreate  int64
}

Stats holds synchronization statistics

type Syncer

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

Syncer represents a file synchronizer

func New

func New(options Options) *Syncer

New creates a new Syncer with the given options

func (*Syncer) Sync

func (s *Syncer) Sync(source, destination string) error

Sync performs synchronization from source to destination

Jump to

Keyboard shortcuts

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