X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=pkg%2Fxapp%2Fconfig.go;h=11daf4f6c9a6ee61785d08d04cad010f1d084ab8;hb=refs%2Fchanges%2F54%2F5154%2F2;hp=ff22d7117575f0c2ebfdad59165d60d49a9dfa48;hpb=ed11919144ea45905aef41a5062144013d0db9c0;p=ric-plt%2Fxapp-frame.git diff --git a/pkg/xapp/config.go b/pkg/xapp/config.go index ff22d71..11daf4f 100755 --- a/pkg/xapp/config.go +++ b/pkg/xapp/config.go @@ -139,6 +139,16 @@ func GetPortData(pname string) (d PortData) { return plist } + if viper.IsSet("messaging") == false { + if pname == "http" { + d.Port = 8080 + } + if pname == "rmr-data" { + d.Port = 4560 + } + return + } + for _, v := range viper.GetStringMap("messaging")["ports"].([]interface{}) { if n, ok := v.(map[string]interface{})["name"].(string); ok && n == pname { d.Name = n @@ -199,3 +209,7 @@ func (*Configurator) GetStringSlice(key string) []string { func (*Configurator) GetStringMap(key string) map[string]interface{} { return viper.GetStringMap(key) } + +func (*Configurator) IsSet(key string) bool { + return viper.IsSet(key) +}