"maxRetryOnFailure": 5,
"rxMessages": ["RIC_SUB_RESP", "RIC_SUB_FAILURE"],
"txMessages": ["RIC_SGNB_ADDITION_REQ", "RIC_SGNB_ADDITION_ACK"],
- "policies": [],
+ "policies": [801111, 902222],
"description": "rmr data port for ueec"
}
]
}
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
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
}
func (params *RMRClientParams) String() string {
- return fmt.Sprintf("ProtPort=%d MaxSize=%d ThreadType=%d StatDesc=%s LowLatency=%t FastAck=%t",
- params.RmrData.Port, params.RmrData.MaxSize, params.RmrData.ThreadType, params.StatDesc, params.RmrData.LowLatency, params.RmrData.FastAck)
+ return fmt.Sprintf("ProtPort=%d MaxSize=%d ThreadType=%d StatDesc=%s LowLatency=%t FastAck=%t Policies=%v",
+ params.RmrData.Port, params.RmrData.MaxSize, params.RmrData.ThreadType, params.StatDesc,
+ params.RmrData.LowLatency, params.RmrData.FastAck, params.RmrData.Policies)
}
//-----------------------------------------------------------------------------
ThreadType int
LowLatency bool
FastAck bool
+ Policies []int
MaxRetryOnFailure int
}