Documentation
¶
Index ¶
- func NewDefaultLogger() *slog.Logger
- func NewLogger(level string, isVerbose, isJSON bool) (*slog.Logger, error)
- func PrintBackupEstimate(ctx context.Context, stats *models.BackupStats, ...)
- func PrintFilesNumber(ctx context.Context, getNumber func() int64, fileTypes string, ...)
- func PrintRestoreEstimate(ctx context.Context, stats *models.RestoreStats, ...)
- func ReportBackup(stats *bModels.BackupStats, isXdr, isJSON bool, logger *slog.Logger)
- func ReportEstimate(estimate uint64, isJSON bool, logger *slog.Logger)
- func ReportRestore(stats *bModels.RestoreStats, isValidation, isJSON bool, logger *slog.Logger)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDefaultLogger ¶
NewDefaultLogger returns default logger.
func NewLogger ¶
NewLogger creates a new logger with the given level, verbose, and JSON flags.
The level flag is used to set the log level. The valid values are: - debug - info - warn - error
func PrintBackupEstimate ¶
func PrintBackupEstimate( ctx context.Context, stats *models.BackupStats, getMetrics func() *models.Metrics, logger *slog.Logger, )
PrintBackupEstimate prints the backup progress. The progress is printed every second. The progress is printed only when the total records is greater than 0. The progress is printed only when the read records is greater than 0.
func PrintFilesNumber ¶
func PrintFilesNumber( ctx context.Context, getNumber func() int64, fileTypes string, logger *slog.Logger, )
PrintFilesNumber prints the number of files.
func PrintRestoreEstimate ¶
func PrintRestoreEstimate( ctx context.Context, stats *models.RestoreStats, getMetrics func() *models.Metrics, getSize func() int64, logger *slog.Logger, )
PrintRestoreEstimate prints the restore progress. The progress is printed every second. The progress is printed only when the total file size is greater than 0. The progress is printed only when the written number of bytes is greater than 0.
func ReportBackup ¶
func ReportBackup(stats *bModels.BackupStats, isXdr, isJSON bool, logger *slog.Logger)
ReportBackup prints the backup report. if isJSON is true, it prints the report in JSON format, but logger must be passed
func ReportEstimate ¶
ReportEstimate prints the estimate report. if isJSON is true, it prints the report in JSON format, but logger must be passed. estimate is the size of the backup file in bytes.
func ReportRestore ¶
func ReportRestore(stats *bModels.RestoreStats, isValidation, isJSON bool, logger *slog.Logger)
ReportRestore prints the restore report. if isJSON is true, it prints the report in JSON format, but logger must be passed
Types ¶
This section is empty.