Add support for provisioning and rebuilding via interface

This commit is contained in:
Tom 2023-07-09 11:18:14 +02:00
parent f5c5999f44
commit ddb4bb3546
76 changed files with 1306 additions and 625 deletions

View file

@ -0,0 +1,41 @@
package extras
import (
"context"
"github.com/FAU-CDI/wisski-distillery/internal/phpx"
"github.com/FAU-CDI/wisski-distillery/internal/wisski/ingredient"
"github.com/FAU-CDI/wisski-distillery/internal/wisski/ingredient/php"
_ "embed"
)
// Prefixes implements reading and writing prefix
type Adapters struct {
ingredient.Base
Dependencies struct {
PHP *php.PHP
}
}
//go:embed adapters.php
var adaptersPHP string
type DistilleryAdapter struct {
Label string
MachineName string
Description string
InstanceDomain string
GraphDBRepository string
GraphDBUsername string
GraphDBPassword string
}
func (wisski *Adapters) CreateDistilleryAdapter(ctx context.Context, server *phpx.Server, adapter DistilleryAdapter) error {
return wisski.Dependencies.PHP.ExecScript(
ctx, server, nil, adaptersPHP,
"create_distillery_adapter",
adapter.Label, adapter.MachineName, adapter.Description, adapter.InstanceDomain, adapter.GraphDBRepository, adapter.GraphDBUsername, adapter.GraphDBPassword,
)
}