62 lines
1.3 KiB
PHP
62 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace App\Drivers;
|
|
|
|
use App\Data\Operations\Plan;
|
|
use App\Data\Operations\PlannedStep;
|
|
use App\Enums\ServiceType;
|
|
use App\Models\Service;
|
|
|
|
abstract class Driver
|
|
{
|
|
public ?Service $service;
|
|
|
|
public ?string $containerName;
|
|
|
|
public ?string $containerId;
|
|
|
|
abstract public function __construct(
|
|
?string $containerName = null,
|
|
?string $containerId = null,
|
|
?Service $service = null,
|
|
);
|
|
|
|
abstract public function getOperationPlan(string $operationHash): Plan;
|
|
|
|
abstract public function serviceType(): ServiceType;
|
|
|
|
abstract public function versionTrack(): string;
|
|
|
|
abstract public function defaultImage(): string;
|
|
|
|
/**
|
|
* @return array<int, int>
|
|
*/
|
|
abstract public function defaultPorts(): array;
|
|
|
|
/**
|
|
* @return array<int, string>
|
|
*/
|
|
abstract public function firewallRules(): array;
|
|
|
|
/**
|
|
* @return array<string, string>
|
|
*/
|
|
abstract public function environmentSchema(): array;
|
|
|
|
/**
|
|
* @return array{cpu?: string, memory_mb?: int}
|
|
*/
|
|
abstract public function resourceDefaults(): array;
|
|
|
|
abstract public function updateBehavior(): string;
|
|
|
|
/**
|
|
* @return array<int, PlannedStep>
|
|
*/
|
|
public function preSwitchSteps(): array
|
|
{
|
|
return [];
|
|
}
|
|
}
|