Documentation
¶
Index ¶
- Constants
- func GetPathStatus(ctx context.Context, sourceRSync string, recursive bool) error
- func GetRsyncVersion() (version string, protocol string, err error)
- func IsInstalled() error
- func IsRsyncCallFailedError(err error) bool
- func IsRsyncProcessTerminatedError(err error) bool
- func ObtainDirFullSize(ctx context.Context, dir *core.Dir, retryCount *int, log *Logging) (*core.FolderSize, error)
- func ObtainDirLocalSize(ctx context.Context, dir *core.Dir, retryCount *int, log *Logging) (*core.FolderSize, error)
- func Params(params ...string) []string
- func RunRsyncWithRetry(ctx context.Context, options *Options, log *Logging, stdOut *bytes.Buffer, ...) (sessionErr, retryErr, criticalErr error)
- func WithDefaultParams(params ...string) []string
- type ErrorHook
- type Logging
- type Options
- type RsyncCallFailedError
- type RsyncProcessTerminatedError
Constants ¶
View Source
const ( MsgRsyncCallFailedError = "RsyncCallFailedError" MsgRsyncProcessTerminatedError = "RsyncProcessTerminatedError" MsgRsyncCannotFindFolderSizeOutputError = "RsyncCannotFindFolderSizeOutputError" MsgRsyncCannotParseFolderSizeOutputError = "RsyncCannotParseFolderSizeOutputError" )
View Source
const RSYNC_CMD = "rsync"
RSYNC_CMD contains RSYNC console utility name to run.
Variables ¶
This section is empty.
Functions ¶
func GetPathStatus ¶
func GetRsyncVersion ¶
GetRsyncVersion run RSYNC to get version and protocol.
func IsInstalled ¶
func IsInstalled() error
IsInstalled verify, that RSYNC application present in the system.
func ObtainDirFullSize ¶
func ObtainDirLocalSize ¶
Types ¶
type ErrorHook ¶
type ErrorHook func(err error, paths core.SrcDstPath, predictedSize *core.FolderSize, repeated int, retryLeft int) (newRetryLeft int, criticalError error)
type Logging ¶
type Logging struct {
EnableLog bool
EnableIntensiveLog bool
Log logger.PackageLog
}
type Options ¶
type Options struct {
RetryCount int
Params []string
ErrorHook ErrorHook
PredictedSize *core.FolderSize
}
func (*Options) SetPredictedSize ¶
func (v *Options) SetPredictedSize(predictedSize core.FolderSize) *Options
type RsyncCallFailedError ¶
func NewRsyncCallFailedError ¶
func NewRsyncCallFailedError(exitCode int) *RsyncCallFailedError
func (*RsyncCallFailedError) Error ¶
func (v *RsyncCallFailedError) Error() string
type RsyncProcessTerminatedError ¶
type RsyncProcessTerminatedError struct {
}
func (*RsyncProcessTerminatedError) Error ¶
func (v *RsyncProcessTerminatedError) Error() string
Source Files
¶
- abstract.go
- common.go
- errors.go
- messagekeys.go
- rsync.go
- utils.go
Click to show internal directories.
Click to hide internal directories.