Documentation
¶
Overview ¶
Package support holds helpers shared by the default HTTP and MCP client implementations: option identity, header canonicalization, endpoint validation, limit resolution and the hardened transport factory.
Index ¶
- func CanonicalHeaders(source map[string]string) (map[string]string, error)
- func Identity(options any) (string, error)
- func Limits(limits client.Limits) (time.Duration, int64, error)
- func NewBoundedTransportClient(limit int64) *http.Client
- func NewTransportClient() *http.Client
- func ValidateEndpointURL(raw string) (*url.URL, error)
- func WithResponseLimitFailure(ctx context.Context, fail func(error)) context.Context
- func WithTimeout(ctx context.Context, timeout time.Duration) (context.Context, context.CancelFunc)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CanonicalHeaders ¶
CanonicalHeaders canonicalizes static header names and rejects duplicates.
func Identity ¶
Identity digests the complete typed options so clients are scoped by configuration, never by caller.
func NewBoundedTransportClient ¶
NewBoundedTransportClient applies a limit to each HTTP response body before a protocol decoder can buffer it. Streaming responses share the limit across their complete body; the limit is not reset for individual Read calls.
func NewTransportClient ¶
NewTransportClient keeps default TLS verification and never follows redirects, so forwarded headers cannot leak to a redirect target.
func ValidateEndpointURL ¶
ValidateEndpointURL accepts absolute http/https URLs with a host and without embedded user information.
func WithResponseLimitFailure ¶
WithResponseLimitFailure lets a protocol wait be canceled with the read failure when its transport does not propagate streaming body errors itself.
func WithTimeout ¶
WithTimeout preserves caller cancellation without imposing a deadline at zero.
Types ¶
This section is empty.