1package cli
2
3import (
4 "context"
5
6 "github.com/bnema/gordon/internal/adapters/dto"
7 "github.com/bnema/gordon/internal/adapters/in/cli/remote"
8 "github.com/bnema/gordon/internal/domain"
9)
10
11// ControlPlane defines command operations available to CLI execution paths.
12//
13// Remote implementations call admin HTTP APIs.
14// Local implementations call services directly in-process.
15type ControlPlane interface {
16 ListRoutesWithDetails(ctx context.Context) ([]remote.RouteInfo, error)
17 GetHealth(ctx context.Context) (map[string]*remote.RouteHealth, error)
18 GetRoute(ctx context.Context, routeDomain string) (*domain.Route, error)
19 FindRoutesByImage(ctx context.Context, imageName string) ([]domain.Route, error)
20 AddRoute(ctx context.Context, route domain.Route) error
21 UpdateRoute(ctx context.Context, route domain.Route) error
22 RemoveRoute(ctx context.Context, routeDomain string) error
23 Bootstrap(ctx context.Context, req dto.BootstrapRequest) (*dto.BootstrapResponse, error)
24
25 ListSecretsWithAttachments(ctx context.Context, secretDomain string) (*remote.SecretsListResult, error)
26 SetSecrets(ctx context.Context, secretDomain string, secrets map[string]string) error
27 DeleteSecret(ctx context.Context, secretDomain, key string) error
28 SetAttachmentSecrets(ctx context.Context, domain, service string, secrets map[string]string) error
29 DeleteAttachmentSecret(ctx context.Context, domain, service, key string) error
30
31 GetAllAttachmentsConfig(ctx context.Context) (map[string][]string, error)
32 GetAttachmentsConfig(ctx context.Context, domainOrGroup string) ([]string, error)
33 FindAttachmentTargetsByImage(ctx context.Context, imageName string) ([]string, error)
34 AddAttachment(ctx context.Context, domainOrGroup, image string) error
35 RemoveAttachment(ctx context.Context, domainOrGroup, image string) error
36 GetAutoRouteAllowedDomains(ctx context.Context) ([]string, error)
37 AddAutoRouteAllowedDomain(ctx context.Context, pattern string) error
38 RemoveAutoRouteAllowedDomain(ctx context.Context, pattern string) error
39
40 GetStatus(ctx context.Context) (*remote.Status, error)
41 Reload(ctx context.Context) error
42 ListNetworks(ctx context.Context) ([]*domain.NetworkInfo, error)
43 GetConfig(ctx context.Context) (*remote.Config, error)
44 DeployIntent(ctx context.Context, imageName string) error
45 Deploy(ctx context.Context, deployDomain string) (*remote.DeployResult, error)
46 Restart(ctx context.Context, restartDomain string, withAttachments bool) (*remote.RestartResult, error)
47 ListTags(ctx context.Context, repository string) ([]string, error)
48
49 ListBackups(ctx context.Context, backupDomain string) ([]dto.BackupJob, error)
50 BackupStatus(ctx context.Context) ([]dto.BackupJob, error)
51 RunBackup(ctx context.Context, backupDomain, dbName string) (*dto.BackupRunResponse, error)
52 DetectDatabases(ctx context.Context, backupDomain string) ([]dto.DatabaseInfo, error)
53
54 GetProcessLogs(ctx context.Context, lines int) ([]string, error)
55 GetContainerLogs(ctx context.Context, logDomain string, lines int) ([]string, error)
56 StreamProcessLogs(ctx context.Context, lines int) (<-chan string, error)
57 StreamContainerLogs(ctx context.Context, logDomain string, lines int) (<-chan string, error)
58
59 ListVolumes(ctx context.Context) ([]dto.Volume, error)
60 PruneVolumes(ctx context.Context, req dto.VolumePruneRequest) (*dto.VolumePruneResponse, error)
61}