httputil

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package httputil provides shared HTTP client utilities with optimized connection pooling. This prevents TIME_WAIT socket accumulation and improves performance.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultClient

func DefaultClient() *http.Client

DefaultClient returns a shared HTTP client with optimized connection pooling. The client is safe for concurrent use and reuses connections efficiently.

func Get

func Get(url string) (*http.Response, error)

Get performs a GET request using the default client

func Head(url string) (*http.Response, error)

Head performs a HEAD request using the default client

func NewClientWithTimeout

func NewClientWithTimeout(timeout time.Duration) *http.Client

NewClientWithTimeout creates a new HTTP client with the specified timeout. The client shares the optimized transport for connection reuse.

Types

This section is empty.

Jump to

Keyboard shortcuts

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