code: func ParseUpstreamConfig(m map[string]interface{}) (UpstreamConfig, error) {
  	var cfg UpstreamConfig
  	err := mapstructure.WeakDecode(m, &cfg)
  	// Set defaults (even if error is returned)
  	if cfg.Protocol == "" {
  		cfg.Protocol = "tcp"
  	} else {
  		cfg.Protocol = strings.ToLower(cfg.Protocol)
  	}
  	if cfg.ConnectTimeoutMs < 1 {
  		cfg.ConnectTimeoutMs = 5000
  	}
  	return cfg, err
  }
docs: // ParseUpstreamConfig returns the UpstreamConfig parsed from the an opaque map.
  // If an error occurs during parsing it is returned along with the default
  // config this allows caller to choose whether and how to report the error.