httpclient

package
v0.36.0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package httpclient centralizes HTTP timeout defaults so the rest of the codebase doesn't sprinkle magic numbers across packages.

Index

Constants

View Source
const (
	// PluginCallTimeout bounds Lua-driven plugin HTTP calls (plugin/http.go).
	PluginCallTimeout = 10 * time.Second
	// RegistryFetchTimeout bounds plugin registry / plugin file fetches (plugins/embed.go).
	RegistryFetchTimeout = 10 * time.Second
	// RemoteImageTimeout bounds inline image fetches (view/html.go).
	// Kept short so message rendering doesn't stall.
	RemoteImageTimeout = 5 * time.Second
	// InstallTimeout bounds CLI install downloads (cli/install.go).
	InstallTimeout = 30 * time.Second
	// UpdateCheckTimeout bounds version checks and asset downloads from main (main.go).
	UpdateCheckTimeout = 30 * time.Second
	// IMAPBatchActionTimeout bounds bulk IMAP operations (delete/archive/move) from main (main.go).
	IMAPBatchActionTimeout = 60 * time.Second
	// IMAPSearchTimeout bounds server-side IMAP search queries from main (main.go).
	IMAPSearchTimeout = 60 * time.Second
)

Named timeouts. Each constant documents the call site it covers so future contributors don't have to grep for callers.

Variables

This section is empty.

Functions

func New

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

New returns an http.Client preconfigured with the given timeout.

func NewWithRedirectCap

func NewWithRedirectCap(timeout time.Duration, maxRedirects int) *http.Client

NewWithRedirectCap returns an http.Client with the given timeout and a hard cap on the number of redirects it will follow before giving up. Used by the main update / asset download client to avoid infinite chains.

Types

This section is empty.

Jump to

Keyboard shortcuts

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