client

package
v0.0.0-...-c20d51c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 2, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package client provides a client for making HTTP requests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	RequestURL(*url.URL) (*http.Response, error)
	Request(*url.URL, string, string, http.Header) (*http.Response, error)
	SetCheckRedirect(func(*http.Request, []*http.Request) error)
}

Client is a thin wrapper around http.Client to make enhancements to support our use case.

type ClientFactory

type ClientFactory interface {
	Get() Client
}

A ClientFactory allows constructing HTTP Clients based on various Dialers or Transports.

type ProxyClientFactory

type ProxyClientFactory struct {
	// contains filtered or unexported fields
}

ProxyClientFactory uses the h12.io/socks package to support SOCKS proxies when transporting requests to the webserver.

func NewProxyClientFactory

func NewProxyClientFactory(proxies []string, timeout time.Duration, agent string) (*ProxyClientFactory, error)

Create a ProxyClientFactory for the provided list of proxies.

func (*ProxyClientFactory) Get

func (factory *ProxyClientFactory) Get() Client

Get a single client instance from the factory

func (*ProxyClientFactory) SetUsernamePassword

func (factory *ProxyClientFactory) SetUsernamePassword(username, password string)

Directories

Path Synopsis
Package mock provides a mock client to be used in testing.
Package mock provides a mock client to be used in testing.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL