Package m implements functionality specific to how I like my programs to work. It acts as glue between many of the other packages in this framework, putting them together in the way I find most useful.
Exec calls MustInit on the given Component, then blocks until an interrupt signal is received, then calls MustShutdown on the Component, until finally exiting the process.
MustInit will call mrun.Init on the given Component, which must have been created in this package, and exit the process if mrun.Init does not complete successfully.
func MustShutdown ¶
MustShutdown is like MustInit, except that it triggers the Shutdown event on the Component.
func RootComponent ¶
RootComponent returns a Component which should be used as the root Component when implementing most programs.
The returned Component will automatically handle setting up global configuration parameters like "log-level", as well as parsing those and all other parameters when the Init even is triggered on it.
func RootServiceComponent ¶
RootServiceComponent extends RootComponent so that it better supports long running processes which are expected to handle requests from outside clients.
Additional behavior it adds includes setting up an http endpoint where debug information about the running process can be accessed.