httpclient

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2023 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(cfg Config) (*http.Client, error)

New returns a new HTTP client with optional TLS and retry capabilities.

func NewWithLogger

func NewWithLogger(cfg Config, l zerolog.Logger) (*http.Client, error)

NewWithLogger returns a new HTTP client with optional TLS and retry capabilities. Retry attempts are logged using the given logger.

Types

type Config

type Config struct {
	TLS            *ConfigTLS    `json:"tls,omitempty"`
	TimeoutSeconds *optional.Int `json:"timeoutSeconds,omitempty"`
	MaxRetries     *optional.Int `json:"maxRetries,omitempty"`
}

Config represents configuration for an HTTP client with TLS and retry capabilities.

type ConfigTLS

type ConfigTLS struct {
	CABundle           string `json:"caBundle,omitempty"`
	InsecureSkipVerify bool   `json:"insecureSkipVerify,omitempty"`
}

ConfigTLS configures TLS for an HTTP client.

Jump to

Keyboard shortcuts

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