v2.1.0 0fb867d

event.go RawHistoryFolder

1package domain
2
3import (
4	"context"
5	"time"
6)
7
8// EventType defines the type of event that occurred.
9type EventType string
10
11const (
12	EventImagePushed          EventType = "image.pushed"
13	EventImageDeleted         EventType = "image.deleted"
14	EventConfigReload         EventType = "config.reload"
15	EventManualReload         EventType = "manual.reload"
16	EventContainerStop        EventType = "container.stop"
17	EventContainerStart       EventType = "container.start"
18	EventContainerHealthCheck EventType = "container.health_check"
19	EventContainerDeployed    EventType = "container.deployed"
20)
21
22// Event represents a domain event that occurred in the system.
23type Event struct {
24	ID          string
25	Type        EventType
26	Timestamp   time.Time
27	ImageName   string
28	Tag         string
29	Route       string
30	ContainerID string
31	Data        any
32}
33
34// ImagePushedPayload contains data for image.pushed events.
35type ImagePushedPayload struct {
36	Name        string
37	Reference   string
38	Manifest    []byte
39	Annotations map[string]string
40}
41
42// ContainerEventPayload contains data for container events.
43type ContainerEventPayload struct {
44	ContainerID string
45	Domain      string
46	Image       string
47	Action      string
48}
49
50// ConfigReloadPayload contains data for config.reload events.
51type ConfigReloadPayload struct {
52	Source        string // "file" or "manual"
53	AddedRoutes   []string
54	RemovedRoutes []string
55	UpdatedRoutes []string
56}
57
58// Context keys for domain-level concerns.
59type contextKey string
60
61const (
62	// ContextKeyInternalDeploy indicates the deployment is triggered internally
63	// (e.g., from our own registry's image.pushed event) and should use
64	// internal registry authentication for image pulls.
65	ContextKeyInternalDeploy contextKey = "internal_deploy"
66)
67
68// IsInternalDeploy checks if the context indicates an internal deployment.
69func IsInternalDeploy(ctx context.Context) bool {
70	v, ok := ctx.Value(ContextKeyInternalDeploy).(bool)
71	return ok && v
72}
73
74// WithInternalDeploy returns a context marked as an internal deployment.
75func WithInternalDeploy(ctx context.Context) context.Context {
76	return context.WithValue(ctx, ContextKeyInternalDeploy, true)
77}

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