package fsync
import "github.com/spf13/fsync"
Index ¶
- Variables
- func Sync(dst, src string) error
- func SyncTo(to string, srcs ...string) error
- type FileInfo
- type Syncer
Variables ¶
Functions ¶
func Sync ¶
Sync copies files and directories inside src into dst.
func SyncTo ¶
SyncTo syncs srcs files and directories into to directory.
Types ¶
type FileInfo ¶
FileInfo contains the shared methods between os.FileInfo and fs.DirEntry.
type Syncer ¶
type Syncer struct { // Set this to true to delete files in the destination that don't exist // in the source. Delete bool // To allow certain files to remain in the destination, implement this function. // Return true to skip file, false to delete. // Note that src may be either os.FileInfo or fs.DirEntry depending on the file system. DeleteFilter func(f FileInfo) bool // By default, modification times are synced. This can be turned off by // setting this to true. NoTimes bool // NoChmod disables permission mode syncing. NoChmod bool // Implement this function to skip Chmod syncing for only certain files // or directories. Return true to skip Chmod. ChmodFilter func(dst, src os.FileInfo) bool SrcFs afero.Fs DestFs afero.Fs }
Type Syncer provides functions for syncing files.
func NewSyncer ¶
func NewSyncer() *Syncer
NewSyncer creates a new instance of Syncer with default options.
func (*Syncer) Sync ¶
Sync copies files and directories inside src into dst.
func (*Syncer) SyncTo ¶
SyncTo syncs srcs files or directories into to directory.
Source Files ¶
- Version
- v0.10.1 (latest)
- Published
- Feb 25, 2024
- Platform
- linux/amd64
- Imports
- 8 packages
- Last checked
- 1 hour ago –
Tools for package owners.