-func init() {
- // Load xapp configuration
- Logger = LoadConfig()
-
- Logger.SetLevel(viper.GetInt("logger.level"))
- Resource = NewRouter()
- Config = Configurator{}
- Metric = NewMetrics(viper.GetString("metrics.url"), viper.GetString("metrics.namespace"), Resource.router)
- Subscription = NewSubscriber(viper.GetString("subscription.host"), viper.GetInt("subscription.timeout"))
-
- if viper.IsSet("db.namespaces") {
- namespaces := viper.GetStringSlice("db.namespaces")
- if len(namespaces) > 0 && namespaces[0] != "" {
- Sdl = NewSDLClient(viper.GetStringSlice("db.namespaces")[0])
- }
- if len(namespaces) > 1 && namespaces[1] != "" {
- Rnib = NewRNIBClient(viper.GetStringSlice("db.namespaces")[1])
- }
- } else {
- Sdl = NewSDLClient(viper.GetString("db.namespace"))
- }
-