testutil

package
v0.0.0-...-30502bc Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2026 License: MIT Imports: 3 Imported by: ? 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockServer

type MockServer struct {
	*httptest.Server
	// contains filtered or unexported fields
}

MockServer wraps an httptest.Server pre-configured to simulate Shopier API responses.

func NewMockServer

func NewMockServer() *MockServer

NewMockServer initializes a new mock HTTP server.

func (*MockServer) Client

func (m *MockServer) Client(opts ...shopier.Option) *shopier.Client

Client returns a Shopier Client pointed at this mock server.

func (*MockServer) Handle

func (m *MockServer) Handle(pattern string, handler http.Handler)

Handle registers an HTTP handler for a specific path pattern.

func (*MockServer) HandleFunc

func (m *MockServer) HandleFunc(pattern string, fn http.HandlerFunc)

HandleFunc registers a handler function for a specific path pattern.

Jump to

Keyboard shortcuts

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