Versions in this module Expand all Collapse all v2 v2.0.2 Jul 2, 2026 v2.0.1 Jun 29, 2026 Changes in this version + var ErrResponseTooLarge = errors.New("response body truncated, it exceeds configured limit") + var ErrWorkloadAPIH2CIncompatible = errors.New("workload API mTLS cannot be combined with h2c") + var ErrWorkloadAPITargetPathRequiresTrustDomain = errors.New("workload API target path requires a trust domain") + var ErrWorkloadAPITransportUnsupported = errors.New("workload API mTLS requires *http.Transport") + func NewHTTPClient(ctx context.Context, opts ...HTTPOption) *http.Client + func NewLoggingTransport(transport http.RoundTripper, opts ...LoggingTransportOption) http.RoundTripper + func WrapClient(client *http.Client, opts ...LoggingTransportOption) *http.Client + type HTTPOption func(*httpConfig) + func WithHTTPCheckRedirect(checkRedirect func(req *http.Request, via []*http.Request) error) HTTPOption + func WithHTTPClientCredentials(cfg *clientcredentials.Config) HTTPOption + func WithHTTPCookieJar(jar http.CookieJar) HTTPOption + func WithHTTPEnableH2C() HTTPOption + func WithHTTPIdleTimeout(timeout time.Duration) HTTPOption + func WithHTTPNoAuth() HTTPOption + func WithHTTPRetryPolicy(retryPolicy *RetryPolicy) HTTPOption + func WithHTTPTimeout(timeout time.Duration) HTTPOption + func WithHTTPTraceRequestHeaders() HTTPOption + func WithHTTPTraceRequests() HTTPOption + func WithHTTPTransport(transport http.RoundTripper) HTTPOption + func WithHTTPWorkloadAPITargetID(targetID string) HTTPOption + func WithHTTPWorkloadAPITargetPath(targetPath string) HTTPOption + func WithHTTPWorkloadAPITrustDomain(trustDomain string) HTTPOption + type InvokeResponse struct + Body io.ReadCloser + Headers http.Header + StatusCode int + func (s *InvokeResponse) Close() error + func (s *InvokeResponse) Decode(ctx context.Context, v any) error + func (s *InvokeResponse) ToContent(ctx context.Context) ([]byte, error) + func (s *InvokeResponse) ToFile(ctx context.Context, writer io.Writer) (int64, error) + type LoggingTransportOption func(*loggingTransport) + func WithTransportLogBody(enabled bool) LoggingTransportOption + func WithTransportLogHeaders(enabled bool) LoggingTransportOption + func WithTransportLogRequests(enabled bool) LoggingTransportOption + func WithTransportLogResponses(enabled bool) LoggingTransportOption + func WithTransportMaxBodySize(size int64) LoggingTransportOption + type Manager interface + Client func(ctx context.Context, opts ...HTTPOption) *http.Client + Close func() + Invoke func(ctx context.Context, method string, endpointURL string, payload any, ...) (*InvokeResponse, error) + InvokeStream func(ctx context.Context, method string, endpointURL string, body io.Reader, ...) (*InvokeResponse, error) + InvokeWithURLEncoded func(ctx context.Context, method string, endpointURL string, payload url.Values, ...) (*InvokeResponse, error) + SetClient func(ctx context.Context, cl *http.Client) + func NewManager(ctx context.Context, opts ...HTTPOption) Manager + type RetryPolicy struct + Backoff func(attempt int) time.Duration + MaxAttempts int Other modules containing this package github.com/pitabwire/frame