Help us shape the future of Go! Take the 2026 Go Developer Survey

sdktest

package
v1.9.1 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2026 License: MIT Imports: 8 Imported by: 0

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