sync

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: Apache-2.0 Imports: 40 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option added in v0.4.1

type Option struct {
	Source                core.VFS
	Dest                  core.VFS
	EnableHTTP3           bool
	FileServerAddr        string
	EnableTLS             bool
	TLSCertFile           string
	TLSKeyFile            string
	TLSInsecureSkipVerify bool
	EnableLogicallyDelete bool
	ChunkSize             int64
	CheckpointCount       int
	ForceChecksum         bool
	ChecksumAlgorithm     string
	Progress              bool
	MaxTranRate           int64
	DryRun                bool
	CopyLink              bool
	CopyUnsafeLink        bool
	TokenSecret           string
	Users                 []*auth.User
	Retry                 retry.Retry
	EncOpt                encrypt.Option
	PathIgnore            ignore.PathIgnore
	Reporter              report.Reporter
	TaskConf              string
	Logger                *logger.Logger
	SyncOnce              bool
	SyncCron              string
}

Option the sync component option

func NewSyncOption added in v0.4.1

func NewSyncOption(config conf.Config, users []*auth.User, r retry.Retry, pi ignore.PathIgnore, reporter report.Reporter, logger *logger.Logger) Option

NewSyncOption create an instance of the Option, store all the sync component options

type Sync

type Sync interface {
	// Create create the path
	Create(path string) error
	// Symlink create a symbolic link
	Symlink(oldname, newname string) error
	// Write write the data to path
	Write(path string) error
	// Remove remove the path
	Remove(path string) error
	// Rename rename the path
	Rename(path string) error
	// Chmod change the mode of path
	Chmod(path string) error
	// IsDir is a dir the path
	IsDir(path string) (bool, error)
	// SyncOnce sync the path to dest once
	SyncOnce(path string) error
	// Source the source file system
	Source() core.VFS
	// Dest the destination file system
	Dest() core.VFS
	// Close release the resource that is used by the sync component
	Close()
}

Sync a file sync interface

func NewDiskSync

func NewDiskSync(opt Option) (s Sync, err error)

NewDiskSync create a diskSync instance source is source path to read dest is dest path to write

func NewEmptySync added in v0.7.1

func NewEmptySync(opt Option) (s Sync, err error)

NewEmptySync create a emptySync instance

func NewMinIOPullClientSync added in v0.4.4

func NewMinIOPullClientSync(opt Option) (Sync, error)

NewMinIOPullClientSync create an instance of the minIOPullClientSync

func NewMinIOPushClientSync added in v0.4.4

func NewMinIOPushClientSync(opt Option) (Sync, error)

NewMinIOPushClientSync create an instance of the minIOPushClientSync

func NewPushClientSync added in v0.3.0

func NewPushClientSync(opt Option) (Sync, error)

NewPushClientSync create an instance of the pushClientSync

func NewRemoteClientSync

func NewRemoteClientSync(opt Option) (Sync, error)

NewRemoteClientSync create an instance of remoteClientSync to receive the file change message and execute it

func NewRemoteServerSync

func NewRemoteServerSync(opt Option) (Sync, error)

NewRemoteServerSync create an instance of remoteServerSync execute send file change message

func NewRemoteSync

func NewRemoteSync(opt Option) (Sync, error)

NewRemoteSync auto create an instance of remoteServerSync or remoteClientSync according to source and dest

func NewSftpPullClientSync added in v0.4.4

func NewSftpPullClientSync(opt Option) (Sync, error)

NewSftpPullClientSync create an instance of the sftpPullClientSync

func NewSftpPushClientSync added in v0.4.4

func NewSftpPushClientSync(opt Option) (Sync, error)

NewSftpPushClientSync create an instance of the sftpPushClientSync

func NewSync

func NewSync(opt Option) (Sync, error)

NewSync auto create an instance of the expected sync according to source and dest

Jump to

Keyboard shortcuts

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