httputils

package
v1.55.0 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2025 License: Apache-2.0 Imports: 3 Imported by: 20 modules, 62 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HttpClientDetails

type HttpClientDetails struct {
	User                  string
	Password              string
	ApiKey                string
	AccessToken           string
	Headers               map[string]string
	Transport             *http.Transport
	DialTimeout           time.Duration
	OverallRequestTimeout time.Duration
	// Prior to each retry attempt, the list of PreRetryInterceptors is invoked sequentially. If any of these interceptors yields a 'false' response, the retry process stops instantly.
	PreRetryInterceptors []PreRetryInterceptor
}

func (*HttpClientDetails) AddHeader added in v1.44.0

func (hcd *HttpClientDetails) AddHeader(headerName, headerValue string)

func (*HttpClientDetails) AddPreRetryInterceptor added in v1.35.4

func (hcd *HttpClientDetails) AddPreRetryInterceptor(preRetryInterceptors PreRetryInterceptor)

func (HttpClientDetails) Clone

func (hcd HttpClientDetails) Clone() *HttpClientDetails

func (*HttpClientDetails) SetContentTypeApplicationJson added in v1.44.0

func (hcd *HttpClientDetails) SetContentTypeApplicationJson()

type PollingAction added in v1.6.3

type PollingAction func() (shouldStop bool, responseBody []byte, err error)

type PollingExecutor added in v1.6.3

type PollingExecutor struct {
	// Maximum wait time in nanoseconds.
	Timeout time.Duration
	// Number of nanoseconds to sleep between polling attempts.
	PollingInterval time.Duration
	// Prefix to add at the beginning of each info/error message.
	MsgPrefix string
	// pollingAction is the operation to run until the condition fulfilled.
	PollingAction PollingAction
}

func (*PollingExecutor) Execute added in v1.6.3

func (runner *PollingExecutor) Execute() ([]byte, error)

type PreRetryInterceptor added in v1.35.4

type PreRetryInterceptor func() (shouldRetry bool)

Jump to

Keyboard shortcuts

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