Booting
The github.com/go-nacelle/nacelle
package provides a common bootstrapper object that initializes and supervises the core framework behaviors.
Applications written with nacelle should have a common entrypoint, as follows. The application-specific functionality is passed to a boostrapper on construction as a reference to a function that populates a process container. The BootAndExit
function initializes and supervises the application, blocks until the application shut down, then calls os.Exit
with the appropriate status code. A symmetric function called Boot
will perform the same behavior, but will return the integer status code instead of calling os.Exit
.
|
|
You can see additional examples of the bootstrapper in the example repository. Specifically, the main function of the HTTP API, the gRPC API, and the worker processes.