http

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(cfg *ClientConfig) *http.Client

NewClient creates a new HTTP client with the given configuration

Types

type ClientConfig

type ClientConfig struct {
	Timeout       time.Duration
	MaxRetries    int
	RetryBaseWait time.Duration
}

ClientConfig holds HTTP client configuration

func DefaultClientConfig

func DefaultClientConfig() *ClientConfig

DefaultClientConfig returns default HTTP client configuration

type RetryableClient

type RetryableClient struct {
	// contains filtered or unexported fields
}

RetryableClient wraps an HTTP client with retry logic

func NewRetryableClient

func NewRetryableClient(cfg *ClientConfig) *RetryableClient

NewRetryableClient creates a new retryable HTTP client

func NewRetryableClientWithHTTPClient

func NewRetryableClientWithHTTPClient(client *http.Client) *RetryableClient

NewRetryableClientWithHTTPClient creates a RetryableClient with a custom http.Client (for testing)

func (*RetryableClient) Do

func (c *RetryableClient) Do(req *http.Request) (*http.Response, error)

Do executes the request with retry logic

func (*RetryableClient) GetClient

func (c *RetryableClient) GetClient() *http.Client

GetClient returns the underlying HTTP client

Jump to

Keyboard shortcuts

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