httpclient

package
v1.13.1 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2023 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
	Certificates       []tls.Certificate
}

type HTTPClient

type HTTPClient struct {
	Client *http.Client
	// contains filtered or unexported fields
}

func New

func New() *HTTPClient

func (*HTTPClient) DoRequest

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

Faça uma solicitação HTTP usando a função padrão http.Client.Do

func (*HTTPClient) SetTLSConfig added in v1.12.2

func (h *HTTPClient) SetTLSConfig(config *tls.Config)

Define a configuração do certificado TLS

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
	QueryParams map[string]string
}

Jump to

Keyboard shortcuts

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