func ConsumerInit(confConFile string) error {
	if confConFile == "" {
		return perrors.Errorf("application configure(consumer) file name is nil")
	}
	consumerConfig = &ConsumerConfig{}
	fileStream, err := yaml.UnmarshalYMLConfig(confConFile, consumerConfig)
	if err != nil {
		return perrors.Errorf("unmarshalYmlConfig error %v", perrors.WithStack(err))
	}
	consumerConfig.fileStream = bytes.NewBuffer(fileStream)
	//set method interfaceId & interfaceName
	for k, v := range consumerConfig.References {
		//set id for reference
		for _, n := range consumerConfig.References[k].Methods {
			n.InterfaceName = v.InterfaceName
			n.InterfaceId = k
		}
	}
	if consumerConfig.Request_Timeout != "" {
		if consumerConfig.RequestTimeout, err = time.ParseDuration(consumerConfig.Request_Timeout); err != nil {
			return perrors.WithMessagef(err, "time.ParseDuration(Request_Timeout{%#v})", consumerConfig.Request_Timeout)
		}
		if consumerConfig.RequestTimeout >= time.Duration(MaxWheelTimeSpan) {
			return perrors.WithMessagef(err, "request_timeout %s should be less than %s",
				consumerConfig.Request_Timeout, time.Duration(MaxWheelTimeSpan))
		}
	}
	if consumerConfig.Connect_Timeout != "" {
		if consumerConfig.ConnectTimeout, err = time.ParseDuration(consumerConfig.Connect_Timeout); err != nil {
			return perrors.WithMessagef(err, "time.ParseDuration(Connect_Timeout{%#v})", consumerConfig.Connect_Timeout)
		}
	}

	logger.Debugf("consumer config{%#v}\n", consumerConfig)

	return nil
}
// ConsumerInit loads config file to init consumer config
ConsumerInit loads config file to init consumer config
// ConsumerInit loads config file to init consumer config
func ConsumerInit(confConFile string) error {
	if confConFile == "" {
		return perrors.Errorf("application configure(consumer) file name is nil")
	}
	consumerConfig = &ConsumerConfig{}
	fileStream, err := yaml.UnmarshalYMLConfig(confConFile, consumerConfig)
	if err != nil {
		return perrors.Errorf("unmarshalYmlConfig error %v", perrors.WithStack(err))
	}
	consumerConfig.fileStream = bytes.NewBuffer(fileStream)
	for k, v := range consumerConfig.References {
		for _, n := range consumerConfig.References[k].Methods {
			n.InterfaceName = v.InterfaceName
			n.InterfaceId = k
		}
	}
	if consumerConfig.Request_Timeout != "" {
		if consumerConfig.RequestTimeout, err = time.ParseDuration(consumerConfig.Request_Timeout); err != nil {
			return perrors.WithMessagef(err, "time.ParseDuration(Request_Timeout{%#v})", consumerConfig.Request_Timeout)
		}
		if consumerConfig.RequestTimeout >= time.Duration(MaxWheelTimeSpan) {
			return perrors.WithMessagef(err, "request_timeout %s should be less than %s",
				consumerConfig.Request_Timeout, time.Duration(MaxWheelTimeSpan))
		}
	}
	if consumerConfig.Connect_Timeout != "" {
		if consumerConfig.ConnectTimeout, err = time.ParseDuration(consumerConfig.Connect_Timeout); err != nil {
			return perrors.WithMessagef(err, "time.ParseDuration(Connect_Timeout{%#v})", consumerConfig.Connect_Timeout)
		}
	}
	logger.Debugf("consumer config{%#v}\n", consumerConfig)
	return nil
}
func ConsumerInit ( confConFile string ) error { if confConFile == " " { return perrors . Errorf ( " " ) } consumerConfig = & ConsumerConfig { } fileStream , err := yaml . UnmarshalYMLConfig ( confConFile , consumerConfig ) if err != nil { return perrors . Errorf ( " " , perrors . WithStack ( err ) ) } consumerConfig . fileStream = bytes . NewBuffer ( fileStream ) for k , v := range consumerConfig . References { for _ , n := range consumerConfig . References [ k ] . Methods { n . InterfaceName = v . InterfaceName n . InterfaceId = k } } if consumerConfig . Request_Timeout != " " { if consumerConfig . RequestTimeout , err = time . ParseDuration ( consumerConfig . Request_Timeout ) ; err != nil { return perrors . WithMessagef ( err , " " , consumerConfig . Request_Timeout ) } if consumerConfig . RequestTimeout >= time . Duration ( MaxWheelTimeSpan ) { return perrors . WithMessagef ( err , " " , consumerConfig . Request_Timeout , time . Duration ( MaxWheelTimeSpan ) ) } } if consumerConfig . Connect_Timeout != " " { if consumerConfig . ConnectTimeout , err = time . ParseDuration ( consumerConfig . Connect_Timeout ) ; err != nil { return perrors . WithMessagef ( err , " " , consumerConfig . Connect_Timeout ) } } logger . Debugf ( " \n " , consumerConfig ) return nil }
ConsumerInit loads config file to init consumer config
ConsumerInit loads config file to init consumer config
//set method interfaceId & interfaceName //set id for reference