v2.31.0-dev12 6a38a35

container.go RawHistoryFolder

1// Package domain contains pure business types without external dependencies.
2// These types are used throughout the application and have no tags or framework dependencies.
3package domain
4
5import "time"
6
7// Container represents a running container in the system.
8type Container struct {
9	ID       string
10	Image    string
11	ImageID  string // Docker image ID (sha256 digest) used to detect redundant deploys
12	Name     string
13	Status   string
14	ExitCode int
15	Ports    []int
16	Labels   map[string]string
17	Created  time.Time
18}
19
20// NetworkInfo represents network configuration and state.
21type NetworkInfo struct {
22	ID         string
23	Name       string
24	Driver     string
25	Containers []string
26	Labels     map[string]string
27}
28
29// NetworkConfig holds options for creating a container network.
30type NetworkConfig struct {
31	Driver   string
32	Internal bool
33	Labels   map[string]string
34}
35
36// Attachment represents an attached service container.
37type Attachment struct {
38	Name        string
39	Image       string
40	ContainerID string
41	Status      string
42	Network     string
43	Ports       []int
44}
45
46// RouteInfo combines route configuration with runtime state.
47type RouteInfo struct {
48	Domain          string
49	Image           string
50	ContainerID     string
51	ContainerStatus string
52	Network         string
53	Attachments     []Attachment
54}
55
56// ContainerConfig holds configuration for creating a container.
57type ContainerConfig struct {
58	Image           string
59	Name            string
60	Env             []string
61	Ports           []int
62	Labels          map[string]string
63	WorkingDir      string
64	Cmd             []string
65	AutoRemove      bool
66	Volumes         map[string]string // map[containerPath]volumeName
67	ReadOnlyVolumes map[string]string // containerPath -> volumeName (mounted read-only)
68	NetworkMode     string            // Network to join
69	Hostname        string            // Container hostname for DNS
70	Aliases         []string          // Additional network aliases
71	MemoryLimit     int64             // Memory limit in bytes (0 = no limit)
72	NanoCPUs        int64             // CPU quota in nanoseconds (1e9 = 1 core, 0 = no limit)
73	PidsLimit       int64             // Max number of PIDs (0 = no limit)
74	ReadOnlyRootFS  bool              // Mount container root filesystem read-only
75	User            string            // User to run as
76	CapDrop         []string          // Linux capabilities to drop; nil uses runtime compat defaults
77	CapAdd          []string          // Linux capabilities to add; nil uses runtime compat defaults
78}
79
80// ContainerStatus represents the current state of a container.
81type ContainerStatus string
82
83const (
84	ContainerStatusRunning ContainerStatus = "running"
85	ContainerStatusStopped ContainerStatus = "stopped"
86	ContainerStatusCreated ContainerStatus = "created"
87	ContainerStatusExited  ContainerStatus = "exited"
88	ContainerStatusPaused  ContainerStatus = "paused"
89	ContainerStatusUnknown ContainerStatus = "unknown"
90)

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