sdktest

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: MIT Imports: 8 Imported by: 0 modules, 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

Overview

Package sdktest holds AWS SDK HTTP client helpers; only test files may import it.

Index

Constants

View Source
const InMemoryEndpoint = "http://gopherstack.invalid"

InMemoryEndpoint is the base endpoint to pair with the client from ServeInMemory.

Variables

This section is empty.

Functions

func HandlerClient

func HandlerClient(h http.Handler) *http.Client

HandlerClient returns a client that calls h in-process (no socket); usable inside a testing/synctest bubble. Pair it with InMemoryEndpoint.

func PlainBody

func PlainBody(inner aws.HTTPClient) aws.HTTPClient

PlainBody hides the request body's io.WriterTo from net/http: smithy-go's WriteTo returns io.EOF after close, which tears down live event streams (gopherstack-8wa8j).

func PlainBodyHTTPClient

func PlainBodyHTTPClient() aws.HTTPClient

PlainBodyHTTPClient returns a PlainBody client with keep-alives off, avoiding stale-conn reuse.

func Serve

func Serve(tb testing.TB, regs ...service.Registerable) string

Serve mounts regs behind the production service router on an httptest server and returns its URL.

func ServeInMemory

func ServeInMemory(tb testing.TB, regs ...service.Registerable) *http.Client

ServeInMemory is Serve without a socket: the returned client calls the router in-process, so it is usable inside a testing/synctest bubble. Pair it with InMemoryEndpoint.

Types

This section is empty.

Jump to

Keyboard shortcuts

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