backup

package
v0.0.0-...-c11c497 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: GPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CommandMap = map[string]CmdFunc{
	"!sleep": cmdSleep,
}

Functions

This section is empty.

Types

type BackupError

type BackupError struct {
	Code    BackupErrorCode
	Source  string
	Message string
}

func (BackupError) Localize

func (e BackupError) Localize(langs ...string) string

type BackupErrorCode

type BackupErrorCode int8
const (
	GenericError BackupErrorCode = iota
	CmdInvalid
	CmdFailed
	PathError
	UploadError
	DownloadError
)

func (BackupErrorCode) Error

func (e BackupErrorCode) Error(source string, message string) BackupError

func (BackupErrorCode) ID

func (e BackupErrorCode) ID() string

type BackupOptFunc

type BackupOptFunc func(*BackupOpts)

func WithDebug

func WithDebug(debug bool) BackupOptFunc

func WithDownload

func WithDownload() BackupOptFunc

func WithInteractivity

func WithInteractivity(interactive bool) BackupOptFunc

func WithLanguages

func WithLanguages(langs ...string) BackupOptFunc

func WithRemote

func WithRemote(remote string) BackupOptFunc

func WithRemoteRoot

func WithRemoteRoot(remoteRoot string) BackupOptFunc

func WithSimulation

func WithSimulation(simulate bool) BackupOptFunc

type BackupOpts

type BackupOpts struct {
	Remote      string
	RemoteRoot  string
	Uploading   bool
	Simulate    bool
	Interactive bool
	Debug       bool
	Languages   []string
}

type BackupSession

type BackupSession struct {
	Opts     *BackupOpts
	Machine  *config.Machine
	Notifier *notify.Notifier
	// contains filtered or unexported fields
}

func NewSession

func NewSession(ctx context.Context, options ...BackupOptFunc) *BackupSession

func (*BackupSession) Backup

func (session *BackupSession) Backup()

func (*BackupSession) Heartbeat

func (session *BackupSession) Heartbeat(endpoint string, withLog bool)

func (*BackupSession) NotifyStatus

func (session *BackupSession) NotifyStatus(status string, statusTags ...string)

type CmdFunc

type CmdFunc func(chan BackupError, string) string

Jump to

Keyboard shortcuts

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