Documentation ¶
Index ¶
- func IgnorePercentage(_ logr.Logger, _ float64)
- func New(out outFunc) io.Writer
- func NewBackupOutputParser(logger logr.Logger, folderName string, summaryFunc SummaryFunc) io.Writer
- func NewErrorWriter(l logr.Logger) io.Writer
- func NewInfoWriter(l logr.Logger) io.Writer
- func NewStdinBackupOutputParser(logger logr.Logger, folderName string, summaryFunc SummaryFunc) io.Writer
- func PrintPercentage(logger logr.Logger, p float64)
- type BackupEnvelope
- type BackupError
- type BackupOutputParser
- type BackupStatus
- type BackupSummary
- type LogErrPrinter
- type LogInfoPrinter
- type PercentageFunc
- type SummaryFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IgnorePercentage ¶
func NewBackupOutputParser ¶
func NewErrorWriter ¶
NewErrorWriter creates a writer with the name "stderr" which directly writes to the given logger using info level. It ensures that each line is handled seperately. This avoids mangled lines when parsing JSON outputs.
func NewInfoWriter ¶
NewInfoWriter creates a writer with the name "stdout" which directly writes to the given logger using info level. It ensures that each line is handled separately. This avoids mangled lines when parsing JSON outputs.
func PrintPercentage ¶
Types ¶
type BackupEnvelope ¶
type BackupEnvelope struct { MessageType string `json:"message_type,omitempty"` BackupStatus BackupSummary BackupError }
type BackupError ¶
type BackupOutputParser ¶
type BackupOutputParser struct {
// contains filtered or unexported fields
}
type BackupStatus ¶
type BackupSummary ¶
type BackupSummary struct { MessageType string `json:"message_type"` FilesNew int `json:"files_new"` FilesChanged int `json:"files_changed"` FilesUnmodified int `json:"files_unmodified"` DirsNew int `json:"dirs_new"` DirsChanged int `json:"dirs_changed"` DirsUnmodified int `json:"dirs_unmodified"` DataBlobs int `json:"data_blobs"` TreeBlobs int `json:"tree_blobs"` DataAdded int64 `json:"data_added"` TotalFilesProcessed int `json:"total_files_processed"` TotalBytesProcessed int `json:"total_bytes_processed"` TotalDuration float64 `json:"total_duration"` SnapshotID string `json:"snapshot_id"` }
type LogErrPrinter ¶
type LogInfoPrinter ¶
type LogInfoPrinter struct {
// contains filtered or unexported fields
}
type PercentageFunc ¶
PercentageFunc should format and print the given float.
type SummaryFunc ¶
type SummaryFunc func(summary BackupSummary, errorCount int, folder string, startTimestamp, endTimestamp int64)
SummaryFunc takes the summed up status of the backup and will process this further like logging, metrics and webhooks.
Click to show internal directories.
Click to hide internal directories.