mirror

package
v7.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package mirror keeps a persistent copy of files that are written to a local directory.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Active

func Active(local string) bool

Active returns whether local is being replicated.

func CopyFile

func CopyFile(src string, dst string) error

CopyFile copies src to dst atomically, leaving holes where src contains zeros. The parent directories are trusted but the file names themselves are never followed.

func Flush

func Flush(prefix string) error

Flush syncs the files of every mirror whose local directory is under prefix.

func Pause

func Pause(prefix string) error

Pause syncs and stops watching every mirror whose local directory is under prefix.

func Resume

func Resume(prefix string) error

Resume syncs and restarts watching every paused mirror whose local directory is under prefix.

func Seed

func Seed(src string, dst string, filter func(name string) bool) error

Seed copies the regular files of src accepted by filter into dst.

func Start

func Start(local string, persistent string, filter func(name string) bool) error

Start replicates the files of local matching filter into persistent, syncing them all first.

func Stop

func Stop(local string) error

Stop ends the replication of local after a final sync of its files.

Types

type Mirror

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

Mirror replicates the files of a local directory into a persistent directory.

Jump to

Keyboard shortcuts

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