package main import ( "fmt" "os" "queryorchestration/internal/serviceconfig" ) // Note: All that a service needs to have its own config is to create a new // config type (any name you want) and add your customer variables to it that // then call the serviceconfig.InitializeConfig() function on it. type AnyServiceNameConfig struct { // BaseConfig has all of the common base configuration that all services should have // we can adjust what is in there as needed. serviceconfig.BaseConfig // Embed the base configuration // add any custom values that this service needs AppEnv string `env:"APP_ENV"` } // main // Dead simple example of of how to initialize a service custom config - AnyServiceNameConfig object in any project code. func main() { // create your own customer service config cfg := &AnyServiceNameConfig{} // and let the shared code initialize it for you correctly. if err := serviceconfig.InitializeConfig(cfg); err != nil { fmt.Printf("Error initializing the custom config (see output): %v\n", err) os.Exit(1) } fmt.Printf("config: %+v\n", cfg) cfg.Logger.Info("Service initialized ok.") }