v2.11.0 dca6537

config.go RawHistoryFolder

1package in
2
3import (
4	"context"
5
6	"github.com/bnema/gordon/internal/domain"
7)
8
9// ConfigService defines the contract for configuration management.
10type ConfigService interface {
11	// Load loads the configuration from the configured source.
12	Load(ctx context.Context) error
13
14	// Reload re-reads the configuration file from disk and loads it into memory.
15	// This is different from Load() which only loads from the cached viper values.
16	Reload(ctx context.Context) error
17
18	// GetRoutes returns all configured routes.
19	GetRoutes(ctx context.Context) []domain.Route
20
21	// GetRoute returns a single route by domain.
22	GetRoute(ctx context.Context, domain string) (*domain.Route, error)
23
24	// AddRoute adds a new route to the configuration.
25	AddRoute(ctx context.Context, route domain.Route) error
26
27	// UpdateRoute updates an existing route.
28	UpdateRoute(ctx context.Context, route domain.Route) error
29
30	// RemoveRoute removes a route from the configuration.
31	RemoveRoute(ctx context.Context, domain string) error
32
33	// Save persists the current configuration to disk.
34	Save(ctx context.Context) error
35
36	// Watch starts watching for configuration changes.
37	// The onChange callback is called when configuration changes are detected.
38	Watch(ctx context.Context, onChange func()) error
39
40	// GetServerPort returns the configured server port.
41	GetServerPort() int
42
43	// GetRegistryPort returns the configured registry port.
44	GetRegistryPort() int
45
46	// GetRegistryDomain returns the configured registry domain.
47	GetRegistryDomain() string
48
49	// GetDataDir returns the configured data directory.
50	GetDataDir() string
51
52	// IsAutoRouteEnabled returns whether auto-route is enabled.
53	IsAutoRouteEnabled() bool
54
55	// IsNetworkIsolationEnabled returns whether network isolation is enabled.
56	IsNetworkIsolationEnabled() bool
57
58	// GetNetworkPrefix returns the prefix for created networks.
59	GetNetworkPrefix() string
60
61	// GetExternalRoutes returns all configured external routes.
62	GetExternalRoutes() map[string]string
63
64	// GetAllAttachments returns all configured attachments.
65	GetAllAttachments(ctx context.Context) map[string][]string
66
67	// GetAttachmentsFor returns attachments for a specific domain or network group.
68	GetAttachmentsFor(ctx context.Context, domainOrGroup string) ([]string, error)
69
70	// AddAttachment adds an image to a domain/group's attachments.
71	AddAttachment(ctx context.Context, domainOrGroup, image string) error
72
73	// RemoveAttachment removes an image from a domain/group's attachments.
74	RemoveAttachment(ctx context.Context, domainOrGroup, image string) error
75}

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