httpclient

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Client *http.Client

Functions

This section is empty.

Types

type Config

type Config struct {
	TimeoutInSeconds   int
	InsecureSkipVerify bool
}

type HTTPClient

type HTTPClient struct {
	Client *http.Client
}

func New

func New() *HTTPClient

Create a new HTTPClient

func (*HTTPClient) DoRequest

func (h *HTTPClient) DoRequest(params Request) (*http.Response, error)

Make a HTTP request using default http.Client.Do function

type HTTPClientInterface added in v1.10.3

type HTTPClientInterface interface {
	DoRequest(params Request) (*http.Response, error)
}

type HttpClientMock added in v1.10.4

type HttpClientMock struct {
	mock.Mock
}

func (*HttpClientMock) DoRequest added in v1.10.4

func (mock *HttpClientMock) DoRequest(params Request) (*http.Response, error)

type Request

type Request struct {
	Method  string
	URL     string
	Headers map[string]string
	Body    io.Reader
	Config  Config
}

Jump to

Keyboard shortcuts

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