transport

package
v1.10.2 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package transport provides tuned HTTP transports for odek's API clients. All clients (LLM, Telegram, MCP) share the same connection pool to avoid redundant TCP/TLS handshakes on every request.

Index

Constants

View Source
const (
	DefaultTimeout        = 120 * time.Second
	DefaultMaxIdleConns   = 20
	DefaultMaxIdlePerHost = 10
	DefaultIdleTimeout    = 90 * time.Second
	DefaultKeepAlive      = 30 * time.Second
)

Default values for the pooled HTTP transport.

Variables

This section is empty.

Functions

func NewPooledClient

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

NewPooledClient creates an *http.Client with a tuned transport that reuses TCP/TLS connections across requests. Pass 0 for timeout to use the default (120s).

Use this instead of bare &http.Client{Timeout: ...} in all API clients to avoid the ~200ms per-request overhead of TCP+TLS handshakes.

Types

This section is empty.

Jump to

Keyboard shortcuts

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