sync

package
v0.0.0-...-8fe905f Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DirOption

type DirOption struct {
	Filter func(string) bool
	Prefix string
	Ignore []string
}

DirOption set options when sync directory

type Syncer

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

Syncer manage sync file

func NewSyncer

func NewSyncer(dir string) *Syncer

NewSyncer create a sync object to sync file to dir

func (*Syncer) Clear

func (s *Syncer) Clear(opt *DirOption) error

Clear clean all non-synced file in s.dir

func (*Syncer) SetSynced

func (s *Syncer) SetSynced(file string)

SetSynced set file as synced file

func (*Syncer) Sync

func (s *Syncer) Sync() error

Sync write to new file to old file if md5 changes

func (*Syncer) SyncDir

func (s *Syncer) SyncDir(dir string, opt *DirOption) error

SyncDir sync directory files to syncer's directory

func (*Syncer) SyncForce

func (s *Syncer) SyncForce() error

SyncForce force to write file to dst file

Jump to

Keyboard shortcuts

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