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// *remote.Client implements it for both the explicit remote and the
13// owner-only local admin socket; tests substitute the generated mock.
14type ControlPlane interface {
15	// App lifecycle and reads. App mutations are daemon-owned for both
16	// the explicit remote and the owner-only local admin socket.
17	ApplyApp(ctx context.Context, req dto.AppApplyRequest) (*dto.AppApplyResponse, error)
18	ListApps(ctx context.Context) ([]dto.AppSummaryDTO, error)
19	ShowApp(ctx context.Context, app string) (*dto.AppShowResponse, error)
20	DiffApp(ctx context.Context, app string) (*dto.AppDiffResponse, error)
21	DeployApp(ctx context.Context, app string, req dto.AppDeployRequest) (*dto.AppDeployResponse, string, error)
22	StopApp(ctx context.Context, app string) (*dto.AppDeployResponse, string, error)
23	StartApp(ctx context.Context, app string) (*dto.AppDeployResponse, string, error)
24	RestartApp(ctx context.Context, app, service string, all bool) (*dto.AppDeployResponse, string, error)
25	RemoveApp(ctx context.Context, app string) (*dto.AppDeployResponse, string, error)
26	OperationByKey(ctx context.Context, app, key string) (*dto.AppDeployResponse, error)
27	ListAppSecrets(ctx context.Context, app, service string) ([]dto.AppSecretMetadataDTO, error)
28	SetAppSecrets(ctx context.Context, app string, req dto.AppSecretSetRequest) error
29	DeleteAppSecret(ctx context.Context, app string, req dto.AppSecretDeleteRequest) error
30
31	GetStatus(ctx context.Context) (*remote.Status, error)
32	VerifyAuth(ctx context.Context) (*dto.AuthVerifyResponse, error)
33	GetTLSStatus(ctx context.Context) (*dto.TLSStatusResponse, error)
34	GetTrafficStatus(ctx context.Context) (*dto.TrafficStatusResponse, error)
35	GetCA(ctx context.Context) (*dto.CAResponse, error)
36	Reload(ctx context.Context) error
37	ListNetworks(ctx context.Context) ([]*domain.NetworkInfo, error)
38	GetConfig(ctx context.Context) (*remote.Config, error)
39	ListTags(ctx context.Context, repository string) ([]string, error)
40
41	ListBackups(ctx context.Context, app string) ([]dto.BackupJob, error)
42	BackupStatus(ctx context.Context) ([]dto.BackupJob, error)
43	RunBackup(ctx context.Context, app, service, database string) (*dto.BackupRunResponse, error)
44	ListVolumeBackups(ctx context.Context, app string) ([]dto.VolumeBackupJob, error)
45	VolumeBackupStatus(ctx context.Context) ([]dto.VolumeBackupJob, error)
46	RunVolumeBackups(ctx context.Context, app, service, volume string) (*dto.VolumeBackupRunResponse, error)
47
48	GetProcessLogs(ctx context.Context, lines int) ([]string, error)
49	StreamProcessLogs(ctx context.Context, lines int) (<-chan string, error)
50
51	ListVolumes(ctx context.Context) ([]dto.Volume, error)
52	PruneVolumes(ctx context.Context, req dto.VolumePruneRequest) (*dto.VolumePruneResponse, error)
53}
54
55var _ ControlPlane = (*remote.Client)(nil)

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 8

Tags 106

↑↓ moveenter openesc close