Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var CurrentBackupStartTime time.Time
CurrentBackupStartTime start time of currently running backup, if any
View Source
var RunningBackupAPIID = ""
RunningBackupAPIID current apiID of the currently running backup, if any
Functions ¶
func ExecShellTimeout ¶
ExecShellTimeout execute a shell command (like bash -c 'your command') with a timeout. After that time, the process will be cancelled
func GetCmdOutput ¶
GetCmdOutput join stdout and stderr in a single string from Cmd
func Initialize ¶
Initialize must be invoked to start REST server along with all Backuper hooks
Types ¶
type Backuper ¶
type Backuper interface { //Init register command line flags here etc Init() error //RegisterFlags register flags for command line options RegisterFlags() error //CreateNewBackup create a new backup synchronously (return only after complete backup creation). If you set shellContext.CmdRef when calling a Shell Script, the bridge will cancel the process automatically if a DELETE /backup/{id} for the running backup is received CreateNewBackup(apiID string, timeout time.Duration, shellContext *ShellContext) error //DeleteBackup remove backup data from storage. if backup is still running and set cmdRef on ShellContext of CreateBackup call, cancel it DeleteBackup(apiID string) error //GetAllBackups returns all tracked backups. this is optional for Schelly GetAllBackups() ([]SchellyResponse, error) //GetBackup returns a specific backup info. if requested apiID is running, this method is not even called, because schellyhook will do this for you GetBackup(apiID string) (*SchellyResponse, error) }
Backuper interface for who is implementing specific backup operations on backend
type Options ¶
type Options struct { ListenPort int ListenIP string PrePostTimeout int PreBackupCommand string PostBackupCommand string }
Options command line options
type SchellyResponse ¶
type SchellyResponse struct { ID string `json:"id",omitempty` DataID string `json:"data_id",omitempty` Status string `json:"status",omitempty` Message string `json:"message",omitempty` SizeMB float64 `json:"size_mb",omitempty` }
SchellyResponse schelly webhook response
type ShellContext ¶
type ShellContext struct { //CmdRef cmd.Cmd pointer that can be used to set command references that should be killed when a backup deletion of a running job is detected CmdRef *cmd.Cmd }
ShellContext container to transport a Cmd reference
Click to show internal directories.
Click to hide internal directories.