runner

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package runner provides HTTP client and execution for contract tests and Arazzo workflows.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*http.Client
	// Auth adds headers (e.g. Authorization, X-API-Key) to every request when set.
	Auth func(*http.Request)
}

Client is an HTTP client configured for contract test runs (timeouts, optional retries, auth).

func NewClient

func NewClient(cfg *Config) (*Client, error)

NewClient returns a new runner client with the given config.

func (*Client) Do

func (c *Client) Do(ctx context.Context, req *http.Request) (*http.Response, error)

Do sends the request and returns the response. It respects context cancellation and applies Auth if set.

type Config

type Config struct {
	Timeout       time.Duration // request timeout; 0 = 30s default
	MaxConns      int           // max idle conns per host; 0 = default
	SkipTLSVerify bool          // skip TLS verification (insecure)
	// TLSClientCertFile and TLSClientKeyFile load an optional client certificate (mTLS).
	TLSClientCertFile string
	TLSClientKeyFile  string
	// TLSCACertFile optionally adds a PEM CA bundle for verifying the server (e.g. private PKI).
	TLSCACertFile string
	// Auth applies to every request (e.g. Bearer token, API key header).
	Auth func(*http.Request)
	// ProxyURL routes requests through an explicit proxy when set.
	ProxyURL string
}

Config configures the runner client.

Jump to

Keyboard shortcuts

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