Documentation
¶
Overview ¶
Package transport provides shared HTTP round-trippers and wire helpers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PeekRequestBody ¶
PeekRequestBody returns the request body without consuming it, preferring GetBody and restoring req.Body otherwise. ok is false when the request has no body or reading it fails.
func SSEEventData ¶
SSEEventData splits one SSE event into its data-line payloads, with the "data:" prefix and one optional leading space stripped. commentOnly reports whether every line was a comment or blank.
Types ¶
type DiscoverShortCircuit ¶
type DiscoverShortCircuit struct {
Base http.RoundTripper
}
DiscoverShortCircuit answers the SDK client's SEP-2575 server/discover probe in-process with the method-not-found error a mark3labs-era gateway produced, so the client falls straight back to the legacy initialize handshake with zero network round trips for the probe.
type DynamicHeaderRoundTripper ¶
type DynamicHeaderRoundTripper struct {
Base http.RoundTripper
Headers func() map[string]string
}
DynamicHeaderRoundTripper injects headers resolved per request, for callers whose header set changes over a connection's lifetime (e.g. a pooled session that must always carry the caller's current credentials).
type HeaderRoundTripper ¶
type HeaderRoundTripper struct {
Base http.RoundTripper
Headers map[string]string
}
HeaderRoundTripper injects custom headers into every outgoing HTTP request. It clones the request before modifying headers to avoid mutating the caller's original.