Documentation
¶
Overview ¶
Package router is Skiff's edge router: it discovers apps from Docker labels and reverse-proxies <app>.<domain> to them, with automatic HTTPS. It runs on the server. Reserved hosts: dash.<domain> → the control panel, status.<domain> → a live status page, and the apex + www.<domain> → a designated site app.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bucket ¶
type Bucket struct {
T int64 `json:"t"` // minute, unix seconds (floored)
Req int `json:"req"`
S2 int `json:"s2"`
S3 int `json:"s3"`
S4 int `json:"s4"`
S5 int `json:"s5"`
LatMs int64 `json:"lat"` // summed latency in ms (÷ Req for the average)
BytesI int64 `json:"bi"` // request bytes in
BytesO int64 `json:"bo"` // response bytes out
}
Bucket is one minute of traffic for an app.
type Metrics ¶
type Metrics struct {
// contains filtered or unexported fields
}
func NewMetrics ¶
type Router ¶
type Router struct {
Domains []string
Engine *docker.Engine
Panel string // fallback host:port of the control panel; dash.<domain> proxies here
// PanelPointer, when set, is a file holding the current panel host:port. The
// panel can rewrite it during a zero-downtime self-deploy to flip dash.<domain>
// onto the freshly-built process, so the router itself never restarts.
PanelPointer string
SiteApp string // app that serves the apex + www.<domain>
// DomainsFile, when set, is a JSON file of custom host→app mappings the panel
// maintains. The router reads it live (cached briefly) so domains can be added
// or removed without restarting the edge.
DomainsFile string
// MetricsFile, when set, is where the router snapshots per-app request metrics
// for the panel's Analytics page.
MetricsFile string
// contains filtered or unexported fields
}
func (*Router) ServeHTTPOnly ¶
ServeHTTPOnly runs the router over plain HTTP (for local testing, no TLS).
Click to show internal directories.
Click to hide internal directories.