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", Store: "/config/subflux.bolt", 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 store, the activation of the loaded configuration and 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. The store stays open after an overrun, for a request or job still on it. cmd/subflux exits 1 on any error.
Types ¶
type Config ¶
type Config struct {
// 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)
// Gather, when set, receives the metrics registry's Gather (tests).
Gather func(func(context.Context) ([]measure.Family, error))
// Status, when set, receives the status store once it is built (tests).
Status func(*status.Store)
// Scanner, when set, receives the media sources' Scanner once the first
// Active settings build it (tests).
Scanner func(*scan.Scanner)
// Orders, when set, replaces the aired order join over SkyHook (tests).
Orders mediasource.OrderJoin
Paths Paths
}
Config is what Run boots from. Every field but Paths is optional.
Click to show internal directories.
Click to hide internal directories.