main bac21c6

interface.go RawHistoryFolder

1package runtime
2
3import (
4	"context"
5	"io"
6	"time"
7)
8
9// Container represents a running container
10type Container struct {
11	ID     string
12	Image  string
13	Name   string
14	Status string
15	Ports  []int
16	Labels map[string]string
17}
18
19// NetworkInfo represents a network
20type NetworkInfo struct {
21	ID         string
22	Name       string
23	Driver     string
24	Containers []string
25	Labels     map[string]string
26}
27
28// ContainerConfig holds configuration for creating a container
29type ContainerConfig struct {
30	Image       string
31	Name        string
32	Env         []string
33	Ports       []int
34	Labels      map[string]string
35	WorkingDir  string
36	Cmd         []string
37	AutoRemove  bool
38	Volumes     map[string]string // map[containerPath]volumeName
39	NetworkMode string            // Network to join
40	Hostname    string            // Container hostname for DNS
41	Aliases     []string          // Additional network aliases
42}
43
44// ImageDetail represents detailed metadata for an image.
45type ImageDetail struct {
46	// ID is the runtime image identifier (for example, image ID/digest).
47	ID string
48	// RepoTags contains repository:tag references known for the image.
49	RepoTags []string
50	// Size is the image size in bytes.
51	Size int64
52	// Created is the image creation timestamp as reported by the runtime.
53	Created time.Time
54}
55
56// Runtime interface defines the contract for container runtime implementations
57type Runtime interface {
58	// Container lifecycle
59	CreateContainer(ctx context.Context, config *ContainerConfig) (*Container, error)
60	StartContainer(ctx context.Context, containerID string) error
61	WaitForContainer(ctx context.Context, containerID string) error
62	RemoveContainer(ctx context.Context, containerID string, force bool) error
63
64	// Container inspection
65	ListContainers(ctx context.Context, all bool) ([]*Container, error)
66	InspectContainer(ctx context.Context, containerID string) (*Container, error)
67	GetContainerLogs(ctx context.Context, containerID string, follow bool) (io.ReadCloser, error)
68
69	// Image operations
70	PullImage(ctx context.Context, image string) error
71	PullImageWithAuth(ctx context.Context, image, username, password string) error
72	RemoveImage(ctx context.Context, image string, force bool) error
73	ListImages(ctx context.Context) ([]string, error)
74	// ListImagesDetailed returns metadata for all images visible to the runtime.
75	ListImagesDetailed(ctx context.Context) ([]ImageDetail, error)
76
77	// Runtime information
78	Ping(ctx context.Context) error
79	Version(ctx context.Context) (string, error)
80
81	// Health and status
82	IsContainerRunning(ctx context.Context, containerID string) (bool, error)
83	GetContainerPort(ctx context.Context, containerID string, internalPort int) (int, error)
84
85	// Image and port inspection
86	GetImageExposedPorts(ctx context.Context, imageRef string) ([]int, error)
87	GetContainerExposedPorts(ctx context.Context, containerID string) ([]int, error)
88	GetContainerNetworkInfo(ctx context.Context, containerID string) (string, int, error)
89
90	// Volume management
91	InspectImageVolumes(ctx context.Context, imageRef string) ([]string, error)
92	VolumeExists(ctx context.Context, volumeName string) (bool, error)
93	// CreateVolume creates one named volume with the given labels.
94	// Labels carry ownership provenance; a caller that omits them
95	// creates an unmanaged volume that prune never adopts.
96	CreateVolume(ctx context.Context, volumeName string, labels map[string]string) error
97	RemoveVolume(ctx context.Context, volumeName string, force bool) error
98
99	// Environment inspection
100	InspectImageEnv(ctx context.Context, imageRef string) ([]string, error)
101
102	// Network management
103	CreateNetwork(ctx context.Context, name string, options map[string]string) error
104	RemoveNetwork(ctx context.Context, name string) error
105	ListNetworks(ctx context.Context) ([]*NetworkInfo, error)
106	NetworkExists(ctx context.Context, name string) (bool, error)
107	ConnectContainerToNetwork(ctx context.Context, containerName, networkName string) error
108	DisconnectContainerFromNetwork(ctx context.Context, containerName, networkName string) error
109}

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