// NewHTTPClient constructs a new client.
341377
func NewHTTPClient(opts Options) (*HTTPClient, error) {
	o := *(*options)(opts.applyDefaults())
	return &HTTPClient{
		options: o,
		hc:      o.HTTPClient,
	}, nil
}
763381
func (c *Config) WithHTTPClient(client *http.Client) *Config {
	c.HTTPClient = client
	return c
}
848518
func NewClient(addresses []*url.URL, httpClient HTTPClient) *Client {
	if httpClient == nil {
		httpClient = http.DefaultClient
	}
	client := &Client{
		Master: addresses,
		HTTP:   httpClient,
	}

	return client
}
230740
func NewClient(endpoint string, opts ...ClientOption) *Client {
	c := &Client{
		endpoint: endpoint,
		Log:      func(string) {},
	}
	for _, optionFunc := range opts {
		optionFunc(c)
	}
	if c.httpClient == nil {
		c.httpClient = http.DefaultClient
	}
	return c
}
987719
func NewClient(url string, httpClient *http.Client) *Client {
	if httpClient == nil {
		httpClient = http.DefaultClient
	}
	return &Client{
		url:        url,
		httpClient: httpClient,
	}
}
340994
func NewClient(opts *NewClientOptions) (*Client, error) {
	if opts == nil {
		return nil, ErrClientOptionsRequired
	}
	if opts.Cluster != nil {
		return newClientUsingCluster(opts.Cluster)
	}
	if opts.RemoteAddresses != nil {
		return newClientUsingAddresses(opts.Port, opts.RemoteAddresses)
	}
	return nil, ErrClientMissingRequiredData
}
878669
func NewClient(cert tls.Certificate) (*http.Client, error) {
	config := &tls.Config{
		Certificates: []tls.Certificate{cert},
	}
	config.BuildNameToCertificate()
	transport := &http.Transport{TLSClientConfig: config}

	if err := http2.ConfigureTransport(transport); err != nil {
		return nil, err
	}

	return &http.Client{Transport: transport}, nil
}
477152
func createHttpClient() *http.Client {
	tr := util.Transport(services.Config().GetString(util.ConfigfwdProxyPortURL))
	tr.MaxIdleConnsPerHost = maxIdleConnsPerHost
	client := &http.Client{
		Transport: tr,
		Timeout:   httpTimeout,
		CheckRedirect: func(req *http.Request, _ []*http.Request) error {
			req.Header.Set("Authorization", "Bearer "+services.Config().GetString(configBearerToken))
			return nil
		},
	}
	return client
}
928749
func NewClient() *Client {
	client := &Client{
		api:       C.Create(),
		Variables: map[SettableVariable]string{},
		Trim:      true,
		shouldInit: true,
	}
	return client
}
559543
func NewClient(host string, port int) (client *Client, err error) {
	client = new(Client)
	client.Host = host
	client.Port = port
	client.Connection, err = net.Dial("tcp", fmt.Sprintf("%v:%v", client.Host, client.Port))
	return
}
1114989
func newClient(key string, url string, http *http.Client) *v1controller.Client {
	c := &v1controller.Client{
		Client: &httpclient.Client{
			ErrNotFound: ErrNotFound,
			Key:         key,
			URL:         url,
			HTTP:        http,
		},
	}
	return c
}
854638
func NewClient(baseAddr string) *Client {
	return &Client{
		baseAddr: baseAddr,
		client:   &http.Client{},
	}
}
1292670
func NewClient() *Client {
	return &Client{
		HTTPClient:   cleanhttp.DefaultClient(),
		Logger:       log.New(os.Stderr, "", log.LstdFlags),
		RetryWaitMin: defaultRetryWaitMin,
		RetryWaitMax: defaultRetryWaitMax,
		RetryMax:     defaultRetryMax,
		CheckRetry:   DefaultRetryPolicy,
		Backoff:      DefaultBackoff,
	}
}
835790
func NewClient(url string) *Client {
	return &Client{
		URL:    url,
		client: http.DefaultClient,
	}
}
154838
func NewClient(requrl string, transport http.RoundTripper) (*Client, error) {
	if transport == nil {
		transport = http.DefaultTransport
	}

	httpClient := &http.Client{Transport: transport}

	jar, err := cookiejar.New(nil)

	if err != nil {
		return nil, err
	}

	u, err := url.Parse(requrl)

	if err != nil {
		return nil, err
	}

	codec := clientCodec{
		url:        u,
		httpClient: httpClient,
		close:      make(chan uint64),
		ready:      make(chan uint64),
		responses:  make(map[uint64]*http.Response),
		cookies:    jar,
	}

	return &Client{rpc.NewClientWithCodec(&codec)}, nil
}
1305490
func NewHttpClient() *http.Client {
	dial_timeout, _ := time.ParseDuration(fmt.Sprintf("%vs", DIAL_TIMEOUT))

	netTransport := &http.Transport{
		Dial: (&net.Dialer{
			Timeout: dial_timeout}).Dial,
		TLSHandshakeTimeout: 5 * time.Second}

	netClient := &http.Client{
		Timeout:   10 * time.Second,
		Transport: netTransport}

	return netClient
}
649423
func NewHTTPClient(group, version string, schemeBuilder runtime.SchemeBuilder) (rest.Interface, *runtime.Scheme, error) {
	config, err := rest.InClusterConfig()
	if err != nil {
		return nil, nil, err
	}

	return NewHTTPClientFromConfig(group, version, schemeBuilder, config)
}