testutil

package
v0.0.0-...-bf9b64e Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MustJSON

func MustJSON(t *testing.T, v interface{}) []byte

MustJSON marshals the given value to JSON, panicking on error

func NewTestServer

func NewTestServer(t *testing.T, handler http.HandlerFunc) (*httptest.Server, func())

NewTestServer creates a new test server with the given handler function

func WriteJSON

func WriteJSON(w http.ResponseWriter, statusCode int, v interface{}) error

WriteJSON writes a JSON response with the given status code

Types

type ErrorResponse

type ErrorResponse struct {
	ErrorCode    int    `json:"errorCode"`
	ErrorMessage string `json:"errorMessage"`
}

ErrorResponse represents a standard error response from the API

Jump to

Keyboard shortcuts

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