go-nacelle / nacelle

The Go service framework.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Provide access to nacelle.Config in the bootstrap function

aphistic opened this issue · comments

Hey! I'd like to be able to access nacelle.Config from the bootstrapper function somehow. My team would like to avoid using the DI features of Nacelle, but without access to the config from the bootstrapper function I'm then also not able to use the config to configure any services that are shared between processes or initializers (less likely initializers if we're not using the DI).

I was thinking a way this could be done without changing the existing bootstrap method signature would be to make the config available from the service container via something like:

func setup(processes nacelle.ProcessContainer, services nacelle.ServiceContainer) error {
    config, _ := services.Get("config").(nacelle.Config)
    // Do config stuff
}