wisski-cloud-distillery/internal/component/sql/sql.go
Tom Wiesing 5cd5ae9be2
'wdcli backup': Rework backup process
This commit reworks the backup process to dynamically find the list of
components.
2022-09-17 16:34:07 +02:00

38 lines
682 B
Go

package sql
import (
"context"
"embed"
"io/fs"
"time"
"github.com/FAU-CDI/wisski-distillery/internal/component"
)
type SQL struct {
component.ComponentBase
ServerURL string // upstream server url
PollContext context.Context // context to abort polling with
PollInterval time.Duration // duration to wait for during wait
}
func (SQL) Name() string {
return "sql"
}
//go:embed all:sql
var resources embed.FS
func (ssh SQL) Stack() component.StackWithResources {
return ssh.ComponentBase.MakeStack(component.StackWithResources{
Resources: resources,
ContextPath: "sql",
MakeDirsPerm: fs.ModeDir | fs.ModePerm,
MakeDirs: []string{
"data",
},
})
}