httpclient

package
v0.0.0-...-fb1fb40 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2025 License: Apache-2.0 Imports: 7 Imported by: 7

Documentation

Overview

Package httpclient provides a thin, but testable, wrapper around http.Client. It adds an ECS header to requests and provides an interface

Index

Constants

View Source
const (
	DefaultDialTimeout         = 30 * time.Second
	DefaultDialKeepalive       = 30 * time.Second
	DefaultTLSHandshakeTimeout = 10 * time.Second
)

Below constants taken from the default http.Client behavior. Ref: https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/custom-http.html

Variables

This section is empty.

Functions

func New

func New(timeout time.Duration, insecureSkipVerify bool, agentVersion string, osType string) *http.Client

New returns an ECS httpClient with a roundtrip timeout of the given duration

Types

type OverridableTransport

type OverridableTransport interface {
	SetTransport(http.RoundTripper)
}

OverridableTransport is a transport that provides an override for testing purposes.

Directories

Path Synopsis
Package mock_http is a generated GoMock package.
Package mock_http is a generated GoMock package.

Jump to

Keyboard shortcuts

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