testutil

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package testutil holds test-only helpers shared across the other internal packages. Most notably RewriteTransport, which rewrites outbound HTTP requests to a local httptest.Server so tests can stub Spotify API responses without hitting the real endpoint.

Import this package only from _test.go files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RewriteTransport

type RewriteTransport struct {
	Base   http.RoundTripper
	Target string
}

RewriteTransport redirects all requests to a test server URL.

func (*RewriteTransport) RoundTrip

func (t *RewriteTransport) RoundTrip(req *http.Request) (*http.Response, error)

Jump to

Keyboard shortcuts

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