Documentation

Overview

    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.

    Index

    Constants

    This section is empty.

    Variables

    This section is empty.

    Functions

    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.

              Types

              This section is empty.

              Source Files