func NewClient(opts ...Option) *Client {
	client := Client{
		timeout:                defaultHTTPTimeout,
		hystrixTimeout:         defaultHystriximeout,
		maxConcurrentRequests:  defaultMaxConcurrentRequests,
		errorPercentThreshold:  defaultErrorPercentThreshold,
		sleepWindow:            defaultSleepWindow,
		requestVolumeThreshold: defaultRequestVolumeThreshold,
		retryCount:             defaultHystrixRetryCount,
		retrier:                heimdall.NewNoRetrier(),
	}

	for _, opt := range opts {
		opt(&client)
	}

	if client.client == nil {
		client.client = &http.Client{
			Timeout: client.timeout,
		}
	}

	hystrix.ConfigureCommand(client.hystrixCommandName, hystrix.CommandConfig{
		Timeout:                int(client.hystrixTimeout),
		MaxConcurrentRequests:  client.maxConcurrentRequests,
		RequestVolumeThreshold: client.requestVolumeThreshold,
		SleepWindow:            client.sleepWindow,
		ErrorPercentThreshold:  client.errorPercentThreshold,
	})

	return &client
}
// NewClient returns a new instance of hystrix Client
NewClient returns a new instance of hystrix Client
// NewClient returns a new instance of hystrix Client
func NewClient(opts ...Option) *Client {
	client := Client{
		timeout:                defaultHTTPTimeout,
		hystrixTimeout:         defaultHystriximeout,
		maxConcurrentRequests:  defaultMaxConcurrentRequests,
		errorPercentThreshold:  defaultErrorPercentThreshold,
		sleepWindow:            defaultSleepWindow,
		requestVolumeThreshold: defaultRequestVolumeThreshold,
		retryCount:             defaultHystrixRetryCount,
		retrier:                heimdall.NewNoRetrier(),
	}
	for _, opt := range opts {
		opt(&client)
	}
	if client.client == nil {
		client.client = &http.Client{
			Timeout: client.timeout,
		}
	}
	hystrix.ConfigureCommand(client.hystrixCommandName, hystrix.CommandConfig{
		Timeout:                int(client.hystrixTimeout),
		MaxConcurrentRequests:  client.maxConcurrentRequests,
		RequestVolumeThreshold: client.requestVolumeThreshold,
		SleepWindow:            client.sleepWindow,
		ErrorPercentThreshold:  client.errorPercentThreshold,
	})
	return &client
}
func NewClient ( opts ... Option ) * Client { client := Client { timeout : defaultHTTPTimeout , hystrixTimeout : defaultHystriximeout , maxConcurrentRequests : defaultMaxConcurrentRequests , errorPercentThreshold : defaultErrorPercentThreshold , sleepWindow : defaultSleepWindow , requestVolumeThreshold : defaultRequestVolumeThreshold , retryCount : defaultHystrixRetryCount , retrier : heimdall . NewNoRetrier ( ) , } for _ , opt := range opts { opt ( & client ) } if client . client == nil { client . client = & http . Client { Timeout : client . timeout , } } hystrix . ConfigureCommand ( client . hystrixCommandName , hystrix . CommandConfig { Timeout : int ( client . hystrixTimeout ) , MaxConcurrentRequests : client . maxConcurrentRequests , RequestVolumeThreshold : client . requestVolumeThreshold , SleepWindow : client . sleepWindow , ErrorPercentThreshold : client . errorPercentThreshold , } ) return & client }
NewClient returns a new instance of hystrix Client
NewClient returns a new instance of hystrix Client