X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=pkg%2Fxapp%2Fconfig.go;h=bb76a07234a53b69d1155b18a5fd9f6b04e95a5b;hb=e525989b4fe86190faa820cc0a6e2f48ddb65e70;hp=8d427c5b77e671740a1089761fe005253d968568;hpb=b8b191fe31602c53414f8086381aef1a48e8be09;p=ric-plt%2Fxapp-frame.git diff --git a/pkg/xapp/config.go b/pkg/xapp/config.go index 8d427c5..bb76a07 100755 --- a/pkg/xapp/config.go +++ b/pkg/xapp/config.go @@ -127,6 +127,13 @@ func PublishConfigChange(appName, eventJson string) error { } func GetPortData(pname string) (d PortData) { + var getPolicies = func(policies []interface{}) (plist []int) { + for _, p := range policies { + plist = append(plist, int(p.(float64))) + } + return plist + } + for _, v := range viper.GetStringMap("messaging")["ports"].([]interface{}) { if n, ok := v.(map[string]interface{})["name"].(string); ok && n == pname { d.Name = n @@ -148,6 +155,9 @@ func GetPortData(pname string) (d PortData) { if m, _ := v.(map[string]interface{})["maxRetryOnFailure"].(float64); ok { d.MaxRetryOnFailure = int(m) } + if policies, ok := v.(map[string]interface{})["policies"]; ok { + d.Policies = getPolicies(policies.([]interface{})) + } } } return