Documentation ¶
Index ¶
- Variables
- type BackupError
- type BackupErrorCode
- type BackupOptFunc
- func WithDebug(debug bool) BackupOptFunc
- func WithDownload() BackupOptFunc
- func WithInteractivity(interactive bool) BackupOptFunc
- func WithLanguage(lang string) BackupOptFunc
- func WithRemote(remote string) BackupOptFunc
- func WithRemoteRoot(remoteRoot string) BackupOptFunc
- func WithSimulation(simulate bool) BackupOptFunc
- type BackupOpts
- type BackupSession
- type CmdFunc
- type CommandOpts
Constants ¶
This section is empty.
Variables ¶
View Source
var CommandMap = map[string]CmdFunc{
"sleep": cmdSleep,
"cd": cmdCD,
"export": cmdExport,
}
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 WithLanguage ¶
func WithLanguage(lang 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 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
type CommandOpts ¶
Click to show internal directories.
Click to hide internal directories.