func NewClient(config *Config) (*Client, error) {
	// bootstrap the config
	defConfig := DefaultConfig()

	if config.Address == "" {
		config.Address = defConfig.Address
	} else if _, err := url.Parse(config.Address); err != nil {
		return nil, fmt.Errorf("invalid address '%s': %v", config.Address, err)
	}

	if config.HTTPClient == nil {
		config.HTTPClient = defConfig.HTTPClient
	}

	client := &Client{
		config: *config,
	}
	return client, nil
}
// NewClient returns a new client
NewClient returns a new client
// NewClient returns a new client
func NewClient(config *Config) (*Client, error) {
	defConfig := DefaultConfig()
	if config.Address == "" {
		config.Address = defConfig.Address
	} else if _, err := url.Parse(config.Address); err != nil {
		return nil, fmt.Errorf("invalid address '%s': %v", config.Address, err)
	}
	if config.HTTPClient == nil {
		config.HTTPClient = defConfig.HTTPClient
	}
	client := &Client{
		config: *config,
	}
	return client, nil
}
func NewClient ( config * Config ) ( * Client , error ) { defConfig := DefaultConfig ( ) if config . Address == " " { config . Address = defConfig . Address } else if _ , err := url . Parse ( config . Address ) ; err != nil { return nil , fmt . Errorf ( " " , config . Address , err ) } if config . HTTPClient == nil { config . HTTPClient = defConfig . HTTPClient } client := & Client { config : * config , } return client , nil }
NewClient returns a new client
NewClient returns a new client
// bootstrap the config