options

package
v1.49.9 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPConfig added in v1.48.0

type HTTPConfig struct {
	Timeout   time.Duration
	Transport http.RoundTripper

	EnableH2C bool

	Jar           http.CookieJar
	CheckRedirect func(req *http.Request, via []*http.Request) error
	IdleTimeout   time.Duration

	CliCredCfg *clientcredentials.Config

	TraceRequests       bool
	TraceRequestHeaders bool
}

HTTPConfig holds HTTP client configuration.

type HTTPOption

type HTTPOption func(*HTTPConfig)

HTTPOption configures HTTP client behavior. It can be used to configure Timeout, Transport, and other HTTP client settings.

func WithHTTPCheckRedirect

func WithHTTPCheckRedirect(checkRedirect func(req *http.Request, via []*http.Request) error) HTTPOption

WithHTTPCheckRedirect sets the redirect policy.

func WithHTTPClientCredentials

func WithHTTPClientCredentials(cfg *clientcredentials.Config) HTTPOption

WithHTTPClientCredentials the client credentials the client can utilize.

func WithHTTPCookieJar

func WithHTTPCookieJar(jar http.CookieJar) HTTPOption

WithHTTPCookieJar sets the cookie Jar.

func WithHTTPEnableH2C added in v1.48.9

func WithHTTPEnableH2C() HTTPOption

WithHTTPEnableH2C sets the client to perform HTTP H2C Transport.

func WithHTTPIdleTimeout

func WithHTTPIdleTimeout(timeout time.Duration) HTTPOption

WithHTTPIdleTimeout sets the idle Timeout.

func WithHTTPTimeout

func WithHTTPTimeout(timeout time.Duration) HTTPOption

WithHTTPTimeout sets the request Timeout.

func WithHTTPTraceRequestHeaders added in v1.48.7

func WithHTTPTraceRequestHeaders(traceRequestHeaders bool) HTTPOption

WithHTTPTraceRequestHeaders sets the trace request headers.

func WithHTTPTraceRequests added in v1.48.7

func WithHTTPTraceRequests(traceRequests bool) HTTPOption

WithHTTPTraceRequests sets the trace requests.

func WithHTTPTransport

func WithHTTPTransport(transport http.RoundTripper) HTTPOption

WithHTTPTransport sets the HTTP Transport.

Jump to

Keyboard shortcuts

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