Documentation
¶
Overview ¶
Package app is subflux's composition root: the one boot path, the supervision of every long-running component, and the drain.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultPaths = Paths{Config: "/config/config.yaml", Health: health.DefaultPath}
DefaultPaths are the container layout.
Functions ¶
func Run ¶
Run boots and serves until ctx ends or a component returns, then drains. It returns a boot failure (the TCP bind included), the component's return that began the drain ("<name> exited" when it returned nil), or a drain overrun; nil when ctx's end began the drain. cmd/subflux exits 1 on any error.
Types ¶
type Config ¶
type Config struct {
Registries settings.Registries
// Listener, when set, replaces binding the HTTP port (tests).
Listener net.Listener
// LogOutput is where the process logs; nil is stderr.
LogOutput io.Writer
// Routes, when set, adds routes to the mux before serving (tests).
Routes func(*http.ServeMux)
// Settings, when set, receives the settings service once it is built, so
// a test can save through it.
Settings func(*settings.Service)
Paths Paths
}
Config is what Run boots from. Every field but Paths is optional.
Click to show internal directories.
Click to hide internal directories.