X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=pkg%2Frtmgr%2Frtmgr.go;h=e5e0dcb8aa88afcb11f0cf447bf5bb5e72279835;hb=8f7ca65ce6b2691e08bb3496c14fae88e32ad973;hp=f82276bcd3d6ebb3f2a4a20f6e7d0af52dc85cbe;hpb=749099bc00ec6cad5da19846e65bd5b4bd9b8de4;p=ric-plt%2Frtmgr.git diff --git a/pkg/rtmgr/rtmgr.go b/pkg/rtmgr/rtmgr.go index f82276b..e5e0dcb 100644 --- a/pkg/rtmgr/rtmgr.go +++ b/pkg/rtmgr/rtmgr.go @@ -35,6 +35,7 @@ import ( "github.com/ghodss/yaml" "io/ioutil" "os" + "strings" ) var ( @@ -121,11 +122,16 @@ var ( Eps Endpoints Subs SubscriptionList + PrsCfg *PlatformRoutes + Mtype MessageTypeList + DynamicRouteList []string ) func GetPlatformComponents(configfile string) (*PlatformComponents, error) { xapp.Logger.Debug("Invoked rtmgr.GetPlatformComponents(" + configfile + ")") var rcfg ConfigRtmgr + var rtroutes RtmgrRoutes + var mtypes MessageTypeIdentifier yamlFile, err := os.Open(configfile) if err != nil { return nil, errors.New("cannot open the file due to: " + err.Error()) @@ -139,6 +145,22 @@ func GetPlatformComponents(configfile string) (*PlatformComponents, error) { if err != nil { return nil, errors.New("cannot read the file due to: " + err.Error()) } + err = json.Unmarshal(jsonByteValue,&rtroutes) + if err != nil { + return nil, errors.New("cannot parse data due to: " + err.Error()) + } + PrsCfg = &(rtroutes.Prs) + + err = json.Unmarshal(jsonByteValue,&mtypes) + if err != nil { + return nil, errors.New("cannot parse data due to: " + err.Error()) + } else { + xapp.Logger.Debug("Messgaetypes = %v", mtypes) + for _,m := range mtypes.Mit { + splitstr := strings.Split(m,"=") + Mtype[splitstr[0]] = splitstr[1] + } + } err = json.Unmarshal(jsonByteValue, &rcfg) if err != nil { return nil, errors.New("cannot parse data due to: " + err.Error())