mock

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MocksDir = filepath.Join("testdata", "mocks")

Functions

func Record

func Record(t *testing.T, slug string) http.RoundTripper

func Replay

func Replay(t *testing.T, slug string) http.RoundTripper

Types

type RecordedResponse

type RecordedResponse struct {
	StatusCode int         `json:"status_code"`
	Headers    http.Header `json:"headers"`
	BodyBase64 string      `json:"body_base64"`
}

type Recording

type Recording struct {
	URL        string           `json:"url"`
	Method     string           `json:"method"`
	CapturedAt time.Time        `json:"captured_at"`
	LatencyMs  int64            `json:"latency_ms"`
	Response   RecordedResponse `json:"response"`
}

Jump to

Keyboard shortcuts

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