apidump

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2026 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SuffixRequest is the file suffix for request dump files.
	SuffixRequest = ".req.txt"
	// SuffixResponse is the file suffix for response dump files.
	SuffixResponse = ".resp.txt"
)

Variables

This section is empty.

Functions

func NewPassthroughMiddleware added in v1.1.0

func NewPassthroughMiddleware(transport http.RoundTripper, baseDir string, provider string, logger slog.Logger, clk quartz.Clock) http.RoundTripper

NewPassthroughMiddleware returns http.RoundTripper that dumps requests and responses to files. If baseDir is empty, returns the original transport unchanged. Used for logging in pass through routes.

Types

type Middleware

type Middleware = func(*http.Request, MiddlewareNext) (*http.Response, error)

Middleware is an HTTP middleware function compatible with SDK WithMiddleware options.

func NewBridgeMiddleware added in v1.1.0

func NewBridgeMiddleware(baseDir string, provider string, model string, interceptionID uuid.UUID, logger slog.Logger, clk quartz.Clock) Middleware

NewBridgeMiddleware returns a middleware function that dumps requests and responses to files. If baseDir is empty, returns nil (no middleware).

type MiddlewareNext

type MiddlewareNext = func(*http.Request) (*http.Response, error)

MiddlewareNext is the function to call the next middleware or the actual request.

Jump to

Keyboard shortcuts

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