'wdcli backup': Move to separate package

This commit is contained in:
Tom Wiesing 2022-09-17 18:17:37 +02:00
parent 5cd5ae9be2
commit 822c70cd69
No known key found for this signature in database
11 changed files with 493 additions and 380 deletions

View file

@ -3,7 +3,6 @@ package component
import (
"github.com/FAU-CDI/wisski-distillery/internal/config"
"github.com/tkw1536/goprogram/stream"
)
// Component represents a logical subsystem of the distillery.
@ -46,20 +45,6 @@ type Installable interface {
Context(parent InstallationContext) InstallationContext
}
// Backupable represents a component with a Backup method
type Backupable interface {
Component
// BackupName returns a new name to be used as an argument for path.
BackupName() string
// Backup backs up this component into the destination path path.
//
// The destination path may be a folder or directory, depending on the component.
// The destination path does not need to exist.
Backup(io stream.IOStream, path string) error
}
// ComponentBase implements base functionality for a component
type ComponentBase struct {
Dir string // Dir is the directory this component lives in