status

package
v0.27.0 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BackupStatus

type BackupStatus struct {
	CommandStatus
	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"`
	FilesTotal      int    `json:"files_total"`
	BytesAdded      uint64 `json:"bytes_added"`
	BytesTotal      uint64 `json:"bytes_total"`
}

BackupStatus contains the last backup status

type CommandStatus

type CommandStatus struct {
	Success  bool      `json:"success"`
	Time     time.Time `json:"time"`
	Error    string    `json:"error"`
	Stderr   string    `json:"stderr"`
	Duration int64     `json:"duration"`
}

CommandStatus is the last command status

type Profile

type Profile struct {
	Backup    *BackupStatus  `json:"backup,omitempty"`
	Retention *CommandStatus `json:"retention,omitempty"`
	Check     *CommandStatus `json:"check,omitempty"`
}

Profile status

func (*Profile) BackupError

func (p *Profile) BackupError(err error, summary monitor.Summary, stderr string) *Profile

BackupError sets the error of the last backup

func (*Profile) BackupSuccess

func (p *Profile) BackupSuccess(summary monitor.Summary, stderr string) *Profile

BackupSuccess indicates the last backup was successful

func (*Profile) CheckError

func (p *Profile) CheckError(err error, summary monitor.Summary, stderr string) *Profile

CheckError sets the error of the last check

func (*Profile) CheckSuccess

func (p *Profile) CheckSuccess(summary monitor.Summary, stderr string) *Profile

CheckSuccess indicates the last check was successful

func (*Profile) RetentionError

func (p *Profile) RetentionError(err error, summary monitor.Summary, stderr string) *Profile

RetentionError sets the error of the last retention

func (*Profile) RetentionSuccess

func (p *Profile) RetentionSuccess(summary monitor.Summary, stderr string) *Profile

RetentionSuccess indicates the last retention was successful

type Progress

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

func NewProgress

func NewProgress(profile *config.Profile, statusGenerator *Status) *Progress

func (*Progress) Start

func (p *Progress) Start(command string)

func (*Progress) Status

func (p *Progress) Status(status monitor.Status)

func (*Progress) Summary

func (p *Progress) Summary(command string, summary monitor.Summary, stderr string, result error)

type Status

type Status struct {
	Profiles map[string]*Profile `json:"profiles"`
	// contains filtered or unexported fields
}

Status of last schedule profile

func NewStatus

func NewStatus(fileName string) *Status

NewStatus returns a new blank status

func (*Status) Load

func (s *Status) Load() *Status

Load existing status; does not complain if the file does not exists, or is not readable

func (*Status) Profile

func (s *Status) Profile(name string) *Profile

Profile gets the profile from its name (it creates a blank new one if not exists)

func (*Status) Save

func (s *Status) Save() error

Save current status to the file

Jump to

Keyboard shortcuts

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