Documentation
¶
Overview ¶
Package proxy describes siding-proxy: one Traefik with the Docker provider, run as its own Compose project, through which every stack is reached by host and path.
Index ¶
Constants ¶
const AccessLogFlag = "--accesslog=true"
AccessLogFlag is in the command of a proxy that records its requests.
const HostGateway = "host-gateway"
HostGateway is the host alias when the Docker daemon runs in a VM: Docker's own name for the machine outside it.
const Image = "traefik:v3.7.16"
Image is the Traefik image siding-proxy runs; the devcontainer's SIDING_TRAEFIK_IMAGE is the same.
const RoutesMount = "/etc/siding/routes"
RoutesMount is where the proxy reads route files that siding ui writes.
Variables ¶
This section is empty.
Functions ¶
func ComposeFile ¶
ComposeFile renders the proxy's compose file. The constraint keeps Traefik to containers siding labelled for this proxy's network, so foreign Traefik labels on the same daemon are never exposed. The access log on stdout records only the router and the time of a request; Docker keeps it at 30 MiB at most (phase 4 design D3).
Types ¶
type Config ¶
type Config struct {
Project string // Compose project
Container string // container name
Network string // Docker network every routed service joins
Image string
DefaultPort int // host port on 127.0.0.1 when setup gets no --port
}
Config names the proxy and its network. Tests use their own, so they never touch a developer's siding-proxy.
type Settings ¶
type Settings struct {
Port int
Machine string
// Budget is the memory budget in bytes, 0 for the default.
Budget int64
// Builds is the number of build slots, 0 for the default.
Builds int
// Idle is the idle threshold in seconds, 0 for off, nil for the default.
Idle *int64
// RoutesDir is the directory on this machine with the route files of siding ui.
RoutesDir string
// HostAlias is what host.docker.internal resolves to in the proxy: the proxy network's
// gateway when that is an address of this machine, else HostGateway (design D2).
HostAlias string
}
Settings are what one setup chooses for the proxy.