httpclient

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorInvalidURL         = errors.New("url is invalid")
	ErrorReadingRespBody    = errors.New("error reading response body")
	ErrorRequestFailed      = errors.New("error making request")
	ErrorRequestBodyInvalid = errors.New("failed to convert request body data to JSON")

	DefaultTimeout time.Duration // nolint:gochecknoglobals // ok
	Post           = "POST"      // nolint:gochecknoglobals // ok
	Delete         = "DELETE"    // nolint:gochecknoglobals // ok
	Get            = "GET"       // nolint:gochecknoglobals // ok
)

Functions

This section is empty.

Types

type Header map[string]string

Header is a type used to store header field name/value pairs when sending HTTPS requests.

type ReqResp

type ReqResp interface {
	HTTPreq() error

	CloseBody()
	RespBody() string
	ResponseCode() int
	// contains filtered or unexported methods
}

func NewReqResp

func NewReqResp(ctx context.Context, url *url.URL, method *string, body interface{}, header Header,
	timeout *time.Duration, logger logr.Logger, client *http.Client, transport http.RoundTripper) (ReqResp, error)

Jump to

Keyboard shortcuts

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