v2.31.0-dev4 f8fb41e

controlplane.go RawHistoryFolder

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}

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 7

Tags 106

↑↓ moveenter openesc close