v2.4.1 7c3b292

runtime.go RawHistoryFolder

1// Package out defines output ports (interfaces) for infrastructure.
2// These interfaces define the contract between use cases and driven adapters
3// (Docker, filesystem, etc.).
4package out
5
6import (
7	"context"
8	"io"
9
10	"gordon/internal/domain"
11)
12
13// ContainerRuntime defines the contract for container runtime operations.
14// This interface abstracts the underlying container runtime (Docker, Podman, etc.).
15type ContainerRuntime interface {
16	// Container lifecycle
17	CreateContainer(ctx context.Context, config *domain.ContainerConfig) (*domain.Container, error)
18	StartContainer(ctx context.Context, containerID string) error
19	StopContainer(ctx context.Context, containerID string) error
20	RestartContainer(ctx context.Context, containerID string) error
21	RemoveContainer(ctx context.Context, containerID string, force bool) error
22	RenameContainer(ctx context.Context, containerID, newName string) error
23
24	// Container inspection
25	ListContainers(ctx context.Context, all bool) ([]*domain.Container, error)
26	InspectContainer(ctx context.Context, containerID string) (*domain.Container, error)
27	GetContainerLogs(ctx context.Context, containerID string, follow bool) (io.ReadCloser, error)
28
29	// Image operations
30	PullImage(ctx context.Context, image string) error
31	PullImageWithAuth(ctx context.Context, image, username, password string) error
32	TagImage(ctx context.Context, sourceRef, targetRef string) error
33	UntagImage(ctx context.Context, imageRef string) error
34	RemoveImage(ctx context.Context, image string, force bool) error
35	ListImages(ctx context.Context) ([]string, error)
36
37	// Runtime information
38	Ping(ctx context.Context) error
39	Version(ctx context.Context) (string, error)
40
41	// Health and status
42	IsContainerRunning(ctx context.Context, containerID string) (bool, error)
43	GetContainerPort(ctx context.Context, containerID string, internalPort int) (int, error)
44
45	// Image and port inspection
46	GetImageExposedPorts(ctx context.Context, imageRef string) ([]int, error)
47	GetContainerExposedPorts(ctx context.Context, containerID string) ([]int, error)
48	GetContainerNetworkInfo(ctx context.Context, containerID string) (string, int, error)
49
50	// Volume management
51	InspectImageVolumes(ctx context.Context, imageRef string) ([]string, error)
52	VolumeExists(ctx context.Context, volumeName string) (bool, error)
53	CreateVolume(ctx context.Context, volumeName string) error
54	RemoveVolume(ctx context.Context, volumeName string, force bool) error
55
56	// Environment inspection
57	InspectImageEnv(ctx context.Context, imageRef string) ([]string, error)
58
59	// Label inspection
60	GetImageLabels(ctx context.Context, imageRef string) (map[string]string, error)
61
62	// Network management
63	CreateNetwork(ctx context.Context, name string, options map[string]string) error
64	RemoveNetwork(ctx context.Context, name string) error
65	ListNetworks(ctx context.Context) ([]*domain.NetworkInfo, error)
66	NetworkExists(ctx context.Context, name string) (bool, error)
67	ConnectContainerToNetwork(ctx context.Context, containerName, networkName string) error
68	DisconnectContainerFromNetwork(ctx context.Context, containerName, networkName string) error
69}

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