httpclient

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package httpclient provides a shared, configurable HTTP client for all modules. Using a single factory avoids each module creating its own client with inconsistent timeouts, user-agents or proxy settings.

Index

Constants

View Source
const (
	DefaultTimeout   = 15 * time.Second
	DefaultUserAgent = "Mozilla/5.0 (compatible; BLACKHORN/1.0; +https://github.com/DonatoReis/blackhorn)"
)

Variables

This section is empty.

Functions

func Default

func Default() *http.Client

Default returns an *http.Client with default settings.

func New

func New(opts Options) *http.Client

New returns an *http.Client configured with the given options. Redirects are followed up to 10 times by default.

Types

type Options

type Options struct {
	Timeout   time.Duration
	UserAgent string
}

Options configures the HTTP client.

Jump to

Keyboard shortcuts

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