// Client sets a custom HTTP client for the Pusher. For convenience, this method
// returns a pointer to the Pusher itself.
197352
func (p *Pusher) Client(c *http.Client) *Pusher {
	p.client = c
	return p
}
779954
func NewClient(opts ClientOpts) *Client {
	if opts.HTTPClient == nil {
		opts.HTTPClient = &http.Client{}
	}

	return &Client{
		token:      opts.Token,
		baseURL:    opts.BaseURL,
		httpClient: opts.HTTPClient,
		userAgent:  opts.UserAgent,
	}
}
103559
func (c *Config) Client(ctx context.Context, t *Token) *http.Client {
	return NewClient(ctx, c, t)
}
549240
func HTTPClient(client *http.Client) Option {
	return func(c *Client) error {
		// create dns service
		l, err := dns.New(client)
		if err != nil {
			return err
		}
		return DNSService(l)(c)
	}
}
655858
func (bs *CephBackupStorage) client() (*minio.Client, error) {
	bs.mu.Lock()
	defer bs.mu.Unlock()

	if bs._client == nil {
		configFile, err := os.Open(*configFilePath)
		if err != nil {
			return nil, fmt.Errorf("file not present : %v", err)
		}
		defer configFile.Close()
		jsonParser := json.NewDecoder(configFile)
		if err = jsonParser.Decode(&storageConfig); err != nil {
			return nil, fmt.Errorf("error parsing the json file : %v", err)
		}

		accessKey := storageConfig.AccessKey
		secretKey := storageConfig.SecretKey
		url := storageConfig.EndPoint
		useSSL := storageConfig.UseSSL

		client, err := minio.NewV2(url, accessKey, secretKey, useSSL)
		if err != nil {
			return nil, err
		}
		bs._client = client
	}
	return bs._client, nil
}
670365
func (b *backend) Client(token string) (*github.Client, error) {
	tc := cleanhttp.DefaultClient()
	if token != "" {
		ctx := context.WithValue(context.Background(), oauth2.HTTPClient, tc)
		tc = oauth2.NewClient(ctx, &tokenSource{Value: token})
	}

	return github.NewClient(tc), nil
}
360498
func Client() (*client.Client, error) {
	server := os.Getenv("CAMLI_API_HOST")
	if server == "" {
		return nil, errors.New("CAMLI_API_HOST var not set")
	}
	am, err := basicAuth()
	if err != nil {
		return nil, err
	}
	return client.New(
		client.OptionNoExternalConfig(),
		client.OptionServer(server),
		client.OptionAuthMode(am),
	)
}
406688
func WithClient(client *http.Client) DevToolsOption {
	return func(d *DevTools) {
		d.client = client
	}
}
32346
func (c *Context) NewClient() (*http.Client, error) {
	jar, err := c.NewCookieJar()
	if err != nil {
		return nil, err
	}
	client := &http.Client{
		Jar:       jar,
		Transport: http.DefaultTransport,
	}
	c.Client = client
	return client, nil
}
541650
func (gitter *Gitter) SetClient(client *http.Client) {
	gitter.config.client = client
}
746735
func HTTPClient(client *http.Client) HTTPOption {
	return func(c *HTTPCollector) { c.client = client }
}
508585
func (i *info) Client() hrpc.RegionClient {
	i.m.RLock()
	c := i.client
	i.m.RUnlock()
	return c
}
1094676
func NewClient() *Client {
	return &Client{
		UserAgent: "grab",
		HTTPClient: &http.Client{
			Transport: &http.Transport{
				Proxy: http.ProxyFromEnvironment,
			},
		},
	}
}
890156
func (s *Sling) Client(httpClient *http.Client) *Sling {
	if httpClient == nil {
		return s.Doer(http.DefaultClient)
	}
	return s.Doer(httpClient)
}
731099
func (c *Context) ResetClient() (*http.Client, error) {
	client, err := c.NewClient()
	c.Client = client
	return client, err
}
882356
func Client(c *sqs.SQS) broker.Option {
	return func(o *broker.Options) {
		if o.Context == nil {
			o.Context = context.Background()
		}
		o.Context = context.WithValue(o.Context, sqsClientKey{}, c)
	}
}
151033
func (s *state) RootHTTPClient() (*httprequest.Client, error) {
	return s.httpClient(&url.URL{
		Scheme: s.serverScheme,
		Host:   s.Addr(),
	})
}