testserver

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 31, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server is a simple HTTP server for serving test fixtures.

func Start

func Start(port int) *Server

Start creates and starts an HTTP server serving from testdata/static. Port 0 means the OS will choose an available port. Returns a Server handle for later cleanup.

func (*Server) Stop

func (s *Server) Stop()

Stop gracefully shuts down the server.

func (*Server) URL

func (s *Server) URL() string

URL returns the base URL for the server (e.g., "http://localhost:8080").

Directories

Path Synopsis
Package fixture provides a declarative, in-process HTTP test server for per-test scenarios that exercise HTTP-level behaviour (status codes, redirects, slow responses, charset declarations, header echoes, etc.).
Package fixture provides a declarative, in-process HTTP test server for per-test scenarios that exercise HTTP-level behaviour (status codes, redirects, slow responses, charset declarations, header echoes, etc.).

Jump to

Keyboard shortcuts

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