Documentation
¶
Index ¶
- Constants
- func Create(ctx context.Context, info *Info) error
- func Delete(id string) error
- func EnsureDirectory() error
- func Restore(ctx context.Context, id string) error
- func RestoreFile(ctx context.Context, archive string, mode Mode) error
- func WriteMeta(info *Info) error
- type Info
- type JobManager
- type Mode
- type ServerStopper
Constants ¶
View Source
const ( StatusPending = "pending" StatusRunning = "running" StatusCompleted = "completed" StatusFailed = "failed" )
Variables ¶
This section is empty.
Functions ¶
func EnsureDirectory ¶
func EnsureDirectory() error
EnsureDirectory creates the node backup directory if missing.
func RestoreFile ¶
RestoreFile extracts an archive path using mode hints from backup_info when possible.
Types ¶
type Info ¶
type Info struct {
UUID string `json:"uuid"`
Mode Mode `json:"mode"`
Status string `json:"status"`
Filename string `json:"filename"`
Path string `json:"path"`
Bytes int64 `json:"bytes"`
Checksum string `json:"checksum,omitempty"`
Error string `json:"error,omitempty"`
CreatedAt time.Time `json:"created_at"`
CompletedAt time.Time `json:"completed_at,omitempty"`
Migration bool `json:"migration,omitempty"`
}
Info describes a node backup archive on disk.
func NewPending ¶
NewPending allocates a pending backup record.
type JobManager ¶
type JobManager struct {
// contains filtered or unexported fields
}
JobManager tracks in-flight and recent node backup jobs.
func (*JobManager) ActiveUUID ¶
func (m *JobManager) ActiveUUID() string
ActiveUUID returns the currently running backup UUID, if any.
func (*JobManager) SetStopper ¶
func (m *JobManager) SetStopper(s ServerStopper)
SetStopper attaches the server manager used to quiesce instances.
func (*JobManager) StartCreate ¶
func (m *JobManager) StartCreate(ctx context.Context, mode Mode, migration bool, quiesce bool) (*Info, error)
StartCreate begins an async node backup. Returns the pending Info.
type Mode ¶
type Mode string
Mode selects what is included in a node-level archive.
func ValidateMode ¶
ValidateMode returns a normalized mode or an error.
type ServerStopper ¶
ServerStopper stops servers before a full/volumes node backup.
Click to show internal directories.
Click to hide internal directories.