Version: v0.0.0-...-c20f884 Latest Latest

This package is not in the latest version of its module.

Go to latest
Published: Jul 30, 2019 License: MIT Imports: 10 Imported by: 1



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.



This section is empty.


This section is empty.


func Exec

func Exec(cmp *mcmp.Component)

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.

func MustInit

func MustInit(cmp *mcmp.Component)

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

func MustShutdown(cmp *mcmp.Component)

MustShutdown is like MustInit, except that it triggers the Shutdown event on the Component.

func RootComponent

func RootComponent() *mcmp.Component

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

func RootServiceComponent() *mcmp.Component

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.


This section is empty.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL