apidump

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2026 License: AGPL-3.0 Imports: 15 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

This section is empty.

Types

type Middleware

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

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

func NewMiddleware

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

NewMiddleware returns a middleware function that dumps requests and responses to files. Files are written to the path returned by DumpPath. 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