httpserver

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockHTTPServer

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

MockHTTPServer provides a configurable mock HTTP server for testing

func NewMockHTTPServer

func NewMockHTTPServer() *MockHTTPServer

NewMockHTTPServer creates a new mock HTTP server

func (*MockHTTPServer) AddResponse

func (m *MockHTTPServer) AddResponse(method, path string, response MockResponse)

AddResponse adds a mock response for a specific path and method

func (*MockHTTPServer) Close

func (m *MockHTTPServer) Close()

Close shuts down the mock server

func (*MockHTTPServer) URL

func (m *MockHTTPServer) URL() string

URL returns the base URL of the mock server

type MockResponse

type MockResponse struct {
	StatusCode int
	Body       string
	Headers    map[string]string
}

MockResponse defines a mock HTTP response

Jump to

Keyboard shortcuts

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