v2.4.0 79b3461

interface.go RawHistoryFolder

1package runtime
2
3import (
4	"context"
5	"io"
6)
7
8// Container represents a running container
9type Container struct {
10	ID     string
11	Image  string
12	Name   string
13	Status string
14	Ports  []int
15	Labels map[string]string
16}
17
18// NetworkInfo represents a network
19type NetworkInfo struct {
20	ID         string
21	Name       string
22	Driver     string
23	Containers []string
24	Labels     map[string]string
25}
26
27// ContainerConfig holds configuration for creating a container
28type ContainerConfig struct {
29	Image       string
30	Name        string
31	Env         []string
32	Ports       []int
33	Labels      map[string]string
34	WorkingDir  string
35	Cmd         []string
36	AutoRemove  bool
37	Volumes     map[string]string // map[containerPath]volumeName
38	NetworkMode string            // Network to join
39	Hostname    string            // Container hostname for DNS
40	Aliases     []string          // Additional network aliases
41}
42
43// Runtime interface defines the contract for container runtime implementations
44type Runtime interface {
45	// Container lifecycle
46	CreateContainer(ctx context.Context, config *ContainerConfig) (*Container, error)
47	StartContainer(ctx context.Context, containerID string) error
48	StopContainer(ctx context.Context, containerID string) error
49	RestartContainer(ctx context.Context, containerID string) error
50	RemoveContainer(ctx context.Context, containerID string, force bool) error
51
52	// Container inspection
53	ListContainers(ctx context.Context, all bool) ([]*Container, error)
54	InspectContainer(ctx context.Context, containerID string) (*Container, error)
55	GetContainerLogs(ctx context.Context, containerID string, follow bool) (io.ReadCloser, error)
56
57	// Image operations
58	PullImage(ctx context.Context, image string) error
59	PullImageWithAuth(ctx context.Context, image, username, password string) error
60	RemoveImage(ctx context.Context, image string, force bool) error
61	ListImages(ctx context.Context) ([]string, error)
62
63	// Runtime information
64	Ping(ctx context.Context) error
65	Version(ctx context.Context) (string, error)
66
67	// Health and status
68	IsContainerRunning(ctx context.Context, containerID string) (bool, error)
69	GetContainerPort(ctx context.Context, containerID string, internalPort int) (int, error)
70
71	// Image and port inspection
72	GetImageExposedPorts(ctx context.Context, imageRef string) ([]int, error)
73	GetContainerExposedPorts(ctx context.Context, containerID string) ([]int, error)
74	GetContainerNetworkInfo(ctx context.Context, containerID string) (string, int, error)
75
76	// Volume management
77	InspectImageVolumes(ctx context.Context, imageRef string) ([]string, error)
78	VolumeExists(ctx context.Context, volumeName string) (bool, error)
79	CreateVolume(ctx context.Context, volumeName string) error
80	RemoveVolume(ctx context.Context, volumeName string, force bool) error
81
82	// Environment inspection
83	InspectImageEnv(ctx context.Context, imageRef string) ([]string, error)
84
85	// Network management
86	CreateNetwork(ctx context.Context, name string, options map[string]string) error
87	RemoveNetwork(ctx context.Context, name string) error
88	ListNetworks(ctx context.Context) ([]*NetworkInfo, error)
89	NetworkExists(ctx context.Context, name string) (bool, error)
90	ConnectContainerToNetwork(ctx context.Context, containerName, networkName string) error
91	DisconnectContainerFromNetwork(ctx context.Context, containerName, networkName string) error
92}

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