apidump

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2026 License: AGPL-3.0 Imports: 15 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

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