}
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