status

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2021 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandStatus

type CommandStatus struct {
	Success bool      `json:"success"`
	Time    time.Time `json:"time"`
	Error   string    `json:"error"`
}

CommandStatus is the last command status

type Profile

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

Profile status

func (*Profile) BackupError

func (p *Profile) BackupError(err error) *Profile

BackupError sets the error of the last backup

func (*Profile) BackupSuccess

func (p *Profile) BackupSuccess() *Profile

BackupSuccess indicates the last backup was successful

func (*Profile) CheckError

func (p *Profile) CheckError(err error) *Profile

CheckError sets the error of the last check

func (*Profile) CheckSuccess

func (p *Profile) CheckSuccess() *Profile

CheckSuccess indicates the last check was successful

func (*Profile) RetentionError

func (p *Profile) RetentionError(err error) *Profile

RetentionError sets the error of the last retention

func (*Profile) RetentionSuccess

func (p *Profile) RetentionSuccess() *Profile

RetentionSuccess indicates the last retention was successful

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